var sviInitBundle=function(window,angular,$,jQuery,Highcharts,moment,undefined){if(!(window.hasOwnProperty("sviInvestorAppConfig")&&angular&&$&&jQuery&&Highcharts&&moment))return console.debug("One or more dependancies not yet loaded, waiting to init application."),window.setTimeout(function(){sviInitBundle(window,svi.angular,svi.$,svi.jQuery,svi.Highcharts,svi.moment)},200);var factory,types;angular.module("bootstrap-tagsinput",[]).directive("bootstrapTagsinput",["$timeout",function($timeout){function getItemProperty(scope,property){return property?angular.isFunction(scope.$parent[property])?scope.$parent[property]:function(item){return angular.isObject(item)&&item.hasOwnProperty(property)?item[property]:item}:undefined}return{restrict:"EA",scope:{model:"=ngModel",placeholder:"@"},template:'<select multiple placeholder="{{placeholder}}"></select>',replace:!1,controller:function($scope,$element,$attrs){$scope.placeholder=$attrs.placeholder=$attrs.placeholder||"Add Tag"},link:function(scope,element,attrs){$timeout(function(){angular.isArray(scope.model)||(scope.model=[]);var itemValue,select=$("select",element),options={tagClass:angular.isFunction(scope.$parent[attrs.tagclass])?scope.$parent[attrs.tagclass]:function(item){return attrs.tagclass}};if(angular.isDefined(attrs.itemvalue)?(itemValue=attrs.itemvalue,options.itemValue=getItemProperty(scope,attrs.itemvalue)):itemValue="value",angular.isDefined(attrs.itemtext)&&(options.itemText=getItemProperty(scope,attrs.itemtext)),angular.isFunction(scope.$parent[attrs.typeaheadSource])&&(options.confirmKeys=[]),select.tagsinput(options),angular.isFunction(scope.$parent[attrs.typeaheadSource])){var addTag=$.proxy(function(obj,datum){var item;item=void 0!==datum&&options.itemValue(datum)?datum:this.tagsinput("input").typeahead("val"),this.tagsinput("add",item),this.tagsinput("input").typeahead("val","")},select);select.tagsinput("input").typeahead(null,{source:scope.$parent[attrs.typeaheadSource],displayKey:options.itemText||itemValue}).on("typeahead:selected",addTag).on("keydown",function(e){13===e.which&&addTag()})}for(var i=0;i<scope.model.length;i++)select.tagsinput("add",scope.model[i]);select.on("itemAdded",function(event){-1===scope.model.indexOf(event.item)&&(scope.model.push(event.item),scope.$apply())}),select.on("itemRemoved",function(event){var idx=scope.model.indexOf(event.item);-1!==idx&&(scope.model.splice(idx,1),scope.$apply())});var prev=scope.model.slice();scope.$watch("model",function(){var i,added=scope.model.filter(function(i){return-1===prev.indexOf(i)}),removed=prev.filter(function(i){return-1===scope.model.indexOf(i)});for(prev=scope.model.slice(),i=0;i<removed.length;i++)select.tagsinput("remove",removed[i]);for(select.tagsinput("refresh"),i=0;i<added.length;i++)select.tagsinput("add",added[i])},!0)})}}}]),function(window,document,undefined){"use strict";function bsCompilerService($q,$http,$injector,$compile,$controller,$templateCache){function findElement(query,element){return angular.element((element||document).querySelectorAll(query))}this.compile=function(options){options.template&&/\.html$/.test(options.template)&&(console.warn("Deprecated use of `template` option to pass a file. Please use the `templateUrl` option instead."),options.templateUrl=options.template,options.template="");var templateUrl=options.templateUrl,template=options.template||"",controller=options.controller,controllerAs=options.controllerAs,resolve=options.resolve||{},locals=options.locals||{},transformTemplate=options.transformTemplate||angular.identity,bindToController=options.bindToController;if(angular.forEach(resolve,function(value,key){angular.isString(value)?resolve[key]=$injector.get(value):resolve[key]=$injector.invoke(value)}),angular.extend(resolve,locals),template)resolve.$template=$q.when(template);else{if(!templateUrl)throw new Error("Missing `template` / `templateUrl` option.");resolve.$template=fetchTemplate(templateUrl)}return options.titleTemplate&&(resolve.$template=$q.all([resolve.$template,fetchTemplate(options.titleTemplate)]).then(function(templates){var templateEl=angular.element(templates[0]);return findElement('[ng-bind="title"]',templateEl[0]).removeAttr("ng-bind").html(templates[1]),templateEl[0].outerHTML})),options.contentTemplate&&(resolve.$template=$q.all([resolve.$template,fetchTemplate(options.contentTemplate)]).then(function(templates){var templateEl=angular.element(templates[0]),contentEl=findElement('[ng-bind="content"]',templateEl[0]).removeAttr("ng-bind").html(templates[1]);return options.templateUrl||contentEl.next().remove(),templateEl[0].outerHTML})),$q.all(resolve).then(function(locals){var template=transformTemplate(locals.$template);options.html&&(template=template.replace(/ng-bind="/gi,'ng-bind-html="'));var element=angular.element("<div>").html(template.trim()).contents(),linkFn=$compile(element);return{locals:locals,element:element,link:function(scope){if(locals.$scope=scope,controller){var invokeCtrl=$controller(controller,locals,!0);bindToController&&angular.extend(invokeCtrl.instance,locals);var ctrl=angular.isObject(invokeCtrl)?invokeCtrl:invokeCtrl();element.data("$ngControllerController",ctrl),element.children().data("$ngControllerController",ctrl),controllerAs&&(scope[controllerAs]=ctrl)}return linkFn.apply(null,arguments)}}})};var fetchPromises={};function fetchTemplate(template){return fetchPromises[template]?fetchPromises[template]:fetchPromises[template]=$http.get(template,{cache:$templateCache}).then(function(res){return res.data})}}bsCompilerService.$inject=["$q","$http","$injector","$compile","$controller","$templateCache"],angular.module("mgcrea.ngStrap.typeahead",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$typeahead",function(){var defaults=this.defaults={animation:"am-fade",prefixClass:"typeahead",prefixEvent:"$typeahead",placement:"bottom-left",templateUrl:"typeahead/typeahead.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,minLength:1,filter:"bsAsyncFilter",limit:6,autoSelect:!1,comparator:"",trimValue:!0};this.$get=["$window","$rootScope","$tooltip","$$rAF","$timeout",function($window,$rootScope,$tooltip,$$rAF,$timeout){function TypeaheadFactory(element,controller,config){var $typeahead={},options=angular.extend({},defaults,config);$typeahead=$tooltip(element,options);var parentScope=config.scope,scope=$typeahead.$scope;scope.$resetMatches=function(){scope.$matches=[],scope.$activeIndex=options.autoSelect?0:-1},scope.$resetMatches(),scope.$activate=function(index){scope.$$postDigest(function(){$typeahead.activate(index)})},scope.$select=function(index,evt){scope.$$postDigest(function(){$typeahead.select(index)})},scope.$isVisible=function(){return $typeahead.$isVisible()},$typeahead.update=function(matches){scope.$matches=matches,scope.$activeIndex>=matches.length&&(scope.$activeIndex=options.autoSelect?0:-1),function(scope){scope.$$phase||scope.$root&&scope.$root.$$phase||scope.$digest()}(scope),$$rAF($typeahead.$applyPlacement)},$typeahead.activate=function(index){scope.$activeIndex=index},$typeahead.select=function(index){if(-1!==index){var value=scope.$matches[index].value;controller.$setViewValue(value),controller.$render(),scope.$resetMatches(),parentScope&&parentScope.$digest(),scope.$emit(options.prefixEvent+".select",value,index,$typeahead),angular.isDefined(options.onSelect)&&angular.isFunction(options.onSelect)&&options.onSelect(value,index,$typeahead)}},$typeahead.$isVisible=function(){return options.minLength&&controller?scope.$matches.length&&angular.isString(controller.$viewValue)&&controller.$viewValue.length>=options.minLength:!!scope.$matches.length},$typeahead.$getIndex=function(value){var index;for(index=scope.$matches.length;index--&&!angular.equals(scope.$matches[index].value,value););return index},$typeahead.$onMouseDown=function(evt){evt.preventDefault(),evt.stopPropagation()},$typeahead.$$updateScrollTop=function(container,index){if(-1<index&&index<container.children.length){var active=container.children[index],clientTop=active.offsetTop,clientBottom=active.offsetTop+active.clientHeight,highWatermark=container.scrollTop,lowWatermark=container.scrollTop+container.clientHeight;highWatermark<=clientBottom&&clientTop<highWatermark?container.scrollTop=Math.max(0,container.scrollTop-container.clientHeight):lowWatermark<clientBottom&&(container.scrollTop=clientTop)}},$typeahead.$onKeyDown=function(evt){/(38|40|13)/.test(evt.keyCode)&&(!$typeahead.$isVisible()||13===evt.keyCode&&-1===scope.$activeIndex||(evt.preventDefault(),evt.stopPropagation()),13===evt.keyCode&&scope.$matches.length?$typeahead.select(scope.$activeIndex):38===evt.keyCode&&0<scope.$activeIndex?scope.$activeIndex--:40===evt.keyCode&&scope.$activeIndex<scope.$matches.length-1?scope.$activeIndex++:angular.isUndefined(scope.$activeIndex)&&(scope.$activeIndex=0),$typeahead.$$updateScrollTop($typeahead.$element[0],scope.$activeIndex),scope.$digest())};var show=$typeahead.show;$typeahead.show=function(){show(),$timeout(function(){$typeahead.$element&&($typeahead.$element.on("mousedown",$typeahead.$onMouseDown),options.keyboard&&element&&element.on("keydown",$typeahead.$onKeyDown))},0,!1)};var hide=$typeahead.hide;return $typeahead.hide=function(){$typeahead.$element&&$typeahead.$element.off("mousedown",$typeahead.$onMouseDown),options.keyboard&&element&&element.off("keydown",$typeahead.$onKeyDown),options.autoSelect||$typeahead.activate(-1),hide()},$typeahead}return TypeaheadFactory.defaults=defaults,TypeaheadFactory}]}).filter("bsAsyncFilter",["$filter",function($filter){return function(array,expression,comparator){return array&&angular.isFunction(array.then)?array.then(function(results){return $filter("filter")(results,expression,comparator)}):$filter("filter")(array,expression,comparator)}}]).directive("bsTypeahead",["$window","$parse","$q","$typeahead","$parseOptions",function($window,$parse,$q,$typeahead,$parseOptions){var defaults=$typeahead.defaults;return{restrict:"EAC",require:"ngModel",link:function(scope,element,attr,controller){element.off("change");var options={scope:scope};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","filter","limit","minLength","watchOptions","selectMode","autoSelect","comparator","id","prefixEvent","prefixClass"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["html","container","trimValue","filter"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide","onSelect"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))}),element.attr("autocomplete")||element.attr("autocomplete","off");var filter=angular.isDefined(options.filter)?options.filter:defaults.filter,limit=options.limit||defaults.limit,comparator=options.comparator||defaults.comparator,bsOptions=attr.bsOptions;filter&&(bsOptions+=" | "+filter+":$viewValue",comparator&&(bsOptions+=":"+comparator)),limit&&(bsOptions+=" | limitTo:"+limit);var parsedOptions=$parseOptions(bsOptions),typeahead=$typeahead(element,controller,options);if(options.watchOptions){var watchedOptions=parsedOptions.$match[7].replace(/\|.+/,"").replace(/\(.*\)/g,"").trim();scope.$watchCollection(watchedOptions,function(newValue,oldValue){parsedOptions.valuesFn(scope,controller).then(function(values){typeahead.update(values),controller.$render()})})}scope.$watch(attr.ngModel,function(newValue,oldValue){scope.$modelValue=newValue,parsedOptions.valuesFn(scope,controller).then(function(values){options.selectMode&&!values.length&&0<newValue.length?controller.$setViewValue(controller.$viewValue.substring(0,controller.$viewValue.length-1)):(values.length>limit&&(values=values.slice(0,limit)),typeahead.update(values),controller.$render())})}),controller.$formatters.push(function(modelValue){var displayValue=parsedOptions.displayValue(modelValue);return displayValue||(angular.isDefined(modelValue)&&"object"!=typeof modelValue?modelValue:"")}),controller.$render=function(){if(controller.$isEmpty(controller.$viewValue))return element.val("");var index=typeahead.$getIndex(controller.$modelValue),selected=-1!==index?typeahead.$scope.$matches[index].label:controller.$viewValue,value=(selected=angular.isObject(selected)?parsedOptions.displayValue(selected):selected)?selected.toString().replace(/<(?:.|\n)*?>/gm,""):"",ss=element[0].selectionStart,sd=element[0].selectionEnd;element.val(!1===options.trimValue?value:value.trim()),element[0].setSelectionRange(ss,sd)},scope.$on("$destroy",function(){typeahead&&typeahead.destroy(),typeahead=options=null})}}}]),angular.module("mgcrea.ngStrap.tooltip",["mgcrea.ngStrap.core","mgcrea.ngStrap.helpers.dimensions"]).provider("$tooltip",function(){var defaults=this.defaults={animation:"am-fade",customClass:"",prefixClass:"tooltip",prefixEvent:"tooltip",container:!1,target:!1,placement:"top",templateUrl:"tooltip/tooltip.tpl.html",template:"",titleTemplate:!1,trigger:"hover focus",keyboard:!1,html:!1,show:!1,title:"",type:"",delay:0,autoClose:!1,bsEnabled:!0,mouseDownPreventDefault:!0,mouseDownStopPropagation:!0,viewport:{selector:"body",padding:0}};this.$get=["$window","$rootScope","$bsCompiler","$q","$templateCache","$http","$animate","$sce","dimensions","$$rAF","$timeout",function($window,$rootScope,$bsCompiler,$q,$templateCache,$http,$animate,$sce,dimensions,$$rAF,$timeout){var isNative=/(ip[ao]d|iphone|android)/gi.test($window.navigator.userAgent),isTouch="createTouch"in $window.document&&isNative,$body=angular.element($window.document);function safeDigest(scope){scope.$$phase||scope.$root&&scope.$root.$$phase||scope.$digest()}function findElement(query,element){return angular.element((element||document).querySelectorAll(query))}return function(element,config){var timeout,hoverState,compileData,tipElement,tipContainer,tipScope,_blur,_tipToHide,$tooltip={},options=$tooltip.$options=angular.extend({},defaults,config),promise=$tooltip.$promise=$bsCompiler.compile(options),scope=$tooltip.$scope=options.scope&&options.scope.$new()||$rootScope.$new(),nodeName=element[0].nodeName.toLowerCase();if(options.delay&&angular.isString(options.delay)){var split=options.delay.split(",").map(parseFloat);options.delay=1<split.length?{show:split[0],hide:split[1]}:split[0]}function enterAnimateCallback(){scope.$emit(options.prefixEvent+".show",$tooltip),angular.isDefined(options.onShow)&&angular.isFunction(options.onShow)&&options.onShow($tooltip)}function leaveAnimateCallback(){if(scope.$emit(options.prefixEvent+".hide",$tooltip),angular.isDefined(options.onHide)&&angular.isFunction(options.onHide)&&options.onHide($tooltip),tipElement===_tipToHide){if(_blur&&"focus"===options.trigger)return element[0].blur();destroyTipElement()}}function unbindKeyboardEvents(){"focus"!==options.trigger?tipElement.off("keyup",$tooltip.$onKeyUp):element.off("keyup",$tooltip.$onFocusKeyUp)}$tooltip.$id=options.id||element.attr("id")||"",options.title&&(scope.title=$sce.trustAsHtml(options.title)),scope.$setEnabled=function(isEnabled){scope.$$postDigest(function(){$tooltip.setEnabled(isEnabled)})},scope.$hide=function(){scope.$$postDigest(function(){$tooltip.hide()})},scope.$show=function(){scope.$$postDigest(function(){$tooltip.show()})},scope.$toggle=function(){scope.$$postDigest(function(){$tooltip.toggle()})},$tooltip.$isShown=scope.$isShown=!1,promise.then(function(data){compileData=data,$tooltip.init()}),$tooltip.init=function(){var triggers;options.delay&&angular.isNumber(options.delay)&&(options.delay={show:options.delay,hide:options.delay}),"self"===options.container?tipContainer=element:angular.isElement(options.container)?tipContainer=options.container:options.container&&(tipContainer=findElement(options.container)),triggers=options.trigger.split(" "),angular.forEach(triggers,function(trigger){"click"===trigger||"contextmenu"===trigger?element.on(trigger,$tooltip.toggle):"manual"!==trigger&&(element.on("hover"===trigger?"mouseenter":"focus",$tooltip.enter),element.on("hover"===trigger?"mouseleave":"blur",$tooltip.leave),"button"===nodeName&&"hover"!==trigger&&element.on(isTouch?"touchstart":"mousedown",$tooltip.$onFocusElementMouseDown))}),options.target&&(options.target=angular.isElement(options.target)?options.target:findElement(options.target)),options.show&&scope.$$postDigest(function(){"focus"===options.trigger?element[0].focus():$tooltip.show()})},$tooltip.destroy=function(){!function(){for(var triggers=options.trigger.split(" "),i=triggers.length;i--;){var trigger=triggers[i];"click"===trigger||"contextmenu"===trigger?element.off(trigger,$tooltip.toggle):"manual"!==trigger&&(element.off("hover"===trigger?"mouseenter":"focus",$tooltip.enter),element.off("hover"===trigger?"mouseleave":"blur",$tooltip.leave),"button"===nodeName&&"hover"!==trigger&&element.off(isTouch?"touchstart":"mousedown",$tooltip.$onFocusElementMouseDown))}}(),destroyTipElement(),scope.$destroy()},$tooltip.enter=function(){if(clearTimeout(timeout),hoverState="in",!options.delay||!options.delay.show)return $tooltip.show();timeout=setTimeout(function(){"in"===hoverState&&$tooltip.show()},options.delay.show)},$tooltip.show=function(){var parent,after;options.bsEnabled&&!$tooltip.$isShown&&(scope.$emit(options.prefixEvent+".show.before",$tooltip),angular.isDefined(options.onBeforeShow)&&angular.isFunction(options.onBeforeShow)&&options.onBeforeShow($tooltip),after=options.container?(parent=tipContainer)[0].lastChild?angular.element(tipContainer[0].lastChild):null:(parent=null,element),tipElement&&destroyTipElement(),tipScope=$tooltip.$scope.$new(),(tipElement=$tooltip.$element=compileData.link(tipScope,function(clonedElement,scope){})).css({top:"-9999px",left:"-9999px",right:"auto",display:"block",visibility:"hidden"}),options.animation&&tipElement.addClass(options.animation),options.type&&tipElement.addClass(options.prefixClass+"-"+options.type),options.customClass&&tipElement.addClass(options.customClass),after?after.after(tipElement):parent.prepend(tipElement),$tooltip.$isShown=scope.$isShown=!0,safeDigest(scope),$tooltip.$applyPlacement(),angular.version.minor<=2?$animate.enter(tipElement,parent,after,enterAnimateCallback):$animate.enter(tipElement,parent,after).then(enterAnimateCallback),safeDigest(scope),$$rAF(function(){tipElement&&tipElement.css({visibility:"visible"}),options.keyboard&&("focus"!==options.trigger&&$tooltip.focus(),"focus"!==options.trigger?tipElement.on("keyup",$tooltip.$onKeyUp):element.on("keyup",$tooltip.$onFocusKeyUp))}),options.autoClose&&$timeout(function(){tipElement.on("click",stopEventPropagation),$body.on("click",$tooltip.hide),_autoCloseEventsBinded=!0},0,!1))},$tooltip.leave=function(){if(clearTimeout(timeout),hoverState="out",!options.delay||!options.delay.hide)return $tooltip.hide();timeout=setTimeout(function(){"out"===hoverState&&$tooltip.hide()},options.delay.hide)},$tooltip.hide=function(blur){$tooltip.$isShown&&(scope.$emit(options.prefixEvent+".hide.before",$tooltip),angular.isDefined(options.onBeforeHide)&&angular.isFunction(options.onBeforeHide)&&options.onBeforeHide($tooltip),_blur=blur,null!==(_tipToHide=tipElement)&&(angular.version.minor<=2?$animate.leave(tipElement,leaveAnimateCallback):$animate.leave(tipElement).then(leaveAnimateCallback)),$tooltip.$isShown=scope.$isShown=!1,safeDigest(scope),options.keyboard&&null!==tipElement&&unbindKeyboardEvents(),options.autoClose&&null!==tipElement&&unbindAutoCloseEvents())},$tooltip.toggle=function(evt){evt&&evt.preventDefault(),$tooltip.$isShown?$tooltip.leave():$tooltip.enter()},$tooltip.focus=function(){tipElement[0].focus()},$tooltip.setEnabled=function(isEnabled){options.bsEnabled=isEnabled},$tooltip.setViewport=function(viewport){options.viewport=viewport},$tooltip.$applyPlacement=function(){if(tipElement){var placement=options.placement,autoToken=/\s?auto?\s?/i,autoPlace=autoToken.test(placement);autoPlace&&(placement=placement.replace(autoToken,"")||defaults.placement),tipElement.addClass(options.placement);var elementPosition=getPosition(),tipWidth=tipElement.prop("offsetWidth"),tipHeight=tipElement.prop("offsetHeight");if($tooltip.$viewport=options.viewport&&findElement(options.viewport.selector||options.viewport),autoPlace){var originalPlacement=placement,viewportPosition=getPosition($tooltip.$viewport);/bottom/.test(originalPlacement)&&elementPosition.bottom+tipHeight>viewportPosition.bottom?placement=originalPlacement.replace("bottom","top"):/top/.test(originalPlacement)&&elementPosition.top-tipHeight<viewportPosition.top&&(placement=originalPlacement.replace("top","bottom")),/left/.test(originalPlacement)&&elementPosition.left-tipWidth<viewportPosition.left?placement=placement.replace("left","right"):/right/.test(originalPlacement)&&elementPosition.right+tipWidth>viewportPosition.width&&(placement=placement.replace("right","left")),tipElement.removeClass(originalPlacement).addClass(placement)}!function(offset,placement){var tip=tipElement[0],width=tip.offsetWidth,height=tip.offsetHeight,marginTop=parseInt(dimensions.css(tip,"margin-top"),10),marginLeft=parseInt(dimensions.css(tip,"margin-left"),10);isNaN(marginTop)&&(marginTop=0),isNaN(marginLeft)&&(marginLeft=0),offset.top=offset.top+marginTop,offset.left=offset.left+marginLeft,dimensions.setOffset(tip,angular.extend({using:function(props){tipElement.css({top:Math.round(props.top)+"px",left:Math.round(props.left)+"px",right:""})}},offset),0);var actualWidth=tip.offsetWidth,actualHeight=tip.offsetHeight;if("top"===placement&&actualHeight!==height&&(offset.top=offset.top+height-actualHeight),!/top-left|top-right|bottom-left|bottom-right/.test(placement)){var delta=function(placement,position,actualWidth,actualHeight){var delta={top:0,left:0};if(!$tooltip.$viewport)return delta;var viewportPadding=options.viewport&&options.viewport.padding||0,viewportDimensions=getPosition($tooltip.$viewport);if(/right|left/.test(placement)){var topEdgeOffset=position.top-viewportPadding-viewportDimensions.scroll,bottomEdgeOffset=position.top+viewportPadding-viewportDimensions.scroll+actualHeight;topEdgeOffset<viewportDimensions.top?delta.top=viewportDimensions.top-topEdgeOffset:bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height&&(delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset)}else{var leftEdgeOffset=position.left-viewportPadding,rightEdgeOffset=position.left+viewportPadding+actualWidth;leftEdgeOffset<viewportDimensions.left?delta.left=viewportDimensions.left-leftEdgeOffset:rightEdgeOffset>viewportDimensions.right&&(delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset)}return delta}(placement,offset,actualWidth,actualHeight);if(delta.left?offset.left+=delta.left:offset.top+=delta.top,dimensions.setOffset(tip,offset),/top|right|bottom|left/.test(placement)){var isVertical=/top|bottom/.test(placement),arrowDelta=isVertical?2*delta.left-width+actualWidth:2*delta.top-height+actualHeight,arrowOffsetPosition=isVertical?"offsetWidth":"offsetHeight";!function(delta,dimension,isHorizontal){findElement(".tooltip-arrow, .arrow",tipElement[0]).css(isHorizontal?"left":"top",50*(1-delta/dimension)+"%").css(isHorizontal?"top":"left","")}(arrowDelta,tip[arrowOffsetPosition],isVertical)}}}(function(placement,position,actualWidth,actualHeight){var offset,split=placement.split("-");switch(split[0]){case"right":offset={top:position.top+position.height/2-actualHeight/2,left:position.left+position.width};break;case"bottom":offset={top:position.top+position.height,left:position.left+position.width/2-actualWidth/2};break;case"left":offset={top:position.top+position.height/2-actualHeight/2,left:position.left-actualWidth};break;default:offset={top:position.top-actualHeight,left:position.left+position.width/2-actualWidth/2}}if(!split[1])return offset;if("top"===split[0]||"bottom"===split[0])switch(split[1]){case"left":offset.left=position.left;break;case"right":offset.left=position.left+position.width-actualWidth}else if("left"===split[0]||"right"===split[0])switch(split[1]){case"top":offset.top=position.top-actualHeight+position.height;break;case"bottom":offset.top=position.top}return offset}(placement,elementPosition,tipWidth,tipHeight),placement)}},$tooltip.$onKeyUp=function(evt){27===evt.which&&$tooltip.$isShown&&($tooltip.hide(),evt.stopPropagation())},$tooltip.$onFocusKeyUp=function(evt){27===evt.which&&(element[0].blur(),evt.stopPropagation())};var _autoCloseEventsBinded=($tooltip.$onFocusElementMouseDown=function(evt){options.mouseDownPreventDefault&&evt.preventDefault(),options.mouseDownStopPropagation&&evt.stopPropagation(),$tooltip.$isShown?element[0].blur():element[0].focus()},!1);function unbindAutoCloseEvents(){_autoCloseEventsBinded&&(tipElement.off("click",stopEventPropagation),$body.off("click",$tooltip.hide),_autoCloseEventsBinded=!1)}function stopEventPropagation(event){event.stopPropagation()}function getPosition($element){var el=($element=$element||options.target||element)[0],isBody="BODY"===el.tagName,elRect=el.getBoundingClientRect(),rect={};for(var p in elRect)rect[p]=elRect[p];null===rect.width&&(rect=angular.extend({},rect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top}));var elOffset=isBody?{top:0,left:0}:dimensions.offset(el),scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.prop("scrollTop")||0},outerDims=isBody?{width:document.documentElement.clientWidth,height:$window.innerHeight}:null;return angular.extend({},rect,scroll,outerDims,elOffset)}function destroyTipElement(){clearTimeout(timeout),$tooltip.$isShown&&null!==tipElement&&(options.autoClose&&unbindAutoCloseEvents(),options.keyboard&&unbindKeyboardEvents()),tipScope&&(tipScope.$destroy(),tipScope=null),tipElement&&(tipElement.remove(),tipElement=$tooltip.$element=null)}return $tooltip}}]}).directive("bsTooltip",["$window","$location","$sce","$parse","$tooltip","$$rAF",function($window,$location,$sce,$parse,$tooltip,$$rAF){return{restrict:"EAC",scope:!0,link:function(scope,element,attr,transclusion){var tooltip,options={scope:scope};angular.forEach(["template","templateUrl","controller","controllerAs","titleTemplate","placement","container","delay","trigger","html","animation","backdropAnimation","type","customClass","id"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["html","container"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))});var dataTarget=element.attr("data-target");angular.isDefined(dataTarget)&&(falseValueRegExp.test(dataTarget)?options.target=!1:options.target=dataTarget),scope.hasOwnProperty("title")||(scope.title=""),attr.$observe("title",function(newValue){if(angular.isDefined(newValue)||!scope.hasOwnProperty("title")){var oldValue=scope.title;scope.title=$sce.trustAsHtml(newValue),angular.isDefined(oldValue)&&$$rAF(function(){tooltip&&tooltip.$applyPlacement()})}}),attr.$observe("disabled",function(newValue){newValue&&tooltip.$isShown&&tooltip.hide()}),attr.bsTooltip&&scope.$watch(attr.bsTooltip,function(newValue,oldValue){angular.isObject(newValue)?angular.extend(scope,newValue):scope.title=newValue,angular.isDefined(oldValue)&&$$rAF(function(){tooltip&&tooltip.$applyPlacement()})},!0),attr.bsShow&&scope.$watch(attr.bsShow,function(newValue,oldValue){tooltip&&angular.isDefined(newValue)&&(angular.isString(newValue)&&(newValue=!!newValue.match(/true|,?(tooltip),?/i)),!0===newValue?tooltip.show():tooltip.hide())}),attr.bsEnabled&&scope.$watch(attr.bsEnabled,function(newValue,oldValue){tooltip&&angular.isDefined(newValue)&&(angular.isString(newValue)&&(newValue=!!newValue.match(/true|1|,?(tooltip),?/i)),!1===newValue?tooltip.setEnabled(!1):tooltip.setEnabled(!0))}),attr.viewport&&scope.$watch(attr.viewport,function(newValue){tooltip&&angular.isDefined(newValue)&&tooltip.setViewport(newValue)}),tooltip=$tooltip(element,options),scope.$on("$destroy",function(){tooltip&&tooltip.destroy(),tooltip=options=null})}}}]),angular.module("mgcrea.ngStrap.timepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$timepicker",function(){var defaults=this.defaults={animation:"am-fade",defaultDate:"auto",prefixClass:"timepicker",placement:"bottom-left",templateUrl:"timepicker/timepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!0,timeType:"date",timeFormat:"shortTime",timezone:null,modelTimeFormat:null,autoclose:!1,minTime:-1/0,maxTime:1/0,length:5,hourStep:1,minuteStep:5,secondStep:5,roundDisplay:!1,iconUp:"glyphicon glyphicon-chevron-up",iconDown:"glyphicon glyphicon-chevron-down",arrowBehavior:"pager"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","$tooltip","$timeout",function($window,$document,$rootScope,$sce,$dateFormatter,$tooltip,$timeout){var isNative=/(ip[ao]d|iphone|android)/gi.test($window.navigator.userAgent),isTouch="createTouch"in $window.document&&isNative;function timepickerFactory(element,controller,config){var $timepicker=$tooltip(element,angular.extend({},defaults,config)),parentScope=config.scope,options=$timepicker.$options,scope=$timepicker.$scope,lang=options.lang,formatDate=function(date,format,timezone){return $dateFormatter.formatDate(date,format,lang,timezone)};var time,coeff,selectedIndex=0,defaultDate=options.roundDisplay?(time=new Date,coeff=6e4*options.minuteStep,new Date(Math.floor(time.getTime()/coeff)*coeff)):new Date,startDate=controller.$dateValue||defaultDate,viewDate={hour:startDate.getHours(),meridian:startDate.getHours()<12,minute:startDate.getMinutes(),second:startDate.getSeconds(),millisecond:startDate.getMilliseconds()},format=$dateFormatter.getDatetimeFormat(options.timeFormat,lang),hoursFormat=$dateFormatter.hoursFormat(format),timeSeparator=$dateFormatter.timeSeparator(format),minutesFormat=$dateFormatter.minutesFormat(format),secondsFormat=$dateFormatter.secondsFormat(format),showSeconds=$dateFormatter.showSeconds(format),showAM=$dateFormatter.showAM(format);function focusElement(){element[0].focus()}scope.$iconUp=options.iconUp,scope.$iconDown=options.iconDown,scope.$select=function(date,index){$timepicker.select(date,index)},scope.$moveIndex=function(value,index){$timepicker.$moveIndex(value,index)},scope.$switchMeridian=function(date){$timepicker.switchMeridian(date)},$timepicker.update=function(date){angular.isDate(date)&&!isNaN(date.getTime())?($timepicker.$date=date,angular.extend(viewDate,{hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds(),millisecond:date.getMilliseconds()}),$timepicker.$build()):$timepicker.$isBuilt||$timepicker.$build()},$timepicker.select=function(date,index,keep){controller.$dateValue&&!isNaN(controller.$dateValue.getTime())||(controller.$dateValue="today"===options.defaultDate?new Date:new Date(1970,0,1)),angular.isDate(date)||(date=new Date(date)),0===index?controller.$dateValue.setHours(date.getHours()):1===index?controller.$dateValue.setMinutes(date.getMinutes()):2===index&&controller.$dateValue.setSeconds(date.getSeconds()),controller.$setViewValue(angular.copy(controller.$dateValue)),controller.$render(),options.autoclose&&!keep&&$timeout(function(){$timepicker.hide(!0)})},$timepicker.switchMeridian=function(date){if(controller.$dateValue&&!isNaN(controller.$dateValue.getTime())){var hours=(date||controller.$dateValue).getHours();controller.$dateValue.setHours(hours<12?hours+12:hours-12),controller.$setViewValue(angular.copy(controller.$dateValue)),controller.$render()}},$timepicker.$build=function(){var i,hour,midIndex=scope.midIndex=parseInt(options.length/2,10),hours=[];for(i=0;i<options.length;i++)hour=new Date(1970,0,1,viewDate.hour-(midIndex-i)*options.hourStep),hours.push({date:hour,label:formatDate(hour,hoursFormat),selected:$timepicker.$date&&$timepicker.$isSelected(hour,0),disabled:$timepicker.$isDisabled(hour,0)});var minute,minutes=[];for(i=0;i<options.length;i++)minute=new Date(1970,0,1,0,viewDate.minute-(midIndex-i)*options.minuteStep),minutes.push({date:minute,label:formatDate(minute,minutesFormat),selected:$timepicker.$date&&$timepicker.$isSelected(minute,1),disabled:$timepicker.$isDisabled(minute,1)});var second,seconds=[];for(i=0;i<options.length;i++)second=new Date(1970,0,1,0,0,viewDate.second-(midIndex-i)*options.secondStep),seconds.push({date:second,label:formatDate(second,secondsFormat),selected:$timepicker.$date&&$timepicker.$isSelected(second,2),disabled:$timepicker.$isDisabled(second,2)});var rows=[];for(i=0;i<options.length;i++)showSeconds?rows.push([hours[i],minutes[i],seconds[i]]):rows.push([hours[i],minutes[i]]);scope.rows=rows,scope.showSeconds=showSeconds,scope.showAM=showAM,scope.isAM=($timepicker.$date||hours[midIndex].date).getHours()<12,scope.timeSeparator=timeSeparator,$timepicker.$isBuilt=!0},$timepicker.$isSelected=function(date,index){return!!$timepicker.$date&&(0===index?date.getHours()===$timepicker.$date.getHours():1===index?date.getMinutes()===$timepicker.$date.getMinutes():2===index?date.getSeconds()===$timepicker.$date.getSeconds():void 0)},$timepicker.$isDisabled=function(date,index){var selectedTime;return 0===index?selectedTime=date.getTime()+6e4*viewDate.minute+1e3*viewDate.second:1===index?selectedTime=date.getTime()+36e5*viewDate.hour+1e3*viewDate.second:2===index&&(selectedTime=date.getTime()+36e5*viewDate.hour+6e4*viewDate.minute),selectedTime<1*options.minTime||selectedTime>1*options.maxTime},scope.$arrowAction=function(value,index){"picker"===options.arrowBehavior?$timepicker.$setTimeByStep(value,index):$timepicker.$moveIndex(value,index)},$timepicker.$setTimeByStep=function(value,index){var newDate=new Date($timepicker.$date||startDate),hours=newDate.getHours(),minutes=newDate.getMinutes(),seconds=newDate.getSeconds();0===index?newDate.setHours(hours-parseInt(options.hourStep,10)*value):1===index?newDate.setMinutes(minutes-parseInt(options.minuteStep,10)*value):2===index&&newDate.setSeconds(seconds-parseInt(options.secondStep,10)*value),$timepicker.select(newDate,index,!0)},$timepicker.$moveIndex=function(value,index){var targetDate;0===index?(targetDate=new Date(1970,0,1,viewDate.hour+value*options.length,viewDate.minute,viewDate.second),angular.extend(viewDate,{hour:targetDate.getHours()})):1===index?(targetDate=new Date(1970,0,1,viewDate.hour,viewDate.minute+value*options.length*options.minuteStep,viewDate.second),angular.extend(viewDate,{minute:targetDate.getMinutes()})):2===index&&(targetDate=new Date(1970,0,1,viewDate.hour,viewDate.minute,viewDate.second+value*options.length*options.secondStep),angular.extend(viewDate,{second:targetDate.getSeconds()})),$timepicker.$build()},$timepicker.$onMouseDown=function(evt){if("input"!==evt.target.nodeName.toLowerCase()&&evt.preventDefault(),evt.stopPropagation(),isTouch){var targetEl=angular.element(evt.target);"button"!==targetEl[0].nodeName.toLowerCase()&&(targetEl=targetEl.parent()),targetEl.triggerHandler("click")}},$timepicker.$onKeyDown=function(evt){if(/(38|37|39|40|13)/.test(evt.keyCode)&&!evt.shiftKey&&!evt.altKey)if(evt.preventDefault(),evt.stopPropagation(),13!==evt.keyCode){var newDate=new Date($timepicker.$date),hours=newDate.getHours(),hoursLength=formatDate(newDate,hoursFormat).length,minutes=newDate.getMinutes(),minutesLength=formatDate(newDate,minutesFormat).length,seconds=newDate.getSeconds(),secondsLength=formatDate(newDate,secondsFormat).length,lateralMove=/(37|39)/.test(evt.keyCode),count=2+1*showSeconds+1*showAM;lateralMove&&(37===evt.keyCode?selectedIndex=selectedIndex<1?count-1:selectedIndex-1:39===evt.keyCode&&(selectedIndex=selectedIndex<count-1?selectedIndex+1:0));var selectRange=[0,hoursLength],incr=0;38===evt.keyCode&&(incr=-1),40===evt.keyCode&&(incr=1);var isSeconds=2===selectedIndex&&showSeconds,isMeridian=2===selectedIndex&&!showSeconds||3===selectedIndex&&showSeconds;0===selectedIndex?(newDate.setHours(hours+incr*parseInt(options.hourStep,10)),selectRange=[0,hoursLength=formatDate(newDate,hoursFormat).length]):1===selectedIndex?(newDate.setMinutes(minutes+incr*parseInt(options.minuteStep,10)),selectRange=[hoursLength+1,minutesLength=formatDate(newDate,minutesFormat).length]):isSeconds?(newDate.setSeconds(seconds+incr*parseInt(options.secondStep,10)),selectRange=[hoursLength+1+minutesLength+1,secondsLength=formatDate(newDate,secondsFormat).length]):isMeridian&&(lateralMove||$timepicker.switchMeridian(),selectRange=[hoursLength+1+minutesLength+1+(secondsLength+1)*showSeconds,2]),$timepicker.select(newDate,selectedIndex,!0),function(start,length){var end=start+length;if(element[0].createTextRange){var selRange=element[0].createTextRange();selRange.collapse(!0),selRange.moveStart("character",start),selRange.moveEnd("character",end),selRange.select()}else element[0].setSelectionRange?element[0].setSelectionRange(start,end):angular.isUndefined(element[0].selectionStart)&&(element[0].selectionStart=start,element[0].selectionEnd=end)}(selectRange[0],selectRange[1]),parentScope.$digest()}else $timepicker.hide(!0)};var _init=$timepicker.init;$timepicker.init=function(){if(isNative&&options.useNative)return element.prop("type","time"),void element.css("-webkit-appearance","textfield");isTouch&&(element.prop("type","text"),element.attr("readonly","true"),element.on("click",focusElement)),_init()};var _destroy=$timepicker.destroy;$timepicker.destroy=function(){isNative&&options.useNative&&element.off("click",focusElement),_destroy()};var _show=$timepicker.show;$timepicker.show=function(){!isTouch&&element.attr("readonly")||element.attr("disabled")||(_show(),$timeout(function(){$timepicker.$element&&$timepicker.$element.on(isTouch?"touchstart":"mousedown",$timepicker.$onMouseDown),options.keyboard&&element&&element.on("keydown",$timepicker.$onKeyDown)},0,!1))};var _hide=$timepicker.hide;return $timepicker.hide=function(blur){$timepicker.$isShown&&($timepicker.$element&&$timepicker.$element.off(isTouch?"touchstart":"mousedown",$timepicker.$onMouseDown),options.keyboard&&element&&element.off("keydown",$timepicker.$onKeyDown),_hide(blur))},$timepicker}return defaults.lang||(defaults.lang=$dateFormatter.getDefaultLocale()),timepickerFactory.defaults=defaults,timepickerFactory}]}).directive("bsTimepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$timepicker",function($window,$parse,$q,$dateFormatter,$dateParser,$timepicker){var defaults=$timepicker.defaults,isNative=/(ip[ao]d|iphone|android)/gi.test($window.navigator.userAgent);return{restrict:"EAC",require:"ngModel",link:function(scope,element,attr,controller){var options={scope:scope};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","autoclose","timeType","timeFormat","timezone","modelTimeFormat","useNative","hourStep","minuteStep","secondStep","length","arrowBehavior","iconUp","iconDown","roundDisplay","id","prefixClass","prefixEvent","defaultDate"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["html","container","autoclose","useNative","roundDisplay"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))}),isNative&&(options.useNative||defaults.useNative)&&(options.timeFormat="HH:mm");var timepicker=$timepicker(element,controller,options),lang=(options=timepicker.$options).lang,formatDate=function(date,format,timezone){return $dateFormatter.formatDate(date,format,lang,timezone)};attr.bsShow&&scope.$watch(attr.bsShow,function(newValue,oldValue){timepicker&&angular.isDefined(newValue)&&(angular.isString(newValue)&&(newValue=!!newValue.match(/true|,?(timepicker),?/i)),!0===newValue?timepicker.show():timepicker.hide())});var dateParser=$dateParser({format:options.timeFormat,lang:lang});function validateAgainstMinMaxTime(parsedTime){if(angular.isDate(parsedTime)){var isMinValid=isNaN(options.minTime)||new Date(parsedTime.getTime()).setFullYear(1970,0,1)>=options.minTime,isMaxValid=isNaN(options.maxTime)||new Date(parsedTime.getTime()).setFullYear(1970,0,1)<=options.maxTime,isValid=isMinValid&&isMaxValid;controller.$setValidity("date",isValid),controller.$setValidity("min",isMinValid),controller.$setValidity("max",isMaxValid),isValid&&(controller.$dateValue=parsedTime)}}function getTimeFormattedString(){return!controller.$dateValue||isNaN(controller.$dateValue.getTime())?"":formatDate(controller.$dateValue,options.timeFormat)}angular.forEach(["minTime","maxTime"],function(key){angular.isDefined(attr[key])&&attr.$observe(key,function(newValue){timepicker.$options[key]=dateParser.getTimeForAttribute(key,newValue),isNaN(timepicker.$options[key])||timepicker.$build(),validateAgainstMinMaxTime(controller.$dateValue)})}),scope.$watch(attr.ngModel,function(newValue,oldValue){timepicker.update(controller.$dateValue)},!0),controller.$parsers.unshift(function(viewValue){var date;if(!viewValue)return controller.$setValidity("date",!0),null;var parsedTime=angular.isDate(viewValue)?viewValue:dateParser.parse(viewValue,controller.$dateValue);if(parsedTime&&!isNaN(parsedTime.getTime()))return validateAgainstMinMaxTime(parsedTime),"string"===options.timeType?(date=dateParser.timezoneOffsetAdjust(parsedTime,options.timezone,!0),formatDate(date,options.modelTimeFormat||options.timeFormat)):(date=dateParser.timezoneOffsetAdjust(controller.$dateValue,options.timezone,!0),"number"===options.timeType?date.getTime():"unix"===options.timeType?date.getTime()/1e3:"iso"===options.timeType?date.toISOString():new Date(date));controller.$setValidity("date",!1)}),controller.$formatters.push(function(modelValue){var date;return date=angular.isUndefined(modelValue)||null===modelValue?NaN:angular.isDate(modelValue)?modelValue:"string"===options.timeType?dateParser.parse(modelValue,null,options.modelTimeFormat):"unix"===options.timeType?new Date(1e3*modelValue):new Date(modelValue),controller.$dateValue=dateParser.timezoneOffsetAdjust(date,options.timezone),getTimeFormattedString()}),controller.$render=function(){element.val(getTimeFormattedString())},scope.$on("$destroy",function(){timepicker&&timepicker.destroy(),timepicker=options=null})}}}]),angular.module("mgcrea.ngStrap.tab",[]).provider("$tab",function(){var defaults=this.defaults={animation:"am-fade",template:"tab/tab.tpl.html",navClass:"nav-tabs",activeClass:"active"},controller=this.controller=function($scope,$element,$attrs){var self=this;self.$options=angular.copy(defaults),angular.forEach(["animation","navClass","activeClass"],function(key){angular.isDefined($attrs[key])&&(self.$options[key]=$attrs[key])}),$scope.$navClass=self.$options.navClass,$scope.$activeClass=self.$options.activeClass,self.$panes=$scope.$panes=[],self.$activePaneChangeListeners=self.$viewChangeListeners=[],self.$push=function(pane){angular.isUndefined(self.$panes.$active)&&$scope.$setActive(pane.name||0),self.$panes.push(pane)},self.$remove=function(pane){var activeIndex,index=self.$panes.indexOf(pane),active=self.$panes.$active;activeIndex=angular.isString(active)?self.$panes.map(function(pane){return pane.name}).indexOf(active):self.$panes.$active,self.$panes.splice(index,1),index<activeIndex?activeIndex--:index===activeIndex&&activeIndex===self.$panes.length&&activeIndex--,0<=activeIndex&&activeIndex<self.$panes.length?self.$setActive(self.$panes[activeIndex].name||activeIndex):self.$setActive()},self.$setActive=$scope.$setActive=function(value){self.$panes.$active=value,self.$activePaneChangeListeners.forEach(function(fn){fn()})},self.$isActive=$scope.$isActive=function($pane,$index){return self.$panes.$active===$pane.name||self.$panes.$active===$index}};this.$get=function(){var $tab={};return $tab.defaults=defaults,$tab.controller=controller,$tab}}).directive("bsTabs",["$window","$animate","$tab","$parse",function($window,$animate,$tab,$parse){var defaults=$tab.defaults;return{require:["?ngModel","bsTabs"],transclude:!0,scope:!0,controller:["$scope","$element","$attrs",$tab.controller],templateUrl:function(element,attr){return attr.template||defaults.template},link:function(scope,element,attrs,controllers){var ngModelCtrl=controllers[0],bsTabsCtrl=controllers[1];if(ngModelCtrl&&(bsTabsCtrl.$activePaneChangeListeners.push(function(){ngModelCtrl.$setViewValue(bsTabsCtrl.$panes.$active)}),ngModelCtrl.$formatters.push(function(modelValue){return bsTabsCtrl.$setActive(modelValue),modelValue})),attrs.bsActivePane){var parsedBsActivePane=$parse(attrs.bsActivePane);bsTabsCtrl.$activePaneChangeListeners.push(function(){parsedBsActivePane.assign(scope,bsTabsCtrl.$panes.$active)}),scope.$watch(attrs.bsActivePane,function(newValue,oldValue){bsTabsCtrl.$setActive(newValue)},!0)}}}}]).directive("bsPane",["$window","$animate","$sce",function($window,$animate,$sce){return{require:["^?ngModel","^bsTabs"],scope:!0,link:function(scope,element,attrs,controllers){var bsTabsCtrl=controllers[1];function render(){var index=bsTabsCtrl.$panes.indexOf(scope);$animate[bsTabsCtrl.$isActive(scope,index)?"addClass":"removeClass"](element,bsTabsCtrl.$options.activeClass)}element.addClass("tab-pane"),attrs.$observe("title",function(newValue,oldValue){scope.title=$sce.trustAsHtml(newValue)}),scope.name=attrs.name,bsTabsCtrl.$options.animation&&element.addClass(bsTabsCtrl.$options.animation),attrs.$observe("disabled",function(newValue,oldValue){scope.disabled=scope.$eval(newValue)}),bsTabsCtrl.$push(scope),scope.$on("$destroy",function(){bsTabsCtrl.$remove(scope)}),bsTabsCtrl.$activePaneChangeListeners.push(function(){render()}),render()}}}]),angular.module("mgcrea.ngStrap.select",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$select",function(){var defaults=this.defaults={animation:"am-fade",prefixClass:"select",prefixEvent:"$select",placement:"bottom-left",templateUrl:"select/select.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,multiple:!1,allNoneButtons:!1,sort:!0,caretHtml:'&nbsp;<span class="caret"></span>',placeholder:"Choose among the following...",allText:"All",noneText:"None",maxLength:3,maxLengthHtml:"selected",iconCheckmark:"glyphicon glyphicon-ok",toggle:!1};this.$get=["$window","$document","$rootScope","$tooltip","$timeout",function($window,$document,$rootScope,$tooltip,$timeout){var isNative=/(ip[ao]d|iphone|android)/gi.test($window.navigator.userAgent),isTouch="createTouch"in $window.document&&isNative;function SelectFactory(element,controller,config){var $select={},options=angular.extend({},defaults,config),scope=($select=$tooltip(element,options)).$scope;scope.$matches=[],options.multiple?scope.$activeIndex=[]:scope.$activeIndex=-1,scope.$isMultiple=options.multiple,scope.$showAllNoneButtons=options.allNoneButtons&&options.multiple,scope.$iconCheckmark=options.iconCheckmark,scope.$allText=options.allText,scope.$noneText=options.noneText,scope.$activate=function(index){scope.$$postDigest(function(){$select.activate(index)})},scope.$select=function(index,evt){scope.$$postDigest(function(){$select.select(index)})},scope.$isVisible=function(){return $select.$isVisible()},scope.$isActive=function(index){return $select.$isActive(index)},scope.$selectAll=function(){for(var i=0;i<scope.$matches.length;i++)scope.$isActive(i)||scope.$select(i)},scope.$selectNone=function(){for(var i=0;i<scope.$matches.length;i++)scope.$isActive(i)&&scope.$select(i)},$select.update=function(matches){scope.$matches=matches,$select.$updateActiveIndex()},$select.activate=function(index){return options.multiple?($select.$isActive(index)?scope.$activeIndex.splice(scope.$activeIndex.indexOf(index),1):scope.$activeIndex.push(index),options.sort&&scope.$activeIndex.sort(function(a,b){return a-b})):scope.$activeIndex=index,scope.$activeIndex},$select.select=function(index){if(!(angular.isUndefined(index)||index<0||index>=scope.$matches.length)){var value=scope.$matches[index].value;scope.$apply(function(){$select.activate(index),options.multiple?controller.$setViewValue(scope.$activeIndex.map(function(index){return angular.isUndefined(scope.$matches[index])?null:scope.$matches[index].value})):(options.toggle?controller.$setViewValue(value===controller.$modelValue?void 0:value):controller.$setViewValue(value),$select.hide())}),scope.$emit(options.prefixEvent+".select",value,index,$select),angular.isDefined(options.onSelect)&&angular.isFunction(options.onSelect)&&options.onSelect(value,index,$select)}},$select.$updateActiveIndex=function(){options.multiple?angular.isArray(controller.$modelValue)?scope.$activeIndex=controller.$modelValue.map(function(value){return $select.$getIndex(value)}):scope.$activeIndex=[]:angular.isDefined(controller.$modelValue)&&scope.$matches.length?scope.$activeIndex=$select.$getIndex(controller.$modelValue):scope.$activeIndex=-1},$select.$isVisible=function(){return options.minLength&&controller?scope.$matches.length&&controller.$viewValue.length>=options.minLength:scope.$matches.length},$select.$isActive=function(index){return options.multiple?-1!==scope.$activeIndex.indexOf(index):scope.$activeIndex===index},$select.$getIndex=function(value){var index;for(index=scope.$matches.length;index--&&!angular.equals(scope.$matches[index].value,value););return index},$select.$onMouseDown=function(evt){if(evt.preventDefault(),evt.stopPropagation(),isTouch){var anchor,targetEl=angular.element(evt.target);if("A"!==evt.target.nodeName)for(var anchorCandidate=targetEl.parent();!anchor&&0<anchorCandidate.length;)"A"===anchorCandidate[0].nodeName&&(anchor=anchorCandidate),anchorCandidate=anchorCandidate.parent();anchor?angular.element(anchor).triggerHandler("click"):targetEl.triggerHandler("click")}},$select.$onKeyDown=function(evt){if(/(9|13|38|40)/.test(evt.keyCode))return 9!==evt.keyCode&&(evt.preventDefault(),evt.stopPropagation()),options.multiple&&9===evt.keyCode?$select.hide():options.multiple||13!==evt.keyCode&&9!==evt.keyCode?void(options.multiple||(38===evt.keyCode&&0<scope.$activeIndex?scope.$activeIndex--:38===evt.keyCode&&scope.$activeIndex<0?scope.$activeIndex=scope.$matches.length-1:40===evt.keyCode&&scope.$activeIndex<scope.$matches.length-1?scope.$activeIndex++:angular.isUndefined(scope.$activeIndex)&&(scope.$activeIndex=0),scope.$digest())):$select.select(scope.$activeIndex)},$select.$isIE=function(){var ua=$window.navigator.userAgent;return 0<ua.indexOf("MSIE ")||0<ua.indexOf("Trident/")||0<ua.indexOf("Edge/")},$select.$selectScrollFix=function(e){"UL"===$document[0].activeElement.tagName&&(e.preventDefault(),e.stopImmediatePropagation(),e.target.focus())};var _show=$select.show;$select.show=function(){_show(),options.multiple&&$select.$element.addClass("select-multiple"),$timeout(function(){$select.$element.on(isTouch?"touchstart":"mousedown",$select.$onMouseDown),options.keyboard&&element.on("keydown",$select.$onKeyDown)},0,!1)};var _hide=$select.hide;return $select.hide=function(){!options.multiple&&angular.isUndefined(controller.$modelValue)&&(scope.$activeIndex=-1),$select.$element.off(isTouch?"touchstart":"mousedown",$select.$onMouseDown),options.keyboard&&element.off("keydown",$select.$onKeyDown),_hide(!0)},$select}return SelectFactory.defaults=defaults,SelectFactory}]}).directive("bsSelect",["$window","$parse","$q","$select","$parseOptions",function($window,$parse,$q,$select,$parseOptions){var defaults=$select.defaults;return{restrict:"EAC",require:"ngModel",link:function(scope,element,attr,controller){var options={scope:scope,placeholder:defaults.placeholder};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","placeholder","allNoneButtons","maxLength","maxLengthHtml","allText","noneText","iconCheckmark","autoClose","id","sort","caretHtml","prefixClass","prefixEvent","toggle"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["html","container","allNoneButtons","sort"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide","onSelect"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))});var dataMultiple=element.attr("data-multiple");if(angular.isDefined(dataMultiple)&&(falseValueRegExp.test(dataMultiple)?options.multiple=!1:options.multiple=dataMultiple),"select"===element[0].nodeName.toLowerCase()){var inputEl=element;inputEl.css("display","none"),element=angular.element('<button type="button" class="btn btn-default"></button>'),inputEl.after(element)}var parsedOptions=$parseOptions(attr.bsOptions),select=$select(element,controller,options);select.$isIE()&&element[0].addEventListener("blur",select.$selectScrollFix);var watchedOptions=parsedOptions.$match[7].replace(/\|.+/,"").trim();scope.$watch(watchedOptions,function(newValue,oldValue){parsedOptions.valuesFn(scope,controller).then(function(values){select.update(values),controller.$render()})},!0),scope.$watch(attr.ngModel,function(newValue,oldValue){select.$updateActiveIndex(),controller.$render()},!0),controller.$render=function(){var selected,index;selected=options.multiple&&angular.isArray(controller.$modelValue)?(selected=controller.$modelValue.map(function(value){return-1!==(index=select.$getIndex(value))&&select.$scope.$matches[index].label}).filter(angular.isDefined)).length>(options.maxLength||defaults.maxLength)?selected.length+" "+(options.maxLengthHtml||defaults.maxLengthHtml):selected.join(", "):-1!==(index=select.$getIndex(controller.$modelValue))&&select.$scope.$matches[index].label,element.html((selected||options.placeholder)+(options.caretHtml||defaults.caretHtml))},options.multiple&&(controller.$isEmpty=function(value){return!value||0===value.length}),scope.$on("$destroy",function(){select&&select.destroy(),select=options=null})}}}]),angular.module("mgcrea.ngStrap.scrollspy",["mgcrea.ngStrap.helpers.debounce","mgcrea.ngStrap.helpers.dimensions"]).provider("$scrollspy",function(){var spies=this.$$spies={},defaults=this.defaults={debounce:150,throttle:100,offset:100};this.$get=["$window","$document","$rootScope","dimensions","debounce","throttle",function($window,$document,$rootScope,dimensions,debounce,throttle){var windowEl=angular.element($window),docEl=angular.element($document.prop("documentElement")),bodyEl=angular.element($window.document.body);function nodeName(element,name){return element[0].nodeName&&element[0].nodeName.toLowerCase()===name.toLowerCase()}return function(config){var options=angular.extend({},defaults,config);options.element||(options.element=bodyEl);var isWindowSpy=nodeName(options.element,"body"),scrollEl=isWindowSpy?windowEl:options.element,scrollId=isWindowSpy?"window":options.id;if(spies[scrollId])return spies[scrollId].$$count++,spies[scrollId];var unbindViewContentLoaded,unbindIncludeContentLoaded,activeTarget,debouncedCheckPosition,throttledCheckPosition,debouncedCheckOffsets,scrollTop,$scrollspy={},trackedElements=$scrollspy.$trackedElements=[],sortedElements=[];return $scrollspy.init=function(){this.$$count=1,debouncedCheckPosition=debounce(this.checkPosition,options.debounce),throttledCheckPosition=throttle(this.checkPosition,options.throttle),scrollEl.on("click",this.checkPositionWithEventLoop),windowEl.on("resize",debouncedCheckPosition),scrollEl.on("scroll",throttledCheckPosition),debouncedCheckOffsets=debounce(this.checkOffsets,options.debounce),unbindViewContentLoaded=$rootScope.$on("$viewContentLoaded",debouncedCheckOffsets),unbindIncludeContentLoaded=$rootScope.$on("$includeContentLoaded",debouncedCheckOffsets),debouncedCheckOffsets(),scrollId&&(spies[scrollId]=$scrollspy)},$scrollspy.destroy=function(){this.$$count--,0<this.$$count||(scrollEl.off("click",this.checkPositionWithEventLoop),windowEl.off("resize",debouncedCheckPosition),scrollEl.off("scroll",throttledCheckPosition),unbindViewContentLoaded(),unbindIncludeContentLoaded(),scrollId&&delete spies[scrollId])},$scrollspy.checkPosition=function(){if(sortedElements.length){if(scrollTop=(isWindowSpy?$window.pageYOffset:scrollEl.prop("scrollTop"))||0,Math.max($window.innerHeight,docEl.prop("clientHeight")),scrollTop<sortedElements[0].offsetTop&&activeTarget!==sortedElements[0].target)return $scrollspy.$activateElement(sortedElements[0]);for(var i=sortedElements.length;i--;)if(!angular.isUndefined(sortedElements[i].offsetTop)&&null!==sortedElements[i].offsetTop&&activeTarget!==sortedElements[i].target&&!(scrollTop<sortedElements[i].offsetTop||sortedElements[i+1]&&scrollTop>sortedElements[i+1].offsetTop))return $scrollspy.$activateElement(sortedElements[i])}},$scrollspy.checkPositionWithEventLoop=function(){setTimeout($scrollspy.checkPosition,1)},$scrollspy.$activateElement=function(element){if(activeTarget){var activeElement=$scrollspy.$getTrackedElement(activeTarget);activeElement&&(activeElement.source.removeClass("active"),nodeName(activeElement.source,"li")&&nodeName(activeElement.source.parent().parent(),"li")&&activeElement.source.parent().parent().removeClass("active"))}activeTarget=element.target,element.source.addClass("active"),nodeName(element.source,"li")&&nodeName(element.source.parent().parent(),"li")&&element.source.parent().parent().addClass("active")},$scrollspy.$getTrackedElement=function(target){return trackedElements.filter(function(obj){return obj.target===target})[0]},$scrollspy.checkOffsets=function(){angular.forEach(trackedElements,function(trackedElement){var targetElement=document.querySelector(trackedElement.target);trackedElement.offsetTop=targetElement?dimensions.offset(targetElement).top:null,options.offset&&null!==trackedElement.offsetTop&&(trackedElement.offsetTop-=1*options.offset)}),sortedElements=trackedElements.filter(function(el){return null!==el.offsetTop}).sort(function(a,b){return a.offsetTop-b.offsetTop}),debouncedCheckPosition()},$scrollspy.trackElement=function(target,source){trackedElements.push({target:target,source:source})},$scrollspy.untrackElement=function(target,source){for(var toDelete,i=trackedElements.length;i--;)if(trackedElements[i].target===target&&trackedElements[i].source===source){toDelete=i;break}trackedElements.splice(toDelete,1)},$scrollspy.activate=function(i){trackedElements[i].addClass("active")},$scrollspy.init(),$scrollspy}}]}).directive("bsScrollspy",["$rootScope","debounce","dimensions","$scrollspy",function($rootScope,debounce,dimensions,$scrollspy){return{restrict:"EAC",link:function(scope,element,attr){var options={scope:scope};angular.forEach(["offset","target"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var scrollspy=$scrollspy(options);scrollspy.trackElement(options.target,element),scope.$on("$destroy",function(){scrollspy&&(scrollspy.untrackElement(options.target,element),scrollspy.destroy()),scrollspy=options=null})}}}]).directive("bsScrollspyList",["$rootScope","debounce","dimensions","$scrollspy",function($rootScope,debounce,dimensions,$scrollspy){return{restrict:"A",compile:function(element,attr){var children=element[0].querySelectorAll("li > a[href]");angular.forEach(children,function(child){var childEl=angular.element(child);childEl.parent().attr("bs-scrollspy","").attr("data-target",childEl.attr("href"))})}}}]),angular.module("mgcrea.ngStrap.popover",["mgcrea.ngStrap.tooltip"]).provider("$popover",function(){var defaults=this.defaults={animation:"am-fade",customClass:"",container:!1,target:!1,placement:"right",templateUrl:"popover/popover.tpl.html",contentTemplate:!1,trigger:"click",keyboard:!0,html:!1,title:"",content:"",delay:0,autoClose:!1};this.$get=["$tooltip",function($tooltip){return function(element,config){var options=angular.extend({},defaults,config),$popover=$tooltip(element,options);return options.content&&($popover.$scope.content=options.content),$popover}}]}).directive("bsPopover",["$window","$sce","$popover",function($window,$sce,$popover){var requestAnimationFrame=$window.requestAnimationFrame||$window.setTimeout;return{restrict:"EAC",scope:!0,link:function(scope,element,attr){var popover,options={scope:scope};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","container","delay","trigger","html","animation","customClass","autoClose","id","prefixClass","prefixEvent","bsEnabled"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["html","container","autoClose"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))});var dataTarget=element.attr("data-target");angular.isDefined(dataTarget)&&(falseValueRegExp.test(dataTarget)?options.target=!1:options.target=dataTarget),angular.forEach(["title","content"],function(key){attr[key]&&attr.$observe(key,function(newValue,oldValue){scope[key]=$sce.trustAsHtml(newValue),angular.isDefined(oldValue)&&requestAnimationFrame(function(){popover&&popover.$applyPlacement()})})}),attr.bsPopover&&scope.$watch(attr.bsPopover,function(newValue,oldValue){angular.isObject(newValue)?angular.extend(scope,newValue):scope.content=newValue,angular.isDefined(oldValue)&&requestAnimationFrame(function(){popover&&popover.$applyPlacement()})},!0),attr.bsShow&&scope.$watch(attr.bsShow,function(newValue,oldValue){popover&&angular.isDefined(newValue)&&(angular.isString(newValue)&&(newValue=!!newValue.match(/true|,?(popover),?/i)),!0===newValue?popover.show():popover.hide())}),attr.bsEnabled&&scope.$watch(attr.bsEnabled,function(newValue){popover&&angular.isDefined(newValue)&&(angular.isString(newValue)&&(newValue=!!newValue.match(/true|1|,?(popover),?/i)),!1===newValue?popover.setEnabled(!1):popover.setEnabled(!0))}),attr.viewport&&scope.$watch(attr.viewport,function(newValue){popover&&angular.isDefined(newValue)&&popover.setViewport(newValue)}),popover=$popover(element,options),scope.$on("$destroy",function(){popover&&popover.destroy(),popover=options=null})}}}]),angular.module("mgcrea.ngStrap.navbar",[]).provider("$navbar",function(){var defaults=this.defaults={activeClass:"active",routeAttr:"data-match-route",strict:!1};this.$get=function(){return{defaults:defaults}}}).directive("bsNavbar",["$window","$location","$navbar",function($window,$location,$navbar){var defaults=$navbar.defaults;return{restrict:"A",link:function(scope,element,attr,controller){var options=angular.copy(defaults);angular.forEach(Object.keys(defaults),function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])}),scope.$watch(function(){return $location.path()},function(newValue,oldValue){var liElements=element[0].querySelectorAll("li["+options.routeAttr+"]");angular.forEach(liElements,function(li){var liElement=angular.element(li),pattern=liElement.attr(options.routeAttr).replace("/","\\/");options.strict&&(pattern="^"+pattern+"$"),new RegExp(pattern,"i").test(newValue)?liElement.addClass(options.activeClass):liElement.removeClass(options.activeClass)})})}}}]),angular.module("mgcrea.ngStrap.modal",["mgcrea.ngStrap.core","mgcrea.ngStrap.helpers.dimensions"]).provider("$modal",function(){var defaults=this.defaults={animation:"am-fade",backdropAnimation:"am-fade",customClass:"",prefixClass:"modal",prefixEvent:"modal",placement:"top",templateUrl:"modal/modal.tpl.html",template:"",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0,size:null,zIndex:null};this.$get=["$window","$rootScope","$bsCompiler","$animate","$timeout","$sce","dimensions",function($window,$rootScope,$bsCompiler,$animate,$timeout,$sce,dimensions){var forEach=angular.forEach,requestAnimationFrame=$window.requestAnimationFrame||$window.setTimeout,bodyElement=angular.element($window.document.body),backdropCount=0,dialogBaseZindex=1050,backdropBaseZindex=1040,validSizes={lg:"modal-lg",sm:"modal-sm"};function safeDigest(scope){scope.$$phase||scope.$root&&scope.$root.$$phase||scope.$digest()}function findElement(query,element){return angular.element((element||document).querySelectorAll(query))}return function(config){var compileData,modalElement,modalScope,$modal={},options=$modal.$options=angular.extend({},defaults,config),promise=$modal.$promise=$bsCompiler.compile(options),scope=$modal.$scope=options.scope&&options.scope.$new()||$rootScope.$new();options.element||options.container||(options.container="body"),options.zIndex&&(dialogBaseZindex=parseInt(options.zIndex,10),backdropBaseZindex=dialogBaseZindex-10),$modal.$id=options.id||options.element&&options.element.attr("id")||"",forEach(["title","content"],function(key){options[key]&&(scope[key]=$sce.trustAsHtml(options[key]))}),scope.$hide=function(){scope.$$postDigest(function(){$modal.hide()})},scope.$show=function(){scope.$$postDigest(function(){$modal.show()})},scope.$toggle=function(){scope.$$postDigest(function(){$modal.toggle()})},$modal.$isShown=scope.$isShown=!1;var backdropElement=angular.element('<div class="'+options.prefixClass+'-backdrop"/>');function enterAnimateCallback(){scope.$emit(options.prefixEvent+".show",$modal),angular.isDefined(options.onShow)&&angular.isFunction(options.onShow)&&options.onShow($modal)}function leaveAnimateCallback(){scope.$emit(options.prefixEvent+".hide",$modal),angular.isDefined(options.onHide)&&angular.isFunction(options.onHide)&&options.onHide($modal),findElement(".modal").length<=0&&bodyElement.removeClass(options.prefixClass+"-open"),options.animation&&bodyElement.removeClass(options.prefixClass+"-with-"+options.animation)}function unbindBackdropEvents(){options.backdrop&&(modalElement.off("click",hideOnBackdropClick),backdropElement.off("click",hideOnBackdropClick),backdropElement.off("wheel",preventEventDefault))}function unbindKeyboardEvents(){options.keyboard&&modalElement.off("keyup",$modal.$onKeyUp)}function hideOnBackdropClick(evt){evt.target===evt.currentTarget&&("static"===options.backdrop?$modal.focus():$modal.hide())}function preventEventDefault(evt){evt.preventDefault()}function destroyModalElement(){$modal.$isShown&&null!==modalElement&&(unbindBackdropEvents(),unbindKeyboardEvents()),modalScope&&(modalScope.$destroy(),modalScope=null),modalElement&&(modalElement.remove(),modalElement=$modal.$element=null)}return backdropElement.css({position:"fixed",top:"0px",left:"0px",bottom:"0px",right:"0px"}),promise.then(function(data){compileData=data,$modal.init()}),$modal.init=function(){options.show&&scope.$$postDigest(function(){$modal.show()})},$modal.destroy=function(){destroyModalElement(),backdropElement&&(backdropElement.remove(),backdropElement=null),scope.$destroy()},$modal.show=function(){var parent,after;if(!$modal.$isShown&&(after=angular.isElement(options.container)?(parent=options.container,options.container[0].lastChild?angular.element(options.container[0].lastChild):null):options.container?(parent=findElement(options.container))[0]&&parent[0].lastChild?angular.element(parent[0].lastChild):null:(parent=null,options.element),modalElement&&destroyModalElement(),modalScope=$modal.$scope.$new(),modalElement=$modal.$element=compileData.link(modalScope,function(clonedElement,scope){}),options.backdrop&&(modalElement.css({"z-index":dialogBaseZindex+20*backdropCount}),backdropElement.css({"z-index":backdropBaseZindex+20*backdropCount}),backdropCount++),!scope.$emit(options.prefixEvent+".show.before",$modal).defaultPrevented)){angular.isDefined(options.onBeforeShow)&&angular.isFunction(options.onBeforeShow)&&options.onBeforeShow($modal),modalElement.css({display:"block"}).addClass(options.placement),options.customClass&&modalElement.addClass(options.customClass),options.size&&validSizes[options.size]&&angular.element(findElement(".modal-dialog",modalElement[0])).addClass(validSizes[options.size]),options.animation&&(options.backdrop&&backdropElement.addClass(options.backdropAnimation),modalElement.addClass(options.animation)),options.backdrop&&$animate.enter(backdropElement,bodyElement,null),angular.version.minor<=2?$animate.enter(modalElement,parent,after,enterAnimateCallback):$animate.enter(modalElement,parent,after).then(enterAnimateCallback),$modal.$isShown=scope.$isShown=!0,safeDigest(scope);var el=modalElement[0];requestAnimationFrame(function(){el.focus()}),bodyElement.addClass(options.prefixClass+"-open"),options.animation&&bodyElement.addClass(options.prefixClass+"-with-"+options.animation),options.backdrop&&(modalElement.on("click",hideOnBackdropClick),backdropElement.on("click",hideOnBackdropClick),backdropElement.on("wheel",preventEventDefault)),options.keyboard&&modalElement.on("keyup",$modal.$onKeyUp)}},$modal.hide=function(){$modal.$isShown&&(scope.$emit(options.prefixEvent+".hide.before",$modal).defaultPrevented||(angular.isDefined(options.onBeforeHide)&&angular.isFunction(options.onBeforeHide)&&options.onBeforeHide($modal),angular.version.minor<=2?$animate.leave(modalElement,leaveAnimateCallback):$animate.leave(modalElement).then(leaveAnimateCallback),options.backdrop&&(backdropCount--,$animate.leave(backdropElement)),$modal.$isShown=scope.$isShown=!1,safeDigest(scope),unbindBackdropEvents(),unbindKeyboardEvents()))},$modal.toggle=function(){$modal.$isShown?$modal.hide():$modal.show()},$modal.focus=function(){modalElement[0].focus()},$modal.$onKeyUp=function(evt){27===evt.which&&$modal.$isShown&&($modal.hide(),evt.stopPropagation())},$modal}}]}).directive("bsModal",["$window","$sce","$parse","$modal",function($window,$sce,$parse,$modal){return{restrict:"EAC",scope:!0,link:function(scope,element,attr,transclusion){var options={scope:scope,element:element,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","backdrop","keyboard","html","container","animation","backdropAnimation","id","prefixEvent","prefixClass","customClass","modalClass","size","zIndex"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])}),options.modalClass&&(options.customClass=options.modalClass);var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["backdrop","keyboard","html","container"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))}),angular.forEach(["title","content"],function(key){attr[key]&&attr.$observe(key,function(newValue,oldValue){scope[key]=$sce.trustAsHtml(newValue)})}),attr.bsModal&&scope.$watch(attr.bsModal,function(newValue,oldValue){angular.isObject(newValue)?angular.extend(scope,newValue):scope.content=newValue},!0);var modal=$modal(options);element.on(attr.trigger||"click",modal.toggle),scope.$on("$destroy",function(){modal&&modal.destroy(),modal=options=null})}}}]),angular.version.minor<3&&angular.version.dot<14&&angular.module("ng").factory("$$rAF",["$window","$timeout",function($window,$timeout){var requestAnimationFrame=$window.requestAnimationFrame||$window.webkitRequestAnimationFrame||$window.mozRequestAnimationFrame,cancelAnimationFrame=$window.cancelAnimationFrame||$window.webkitCancelAnimationFrame||$window.mozCancelAnimationFrame||$window.webkitCancelRequestAnimationFrame,rafSupported=!!requestAnimationFrame,raf=rafSupported?function(fn){var id=requestAnimationFrame(fn);return function(){cancelAnimationFrame(id)}}:function(fn){var timer=$timeout(fn,16.66,!1);return function(){$timeout.cancel(timer)}};return raf.supported=rafSupported,raf}]),angular.module("mgcrea.ngStrap.helpers.parseOptions",[]).provider("$parseOptions",function(){var defaults=this.defaults={regexp:/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/};this.$get=["$parse","$q",function($parse,$q){return function(attr,config){var match,displayFn,valueName,valueFn,valuesFn,$parseOptions={},options=angular.extend({},defaults,config);return $parseOptions.$values=[],$parseOptions.init=function(){$parseOptions.$match=match=attr.match(options.regexp),displayFn=$parse(match[2]||match[1]),valueName=match[4]||match[6],match[5],$parse(match[3]||""),valueFn=$parse(match[2]?match[1]:valueName),valuesFn=$parse(match[7])},$parseOptions.valuesFn=function(scope,controller){return $q.when(valuesFn(scope,controller)).then(function(values){return angular.isArray(values)||(values=[]),$parseOptions.$values=values.length?function(values,scope){return values.map(function(match,index){var label,value,locals={};return locals[valueName]=match,label=displayFn(scope,locals),value=valueFn(scope,locals),{label:label,value:value,index:index}})}(values,scope):[],$parseOptions.$values})},$parseOptions.displayValue=function(modelValue){var scope={};return scope[valueName]=modelValue,displayFn(scope)},$parseOptions.init(),$parseOptions}}]}),angular.module("mgcrea.ngStrap.helpers.dimensions",[]).factory("dimensions",function(){var fn={},nodeName=fn.nodeName=function(element,name){return element.nodeName&&element.nodeName.toLowerCase()===name.toLowerCase()};return fn.css=function(element,prop,extra){var value;return value=element.currentStyle?element.currentStyle[prop]:window.getComputedStyle?window.getComputedStyle(element)[prop]:element.style[prop],!0===extra?parseFloat(value)||0:value},fn.offset=function(element){var boxRect=element.getBoundingClientRect(),docElement=element.ownerDocument;return{width:boxRect.width||element.offsetWidth,height:boxRect.height||element.offsetHeight,top:boxRect.top+(window.pageYOffset||docElement.documentElement.scrollTop)-(docElement.documentElement.clientTop||0),left:boxRect.left+(window.pageXOffset||docElement.documentElement.scrollLeft)-(docElement.documentElement.clientLeft||0)}},fn.setOffset=function(element,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,position=fn.css(element,"position"),curElem=angular.element(element),props={};"static"===position&&(element.style.position="relative"),curOffset=fn.offset(element),curCSSTop=fn.css(element,"top"),curCSSLeft=fn.css(element,"left"),curLeft=("absolute"===position||"fixed"===position)&&-1<(curCSSTop+curCSSLeft).indexOf("auto")?(curTop=(curPosition=fn.position(element)).top,curPosition.left):(curTop=parseFloat(curCSSTop)||0,parseFloat(curCSSLeft)||0),angular.isFunction(options)&&(options=options.call(element,i,curOffset)),null!==options.top&&(props.top=options.top-curOffset.top+curTop),null!==options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(curElem,props):curElem.css({top:props.top+"px",left:props.left+"px"})},fn.position=function(element){var offsetParentEl,offset,offsetParentRect={top:0,left:0};return"fixed"===fn.css(element,"position")?offset=element.getBoundingClientRect():(offsetParentEl=function(element){var docElement=element.ownerDocument,offsetParent=element.offsetParent||docElement;if(nodeName(offsetParent,"#document"))return docElement.documentElement;for(;offsetParent&&!nodeName(offsetParent,"html")&&"static"===fn.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||docElement.documentElement}(element),offset=fn.offset(element),nodeName(offsetParentEl,"html")||(offsetParentRect=fn.offset(offsetParentEl)),offsetParentRect.top+=fn.css(offsetParentEl,"borderTopWidth",!0),offsetParentRect.left+=fn.css(offsetParentEl,"borderLeftWidth",!0)),{width:element.offsetWidth,height:element.offsetHeight,top:offset.top-offsetParentRect.top-fn.css(element,"marginTop",!0),left:offset.left-offsetParentRect.left-fn.css(element,"marginLeft",!0)}},fn.height=function(element,outer){var value=element.offsetHeight;return outer?value+=fn.css(element,"marginTop",!0)+fn.css(element,"marginBottom",!0):value-=fn.css(element,"paddingTop",!0)+fn.css(element,"paddingBottom",!0)+fn.css(element,"borderTopWidth",!0)+fn.css(element,"borderBottomWidth",!0),value},fn.width=function(element,outer){var value=element.offsetWidth;return outer?value+=fn.css(element,"marginLeft",!0)+fn.css(element,"marginRight",!0):value-=fn.css(element,"paddingLeft",!0)+fn.css(element,"paddingRight",!0)+fn.css(element,"borderLeftWidth",!0)+fn.css(element,"borderRightWidth",!0),value},fn}),angular.module("mgcrea.ngStrap.helpers.debounce",[]).factory("debounce",["$timeout",function($timeout){return function(func,wait,immediate){var timeout=null;return function(){var context=this,args=arguments,callNow=immediate&&!timeout;return timeout&&$timeout.cancel(timeout),timeout=$timeout(function(){timeout=null,immediate||func.apply(context,args)},wait,!1),callNow&&func.apply(context,args),timeout}}}]).factory("throttle",["$timeout",function($timeout){return function(func,wait,options){var timeout=null;return options||(options={}),function(){var context=this,args=arguments;timeout||(!1!==options.leading&&func.apply(context,args),timeout=$timeout(function(){timeout=null,!1!==options.trailing&&func.apply(context,args)},wait,!1))}}}]),angular.module("mgcrea.ngStrap.helpers.dateParser",[]).provider("$dateParser",["$localeProvider",function($localeProvider){function ParseDate(){this.year=1970,this.month=0,this.day=1,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0}ParseDate.prototype.setMilliseconds=function(value){this.milliseconds=value},ParseDate.prototype.setSeconds=function(value){this.seconds=value},ParseDate.prototype.setMinutes=function(value){this.minutes=value},ParseDate.prototype.setHours=function(value){this.hours=value},ParseDate.prototype.getHours=function(){return this.hours},ParseDate.prototype.setDate=function(value){this.day=value},ParseDate.prototype.setMonth=function(value){this.month=value},ParseDate.prototype.setFullYear=function(value){this.year=value},ParseDate.prototype.fromDate=function(value){return this.year=value.getFullYear(),this.month=value.getMonth(),this.day=value.getDate(),this.hours=value.getHours(),this.minutes=value.getMinutes(),this.seconds=value.getSeconds(),this.milliseconds=value.getMilliseconds(),this},ParseDate.prototype.toDate=function(){return new Date(this.year,this.month,this.day,this.hours,this.minutes,this.seconds,this.milliseconds)};var proto=ParseDate.prototype;function noop(){}function isNumeric(n){return!isNaN(parseFloat(n))&&isFinite(n)}function indexOfCaseInsensitive(array,value){for(var len=array.length,str=value.toString().toLowerCase(),i=0;i<len;i++)if(array[i].toLowerCase()===str)return i;return-1}var defaults=this.defaults={format:"shortDate",strict:!1};this.$get=["$locale","dateFilter",function($locale,dateFilter){return function(config){var regex,setMap,options=angular.extend({},defaults,config),$dateParser={},regExpMap={sss:"[0-9]{3}",ss:"[0-5][0-9]",s:options.strict?"[1-5]?[0-9]":"[0-9]|[0-5][0-9]",mm:"[0-5][0-9]",m:options.strict?"[1-5]?[0-9]":"[0-9]|[0-5][0-9]",HH:"[01][0-9]|2[0-3]",H:options.strict?"1?[0-9]|2[0-3]":"[01]?[0-9]|2[0-3]",hh:"[0][1-9]|[1][012]",h:options.strict?"[1-9]|1[012]":"0?[1-9]|1[012]",a:"AM|PM",EEEE:$locale.DATETIME_FORMATS.DAY.join("|"),EEE:$locale.DATETIME_FORMATS.SHORTDAY.join("|"),dd:"0[1-9]|[12][0-9]|3[01]",d:options.strict?"[1-9]|[1-2][0-9]|3[01]":"0?[1-9]|[1-2][0-9]|3[01]",MMMM:$locale.DATETIME_FORMATS.MONTH.join("|"),MMM:$locale.DATETIME_FORMATS.SHORTMONTH.join("|"),MM:"0[1-9]|1[012]",M:options.strict?"[1-9]|1[012]":"0?[1-9]|1[012]",yyyy:"[1]{1}[0-9]{3}|[2]{1}[0-9]{3}",yy:"[0-9]{2}",y:options.strict?"-?(0|[1-9][0-9]{0,3})":"-?0*[0-9]{1,4}"},setFnMap={sss:proto.setMilliseconds,ss:proto.setSeconds,s:proto.setSeconds,mm:proto.setMinutes,m:proto.setMinutes,HH:proto.setHours,H:proto.setHours,hh:proto.setHours,h:proto.setHours,EEEE:noop,EEE:noop,dd:proto.setDate,d:proto.setDate,a:function(value){var hours=this.getHours()%12;return this.setHours(value.match(/pm/i)?hours+12:hours)},MMMM:function(value){return this.setMonth(indexOfCaseInsensitive($locale.DATETIME_FORMATS.MONTH,value))},MMM:function(value){return this.setMonth(indexOfCaseInsensitive($locale.DATETIME_FORMATS.SHORTMONTH,value))},MM:function(value){return this.setMonth(1*value-1)},M:function(value){return this.setMonth(1*value-1)},yyyy:proto.setFullYear,yy:function(value){return this.setFullYear(2e3+1*value)},y:function(value){return 1*value<=50&&2===value.length?this.setFullYear(2e3+1*value):this.setFullYear(1*value)}};function regExpForFormat(format){return function(abstractRegex){for(var dateElements=Object.keys(regExpMap),re=abstractRegex,i=0;i<dateElements.length;i++)re=re.split("${"+i+"}").join("("+regExpMap[dateElements[i]]+")");return new RegExp("^"+re+"$",["i"])}(buildDateAbstractRegex(format))}function buildDateAbstractRegex(format){var formatParts=format.replace(/\\/g,"[\\\\]").replace(/-/g,"[-]").replace(/\./g,"[.]").replace(/\*/g,"[*]").replace(/\+/g,"[+]").replace(/\?/g,"[?]").replace(/\$/g,"[$]").replace(/\^/g,"[^]").replace(/\//g,"[/]").replace(/\\s/g,"[\\s]").replace(/''/g,"\\'").split(/('(?:\\'|.)*?')/),dateElements=Object.keys(regExpMap),dateRegexParts=[];return angular.forEach(formatParts,function(part){if(/^'.*'$/.test(part))part=function(text){return text.replace(/^'(.*)'$/,"$1")}(part);else for(var i=0;i<dateElements.length;i++)part=part.split(dateElements[i]).join("${"+i+"}");dateRegexParts.push(part)}),dateRegexParts.join("")}function setMapForFormat(format){return function(abstractRegex){for(var valuesMatch,keyIndex,valueKey,valueFunction,dateElements=Object.keys(regExpMap),valuesRegex=new RegExp("\\${(\\d+)}","g"),valuesFunctionMap=[];null!==(valuesMatch=valuesRegex.exec(abstractRegex));)keyIndex=valuesMatch[1],valueKey=dateElements[keyIndex],valueFunction=setFnMap[valueKey],valuesFunctionMap.push(valueFunction);return valuesFunctionMap}(buildDateAbstractRegex(format))}return $dateParser.init=function(){$dateParser.$format=$locale.DATETIME_FORMATS[options.format]||options.format,regex=regExpForFormat($dateParser.$format),setMap=setMapForFormat($dateParser.$format)},$dateParser.isValid=function(date){return angular.isDate(date)?!isNaN(date.getTime()):regex.test(date)},$dateParser.parse=function(value,baseDate,format,timezone){format&&(format=$locale.DATETIME_FORMATS[format]||format),angular.isDate(value)&&(value=dateFilter(value,format||$dateParser.$format,timezone));var formatRegex=format?regExpForFormat(format):regex,formatSetMap=format?setMapForFormat(format):setMap,matches=formatRegex.exec(value);if(!matches)return!1;for(var date=baseDate&&!isNaN(baseDate.getTime())?(new ParseDate).fromDate(baseDate):(new ParseDate).fromDate(new Date(1970,0,1,0)),i=0;i<matches.length-1;i++)formatSetMap[i]&&formatSetMap[i].call(date,matches[i+1]);var newDate=date.toDate();return parseInt(date.day,10)===newDate.getDate()&&newDate},$dateParser.getDateForAttribute=function(key,value){var date;if("today"===value){var today=new Date;date=new Date(today.getFullYear(),today.getMonth(),today.getDate()+("maxDate"===key?1:0),0,0,0,"minDate"===key?0:-1)}else date=angular.isString(value)&&value.match(/^".+"$/)?new Date(value.substr(1,value.length-2)):isNumeric(value)?new Date(parseInt(value,10)):angular.isString(value)&&0===value.length?"minDate"===key?-1/0:1/0:new Date(value);return date},$dateParser.getTimeForAttribute=function(key,value){return"now"===value?(new Date).setFullYear(1970,0,1):angular.isString(value)&&value.match(/^".+"$/)?new Date(value.substr(1,value.length-2)).setFullYear(1970,0,1):isNumeric(value)?new Date(parseInt(value,10)).setFullYear(1970,0,1):angular.isString(value)&&0===value.length?"minTime"===key?-1/0:1/0:$dateParser.parse(value,new Date(1970,0,1,0))},$dateParser.daylightSavingAdjust=function(date){return date?(date.setHours(12<date.getHours()?date.getHours()+2:0),date):null},$dateParser.timezoneOffsetAdjust=function(date,timezone,undo){return date?(timezone&&"UTC"===timezone&&(date=new Date(date.getTime())).setMinutes(date.getMinutes()+(undo?-1:1)*date.getTimezoneOffset()),date):null},$dateParser.init(),$dateParser}}]}]),angular.module("mgcrea.ngStrap.helpers.dateFormatter",[]).service("$dateFormatter",["$locale","dateFilter",function($locale,dateFilter){function splitTimeFormat(format){return/(h+)([:\.])?(m+)([:\.])?(s*)[ ]?(a?)/i.exec(format).slice(1)}this.getDefaultLocale=function(){return $locale.id},this.getDatetimeFormat=function(format,lang){return $locale.DATETIME_FORMATS[format]||format},this.weekdaysShort=function(lang){return $locale.DATETIME_FORMATS.SHORTDAY},this.hoursFormat=function(timeFormat){return splitTimeFormat(timeFormat)[0]},this.minutesFormat=function(timeFormat){return splitTimeFormat(timeFormat)[2]},this.secondsFormat=function(timeFormat){return splitTimeFormat(timeFormat)[4]},this.timeSeparator=function(timeFormat){return splitTimeFormat(timeFormat)[1]},this.showSeconds=function(timeFormat){return!!splitTimeFormat(timeFormat)[4]},this.showAM=function(timeFormat){return!!splitTimeFormat(timeFormat)[5]},this.formatDate=function(date,format,lang,timezone){return dateFilter(date,format,timezone)}}]),angular.module("mgcrea.ngStrap.core",[]).service("$bsCompiler",bsCompilerService),angular.module("mgcrea.ngStrap.dropdown",["mgcrea.ngStrap.tooltip"]).provider("$dropdown",function(){var defaults=this.defaults={animation:"am-fade",prefixClass:"dropdown",prefixEvent:"dropdown",placement:"bottom-left",templateUrl:"dropdown/dropdown.tpl.html",trigger:"click",container:!1,keyboard:!0,html:!1,delay:0};this.$get=["$window","$rootScope","$tooltip","$timeout",function($window,$rootScope,$tooltip,$timeout){var bodyEl=angular.element($window.document.body),matchesSelector=Element.prototype.matchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector;return function(element,config){var $dropdown={},options=angular.extend({},defaults,config);$dropdown.$scope=options.scope&&options.scope.$new()||$rootScope.$new(),$dropdown=$tooltip(element,options);var parentEl=element.parent();$dropdown.$onKeyDown=function(evt){if(/(38|40)/.test(evt.keyCode)){evt.preventDefault(),evt.stopPropagation();var index,items=angular.element($dropdown.$element[0].querySelectorAll("li:not(.divider) a"));items.length&&(angular.forEach(items,function(el,i){matchesSelector&&matchesSelector.call(el,":focus")&&(index=i)}),38===evt.keyCode&&0<index?index--:40===evt.keyCode&&index<items.length-1?index++:angular.isUndefined(index)&&(index=0),items.eq(index)[0].focus())}};var show=$dropdown.show;$dropdown.show=function(){show(),$timeout(function(){options.keyboard&&$dropdown.$element&&$dropdown.$element.on("keydown",$dropdown.$onKeyDown),bodyEl.on("click",onBodyClick)},0,!1),parentEl.hasClass("dropdown")&&parentEl.addClass("open")};var hide=$dropdown.hide;$dropdown.hide=function(){$dropdown.$isShown&&(options.keyboard&&$dropdown.$element&&$dropdown.$element.off("keydown",$dropdown.$onKeyDown),bodyEl.off("click",onBodyClick),parentEl.hasClass("dropdown")&&parentEl.removeClass("open"),hide())};var destroy=$dropdown.destroy;function onBodyClick(evt){if(evt.target!==element[0])return evt.target!==element[0]&&$dropdown.hide()}return $dropdown.destroy=function(){bodyEl.off("click",onBodyClick),destroy()},$dropdown}}]}).directive("bsDropdown",["$window","$sce","$dropdown",function($window,$sce,$dropdown){return{restrict:"EAC",scope:!0,compile:function(tElement,tAttrs){if(!tAttrs.bsDropdown){for(var nextSibling=tElement[0].nextSibling;nextSibling&&1!==nextSibling.nodeType;)nextSibling=nextSibling.nextSibling;nextSibling&&0<=nextSibling.className.split(" ").indexOf("dropdown-menu")&&(tAttrs.template=nextSibling.outerHTML,tAttrs.templateUrl=void 0,nextSibling.parentNode.removeChild(nextSibling))}return function(scope,element,attr){var options={scope:scope};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","id","autoClose"],function(key){angular.isDefined(tAttrs[key])&&(options[key]=tAttrs[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["html","container"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))}),attr.bsDropdown&&scope.$watch(attr.bsDropdown,function(newValue,oldValue){scope.content=newValue},!0);var dropdown=$dropdown(element,options);attr.bsShow&&scope.$watch(attr.bsShow,function(newValue,oldValue){dropdown&&angular.isDefined(newValue)&&(angular.isString(newValue)&&(newValue=!!newValue.match(/true|,?(dropdown),?/i)),!0===newValue?dropdown.show():dropdown.hide())}),scope.$on("$destroy",function(){dropdown&&dropdown.destroy(),dropdown=options=null})}}}}]),angular.module("mgcrea.ngStrap.button",[]).provider("$button",function(){var defaults=this.defaults={activeClass:"active",toggleEvent:"click"};this.$get=function(){return{defaults:defaults}}}).directive("bsCheckboxGroup",function(){return{restrict:"A",require:"ngModel",compile:function(element,attr){element.attr("data-toggle","buttons"),element.removeAttr("ng-model");var children=element[0].querySelectorAll('input[type="checkbox"]');angular.forEach(children,function(child){var childEl=angular.element(child);childEl.attr("bs-checkbox",""),childEl.attr("ng-model",attr.ngModel+"."+childEl.attr("value"))})}}}).directive("bsCheckbox",["$button","$$rAF",function($button,$$rAF){var defaults=$button.defaults,constantValueRegExp=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(scope,element,attr,controller){var options=defaults,isInput="INPUT"===element[0].nodeName,activeElement=isInput?element.parent():element,trueValue=!angular.isDefined(attr.trueValue)||attr.trueValue;constantValueRegExp.test(attr.trueValue)&&(trueValue=scope.$eval(attr.trueValue));var falseValue=!!angular.isDefined(attr.falseValue)&&attr.falseValue;constantValueRegExp.test(attr.falseValue)&&(falseValue=scope.$eval(attr.falseValue)),("boolean"!=typeof trueValue||"boolean"!=typeof falseValue)&&(controller.$parsers.push(function(viewValue){return viewValue?trueValue:falseValue}),controller.$formatters.push(function(modelValue){return angular.equals(modelValue,trueValue)})),controller.$render=function(){var isActive=!!controller.$viewValue;$$rAF(function(){isInput&&(element[0].checked=isActive),activeElement.toggleClass(options.activeClass,isActive)})},element.bind(options.toggleEvent,function(){scope.$apply(function(){isInput||controller.$setViewValue(!activeElement.hasClass("active")),controller.$render()})})}}}]).directive("bsRadioGroup",function(){return{restrict:"A",require:"ngModel",compile:function(element,attr){element.attr("data-toggle","buttons"),element.removeAttr("ng-model");var children=element[0].querySelectorAll('input[type="radio"]');angular.forEach(children,function(child){angular.element(child).attr("bs-radio",""),angular.element(child).attr("ng-model",attr.ngModel)})}}}).directive("bsRadio",["$button","$$rAF",function($button,$$rAF){var defaults=$button.defaults,constantValueRegExp=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(scope,element,attr,controller){var value,options=defaults,isInput="INPUT"===element[0].nodeName,activeElement=isInput?element.parent():element;attr.$observe("value",function(v){value="boolean"!=typeof v&&constantValueRegExp.test(v)?scope.$eval(v):v,controller.$render()}),controller.$render=function(){var isActive=angular.equals(controller.$viewValue,value);$$rAF(function(){isInput&&(element[0].checked=isActive),activeElement.toggleClass(options.activeClass,isActive)})},element.bind(options.toggleEvent,function(){scope.$apply(function(){controller.$setViewValue(value),controller.$render()})})}}}]),angular.module("mgcrea.ngStrap.datepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$datepicker",function(){var defaults=this.defaults={animation:"am-fade",prefixClass:"datepicker",placement:"bottom-left",templateUrl:"datepicker/datepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!1,dateType:"date",dateFormat:"shortDate",timezone:null,modelDateFormat:null,dayFormat:"dd",monthFormat:"MMM",yearFormat:"yyyy",monthTitleFormat:"MMMM yyyy",yearTitleFormat:"yyyy",strictFormat:!1,autoclose:!1,minDate:-1/0,maxDate:1/0,startView:0,minView:0,startWeek:0,daysOfWeekDisabled:"",hasToday:!1,hasClear:!1,iconLeft:"glyphicon glyphicon-chevron-left",iconRight:"glyphicon glyphicon-chevron-right"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","datepickerViews","$tooltip","$timeout",function($window,$document,$rootScope,$sce,$dateFormatter,datepickerViews,$tooltip,$timeout){var isNative=/(ip[ao]d|iphone|android)/gi.test($window.navigator.userAgent),isTouch="createTouch"in $window.document&&isNative;function DatepickerFactory(element,controller,config){var $datepicker=$tooltip(element,angular.extend({},defaults,config)),parentScope=config.scope,options=$datepicker.$options,scope=$datepicker.$scope;options.startView&&(options.startView-=options.minView);var pickerViews=datepickerViews($datepicker);$datepicker.$views=pickerViews.views;var viewDate=pickerViews.viewDate;scope.$mode=options.startView,scope.$iconLeft=options.iconLeft,scope.$iconRight=options.iconRight,scope.$hasToday=options.hasToday,scope.$hasClear=options.hasClear;var $picker=$datepicker.$views[scope.$mode];function updateSelected(el){el.selected=$datepicker.$isSelected(el.date)}function focusElement(){element[0].focus()}scope.$select=function(date,disabled){disabled||$datepicker.select(date)},scope.$selectPane=function(value){$datepicker.$selectPane(value)},scope.$toggleMode=function(){$datepicker.setMode((scope.$mode+1)%$datepicker.$views.length)},scope.$setToday=function(){options.autoclose?($datepicker.setMode(0),$datepicker.select(new Date)):$datepicker.select(new Date,!0)},scope.$clear=function(){options.autoclose?($datepicker.setMode(0),$datepicker.select(null)):$datepicker.select(null,!0)},$datepicker.update=function(date){angular.isDate(date)&&!isNaN(date.getTime())&&($datepicker.$date=date,$picker.update.call($picker,date)),$datepicker.$build(!0)},$datepicker.updateDisabledDates=function(dateRanges){options.disabledDateRanges=dateRanges;for(var i=0,l=scope.rows.length;i<l;i++)angular.forEach(scope.rows[i],$datepicker.$setDisabledEl)},$datepicker.select=function(date,keep){angular.isDate(date)?angular.isDate(controller.$dateValue)&&!isNaN(controller.$dateValue.getTime())||(controller.$dateValue=new Date(date)):controller.$dateValue=null,!scope.$mode||keep?(controller.$setViewValue(angular.copy(date)),controller.$render(),options.autoclose&&!keep&&$timeout(function(){$datepicker.hide(!0)})):(angular.extend(viewDate,{year:date.getFullYear(),month:date.getMonth(),date:date.getDate()}),$datepicker.setMode(scope.$mode-1),$datepicker.$build())},$datepicker.setMode=function(mode){scope.$mode=mode,$picker=$datepicker.$views[scope.$mode],$datepicker.$build()},$datepicker.$build=function(pristine){!0===pristine&&$picker.built||(!1!==pristine||$picker.built)&&$picker.build.call($picker)},$datepicker.$updateSelected=function(){for(var i=0,l=scope.rows.length;i<l;i++)angular.forEach(scope.rows[i],updateSelected)},$datepicker.$isSelected=function(date){return $picker.isSelected(date)},$datepicker.$setDisabledEl=function(el){el.disabled=$picker.isDisabled(el.date)},$datepicker.$selectPane=function(value){var steps=$picker.steps,targetDate=new Date(Date.UTC(viewDate.year+(steps.year||0)*value,viewDate.month+(steps.month||0)*value,1));angular.extend(viewDate,{year:targetDate.getUTCFullYear(),month:targetDate.getUTCMonth(),date:targetDate.getUTCDate()}),$datepicker.$build()},$datepicker.$onMouseDown=function(evt){if(evt.preventDefault(),evt.stopPropagation(),isTouch){var targetEl=angular.element(evt.target);"button"!==targetEl[0].nodeName.toLowerCase()&&(targetEl=targetEl.parent()),targetEl.triggerHandler("click")}},$datepicker.$onKeyDown=function(evt){!/(38|37|39|40|13)/.test(evt.keyCode)||evt.shiftKey||evt.altKey||(evt.preventDefault(),evt.stopPropagation(),13!==evt.keyCode?($picker.onKeyDown(evt),parentScope.$digest()):scope.$mode?scope.$apply(function(){$datepicker.setMode(scope.$mode-1)}):$datepicker.hide(!0))};var _init=$datepicker.init;$datepicker.init=function(){if(isNative&&options.useNative)return element.prop("type","date"),void element.css("-webkit-appearance","textfield");isTouch&&(element.prop("type","text"),element.attr("readonly","true"),element.on("click",focusElement)),_init()};var _destroy=$datepicker.destroy;$datepicker.destroy=function(){isNative&&options.useNative&&element.off("click",focusElement),_destroy()};var _show=$datepicker.show;$datepicker.show=function(){!isTouch&&element.attr("readonly")||element.attr("disabled")||(_show(),$timeout(function(){$datepicker.$isShown&&($datepicker.$element.on(isTouch?"touchstart":"mousedown",$datepicker.$onMouseDown),options.keyboard&&element.on("keydown",$datepicker.$onKeyDown))},0,!1))};var _hide=$datepicker.hide;return $datepicker.hide=function(blur){$datepicker.$isShown&&($datepicker.$element.off(isTouch?"touchstart":"mousedown",$datepicker.$onMouseDown),options.keyboard&&element.off("keydown",$datepicker.$onKeyDown),_hide(blur))},$datepicker}return defaults.lang||(defaults.lang=$dateFormatter.getDefaultLocale()),DatepickerFactory.defaults=defaults,DatepickerFactory}]}).directive("bsDatepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$datepicker",function($window,$parse,$q,$dateFormatter,$dateParser,$datepicker){var isNative=/(ip[ao]d|iphone|android)/gi.test($window.navigator.userAgent);return{restrict:"EAC",require:"ngModel",link:function(scope,element,attr,controller){var options={scope:scope};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","html","animation","autoclose","dateType","dateFormat","timezone","modelDateFormat","dayFormat","strictFormat","startWeek","startDate","useNative","lang","startView","minView","iconLeft","iconRight","daysOfWeekDisabled","id","prefixClass","prefixEvent","hasToday","hasClear"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["html","container","autoclose","useNative","hasToday","hasClear"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))});var datepicker=$datepicker(element,controller,options);options=datepicker.$options,isNative&&options.useNative&&(options.dateFormat="yyyy-MM-dd");var lang=options.lang,formatDate=function(date,format){return $dateFormatter.formatDate(date,format,lang)},dateParser=$dateParser({format:options.dateFormat,lang:lang,strict:options.strictFormat});function normalizeDateRanges(ranges){return ranges&&ranges.length?ranges:null}function validateAgainstMinMaxDate(parsedDate){if(angular.isDate(parsedDate)){var isMinValid=isNaN(datepicker.$options.minDate)||parsedDate.getTime()>=datepicker.$options.minDate,isMaxValid=isNaN(datepicker.$options.maxDate)||parsedDate.getTime()<=datepicker.$options.maxDate,isValid=isMinValid&&isMaxValid;controller.$setValidity("date",isValid),controller.$setValidity("min",isMinValid),controller.$setValidity("max",isMaxValid),isValid&&(controller.$dateValue=parsedDate)}}function getDateFormattedString(){return!controller.$dateValue||isNaN(controller.$dateValue.getTime())?"":formatDate(controller.$dateValue,options.dateFormat)}attr.bsShow&&scope.$watch(attr.bsShow,function(newValue,oldValue){datepicker&&angular.isDefined(newValue)&&(angular.isString(newValue)&&(newValue=!!newValue.match(/true|,?(datepicker),?/i)),!0===newValue?datepicker.show():datepicker.hide())}),angular.forEach(["minDate","maxDate"],function(key){angular.isDefined(attr[key])&&attr.$observe(key,function(newValue){datepicker.$options[key]=dateParser.getDateForAttribute(key,newValue),isNaN(datepicker.$options[key])||datepicker.$build(!1),validateAgainstMinMaxDate(controller.$dateValue)})}),angular.isDefined(attr.dateFormat)&&attr.$observe("dateFormat",function(newValue){datepicker.$options.dateFormat=newValue}),scope.$watch(attr.ngModel,function(newValue,oldValue){datepicker.update(controller.$dateValue)},!0),angular.isDefined(attr.disabledDates)&&scope.$watch(attr.disabledDates,function(disabledRanges,previousValue){disabledRanges=normalizeDateRanges(disabledRanges),previousValue=normalizeDateRanges(previousValue),disabledRanges&&datepicker.updateDisabledDates(disabledRanges)}),controller.$parsers.unshift(function(viewValue){var date;if(!viewValue)return controller.$setValidity("date",!0),null;var parsedDate=dateParser.parse(viewValue,controller.$dateValue);if(parsedDate&&!isNaN(parsedDate.getTime()))return validateAgainstMinMaxDate(parsedDate),"string"===options.dateType?(date=dateParser.timezoneOffsetAdjust(parsedDate,options.timezone,!0),formatDate(date,options.modelDateFormat||options.dateFormat)):(date=dateParser.timezoneOffsetAdjust(controller.$dateValue,options.timezone,!0),"number"===options.dateType?date.getTime():"unix"===options.dateType?date.getTime()/1e3:"iso"===options.dateType?date.toISOString():new Date(date));controller.$setValidity("date",!1)}),controller.$formatters.push(function(modelValue){var date;return date=angular.isUndefined(modelValue)||null===modelValue?NaN:angular.isDate(modelValue)?modelValue:"string"===options.dateType?dateParser.parse(modelValue,null,options.modelDateFormat):"unix"===options.dateType?new Date(1e3*modelValue):new Date(modelValue),controller.$dateValue=dateParser.timezoneOffsetAdjust(date,options.timezone),getDateFormattedString()}),controller.$render=function(){element.val(getDateFormattedString())},scope.$on("$destroy",function(){datepicker&&datepicker.destroy(),datepicker=options=null})}}}]).provider("datepickerViews",function(){function split(arr,size){for(var arrays=[];0<arr.length;)arrays.push(arr.splice(0,size));return arrays}this.$get=["$dateFormatter","$dateParser","$sce",function($dateFormatter,$dateParser,$sce){return function(picker){var scope=picker.$scope,options=picker.$options,lang=options.lang,formatDate=function(date,format){return $dateFormatter.formatDate(date,format,lang)},dateParser=$dateParser({format:options.dateFormat,lang:lang,strict:options.strictFormat}),weekDaysMin=$dateFormatter.weekdaysShort(lang),weekDaysLabels=weekDaysMin.slice(options.startWeek).concat(weekDaysMin.slice(0,options.startWeek)),weekDaysLabelsHtml=$sce.trustAsHtml('<th class="dow text-center">'+weekDaysLabels.join('</th><th class="dow text-center">')+"</th>"),startDate=picker.$date||(options.startDate?dateParser.getDateForAttribute("startDate",options.startDate):new Date),viewDate={year:startDate.getFullYear(),month:startDate.getMonth(),date:startDate.getDate()},views=[{format:options.dayFormat,split:7,steps:{month:1},update:function(date,force){!this.built||force||date.getFullYear()!==viewDate.year||date.getMonth()!==viewDate.month?(angular.extend(viewDate,{year:picker.$date.getFullYear(),month:picker.$date.getMonth(),date:picker.$date.getDate()}),picker.$build()):date.getDate()===viewDate.date&&1!==date.getDate()||(viewDate.date=picker.$date.getDate(),picker.$updateSelected())},build:function(){var m,firstDayOfMonth=new Date(viewDate.year,viewDate.month,1),firstDayOfMonthOffset=firstDayOfMonth.getTimezoneOffset(),firstDate=new Date(+firstDayOfMonth-864e5*(((firstDayOfMonth.getDay()-options.startWeek)%(m=7)+m)%m)),firstDateOffset=firstDate.getTimezoneOffset(),today=dateParser.timezoneOffsetAdjust(new Date,options.timezone).toDateString();firstDateOffset!==firstDayOfMonthOffset&&(firstDate=new Date(+firstDate+6e4*(firstDateOffset-firstDayOfMonthOffset)));for(var day,days=[],i=0;i<42;i++)day=dateParser.daylightSavingAdjust(new Date(firstDate.getFullYear(),firstDate.getMonth(),firstDate.getDate()+i)),days.push({date:day,isToday:day.toDateString()===today,label:formatDate(day,this.format),selected:picker.$date&&this.isSelected(day),muted:day.getMonth()!==viewDate.month,disabled:this.isDisabled(day)});scope.title=formatDate(firstDayOfMonth,options.monthTitleFormat),scope.showLabels=!0,scope.labels=weekDaysLabelsHtml,scope.rows=split(days,this.split),scope.isTodayDisabled=this.isDisabled(new Date),this.built=!0},isSelected:function(date){return picker.$date&&date.getFullYear()===picker.$date.getFullYear()&&date.getMonth()===picker.$date.getMonth()&&date.getDate()===picker.$date.getDate()},isDisabled:function(date){var time=date.getTime();if(time<options.minDate||time>options.maxDate)return!0;if(-1!==options.daysOfWeekDisabled.indexOf(date.getDay()))return!0;if(options.disabledDateRanges)for(var i=0;i<options.disabledDateRanges.length;i++)if(time>=options.disabledDateRanges[i].start&&time<=options.disabledDateRanges[i].end)return!0;return!1},onKeyDown:function(evt){if(picker.$date){var newDate,actualTime=picker.$date.getTime();37===evt.keyCode?newDate=new Date(actualTime-864e5):38===evt.keyCode?newDate=new Date(actualTime-6048e5):39===evt.keyCode?newDate=new Date(actualTime+864e5):40===evt.keyCode&&(newDate=new Date(actualTime+6048e5)),this.isDisabled(newDate)||picker.select(newDate,!0)}}},{name:"month",format:options.monthFormat,split:4,steps:{year:1},update:function(date,force){this.built&&date.getFullYear()===viewDate.year?date.getMonth()!==viewDate.month&&(angular.extend(viewDate,{month:picker.$date.getMonth(),date:picker.$date.getDate()}),picker.$updateSelected()):(angular.extend(viewDate,{year:picker.$date.getFullYear(),month:picker.$date.getMonth(),date:picker.$date.getDate()}),picker.$build())},build:function(){for(var month,months=[],i=0;i<12;i++)month=new Date(viewDate.year,i,1),months.push({date:month,label:formatDate(month,this.format),selected:picker.$isSelected(month),disabled:this.isDisabled(month)});scope.title=formatDate(month,options.yearTitleFormat),scope.showLabels=!1,scope.rows=split(months,this.split),this.built=!0},isSelected:function(date){return picker.$date&&date.getFullYear()===picker.$date.getFullYear()&&date.getMonth()===picker.$date.getMonth()},isDisabled:function(date){return+new Date(date.getFullYear(),date.getMonth()+1,0)<options.minDate||date.getTime()>options.maxDate},onKeyDown:function(evt){if(picker.$date){var actualMonth=picker.$date.getMonth(),newDate=new Date(picker.$date);37===evt.keyCode?newDate.setMonth(actualMonth-1):38===evt.keyCode?newDate.setMonth(actualMonth-4):39===evt.keyCode?newDate.setMonth(actualMonth+1):40===evt.keyCode&&newDate.setMonth(actualMonth+4),this.isDisabled(newDate)||picker.select(newDate,!0)}}},{name:"year",format:options.yearFormat,split:4,steps:{year:12},update:function(date,force){!this.built||force||parseInt(date.getFullYear()/20,10)!==parseInt(viewDate.year/20,10)?(angular.extend(viewDate,{year:picker.$date.getFullYear(),month:picker.$date.getMonth(),date:picker.$date.getDate()}),picker.$build()):date.getFullYear()!==viewDate.year&&(angular.extend(viewDate,{year:picker.$date.getFullYear(),month:picker.$date.getMonth(),date:picker.$date.getDate()}),picker.$updateSelected())},build:function(){for(var year,firstYear=viewDate.year-viewDate.year%(3*this.split),years=[],i=0;i<12;i++)year=new Date(firstYear+i,0,1),years.push({date:year,label:formatDate(year,this.format),selected:picker.$isSelected(year),disabled:this.isDisabled(year)});scope.title=years[0].label+"-"+years[years.length-1].label,scope.showLabels=!1,scope.rows=split(years,this.split),this.built=!0},isSelected:function(date){return picker.$date&&date.getFullYear()===picker.$date.getFullYear()},isDisabled:function(date){return+new Date(date.getFullYear()+1,0,0)<options.minDate||date.getTime()>options.maxDate},onKeyDown:function(evt){if(picker.$date){var actualYear=picker.$date.getFullYear(),newDate=new Date(picker.$date);37===evt.keyCode?newDate.setYear(actualYear-1):38===evt.keyCode?newDate.setYear(actualYear-4):39===evt.keyCode?newDate.setYear(actualYear+1):40===evt.keyCode&&newDate.setYear(actualYear+4),this.isDisabled(newDate)||picker.select(newDate,!0)}}}];return{views:options.minView?Array.prototype.slice.call(views,options.minView):views,viewDate:viewDate}}}]}),angular.module("mgcrea.ngStrap.collapse",[]).provider("$collapse",function(){var defaults=this.defaults={animation:"am-collapse",disallowToggle:!1,activeClass:"in",startCollapsed:!1,allowMultiple:!1},controller=this.controller=function($scope,$element,$attrs){var self=this;self.$options=angular.copy(defaults),angular.forEach(["animation","disallowToggle","activeClass","startCollapsed","allowMultiple"],function(key){angular.isDefined($attrs[key])&&(self.$options[key]=$attrs[key])});var falseValueRegExp=/^(false|0|)$/i;function deactivateItem(value){var index=self.$targets.$active.indexOf(value);-1!==index&&self.$targets.$active.splice(index,1)}angular.forEach(["disallowToggle","startCollapsed","allowMultiple"],function(key){angular.isDefined($attrs[key])&&falseValueRegExp.test($attrs[key])&&(self.$options[key]=!1)}),self.$toggles=[],self.$targets=[],self.$viewChangeListeners=[],self.$registerToggle=function(element){self.$toggles.push(element)},self.$registerTarget=function(element){self.$targets.push(element)},self.$unregisterToggle=function(element){var index=self.$toggles.indexOf(element);self.$toggles.splice(index,1)},self.$unregisterTarget=function(element){var index=self.$targets.indexOf(element);self.$targets.splice(index,1),self.$options.allowMultiple&&deactivateItem(element),function(index){for(var activeIndexes=self.$targets.$active,i=0;i<activeIndexes.length;i++)index<activeIndexes[i]&&(activeIndexes[i]=activeIndexes[i]-1),activeIndexes[i]===self.$targets.length&&(activeIndexes[i]=self.$targets.length-1)}(index),self.$viewChangeListeners.forEach(function(fn){fn()})},self.$targets.$active=self.$options.startCollapsed?[]:[0],self.$setActive=$scope.$setActive=function(value){angular.isArray(value)?self.$targets.$active=value:!self.$options.disallowToggle&&function(value){return-1!==self.$targets.$active.indexOf(value)}(value)?deactivateItem(value):function(value){self.$options.allowMultiple||self.$targets.$active.splice(0,1);-1===self.$targets.$active.indexOf(value)&&self.$targets.$active.push(value)}(value),self.$viewChangeListeners.forEach(function(fn){fn()})},self.$activeIndexes=function(){return self.$options.allowMultiple?self.$targets.$active:1===self.$targets.$active.length?self.$targets.$active[0]:-1}};this.$get=function(){var $collapse={};return $collapse.defaults=defaults,$collapse.controller=controller,$collapse}}).directive("bsCollapse",["$window","$animate","$collapse",function($window,$animate,$collapse){return{require:["?ngModel","bsCollapse"],controller:["$scope","$element","$attrs",$collapse.controller],link:function(scope,element,attrs,controllers){var ngModelCtrl=controllers[0],bsCollapseCtrl=controllers[1];ngModelCtrl&&(bsCollapseCtrl.$viewChangeListeners.push(function(){ngModelCtrl.$setViewValue(bsCollapseCtrl.$activeIndexes())}),ngModelCtrl.$formatters.push(function(modelValue){if(angular.isArray(modelValue))bsCollapseCtrl.$setActive(modelValue);else{var activeIndexes=bsCollapseCtrl.$activeIndexes();angular.isArray(activeIndexes)?-1===activeIndexes.indexOf(1*modelValue)&&bsCollapseCtrl.$setActive(1*modelValue):activeIndexes!==1*modelValue&&bsCollapseCtrl.$setActive(1*modelValue)}return modelValue}))}}}]).directive("bsCollapseToggle",function(){return{require:["^?ngModel","^bsCollapse"],link:function(scope,element,attrs,controllers){var bsCollapseCtrl=controllers[1];element.attr("data-toggle","collapse"),bsCollapseCtrl.$registerToggle(element),scope.$on("$destroy",function(){bsCollapseCtrl.$unregisterToggle(element)}),element.on("click",function(){if(!attrs.disabled){var index=attrs.bsCollapseToggle&&"bs-collapse-toggle"!==attrs.bsCollapseToggle?attrs.bsCollapseToggle:bsCollapseCtrl.$toggles.indexOf(element);bsCollapseCtrl.$setActive(1*index),scope.$apply()}})}}}).directive("bsCollapseTarget",["$animate",function($animate){return{require:["^?ngModel","^bsCollapse"],link:function(scope,element,attrs,controllers){var bsCollapseCtrl=controllers[1];function render(){var index=bsCollapseCtrl.$targets.indexOf(element),active=bsCollapseCtrl.$activeIndexes(),action="removeClass";angular.isArray(active)?-1!==active.indexOf(index)&&(action="addClass"):index===active&&(action="addClass"),$animate[action](element,bsCollapseCtrl.$options.activeClass)}element.addClass("collapse"),bsCollapseCtrl.$options.animation&&element.addClass(bsCollapseCtrl.$options.animation),bsCollapseCtrl.$registerTarget(element),scope.$on("$destroy",function(){bsCollapseCtrl.$unregisterTarget(element)}),bsCollapseCtrl.$viewChangeListeners.push(function(){render()}),render()}}}]),angular.module("mgcrea.ngStrap.aside",["mgcrea.ngStrap.modal"]).provider("$aside",function(){var defaults=this.defaults={animation:"am-fade-and-slide-right",prefixClass:"aside",prefixEvent:"aside",placement:"right",templateUrl:"aside/aside.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$modal",function($modal){return function(config){var options=angular.extend({},defaults,config);return $modal(options)}}]}).directive("bsAside",["$window","$sce","$aside",function($window,$sce,$aside){return{restrict:"EAC",scope:!0,link:function(scope,element,attr,transclusion){var options={scope:scope,element:element,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["backdrop","keyboard","html","container"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))}),angular.forEach(["title","content"],function(key){attr[key]&&attr.$observe(key,function(newValue,oldValue){scope[key]=$sce.trustAsHtml(newValue)})}),attr.bsAside&&scope.$watch(attr.bsAside,function(newValue,oldValue){angular.isObject(newValue)?angular.extend(scope,newValue):scope.content=newValue},!0);var aside=$aside(options);element.on(attr.trigger||"click",aside.toggle),scope.$on("$destroy",function(){aside&&aside.destroy(),aside=options=null})}}}]),angular.module("mgcrea.ngStrap.alert",["mgcrea.ngStrap.modal"]).provider("$alert",function(){var defaults=this.defaults={animation:"am-fade",prefixClass:"alert",prefixEvent:"alert",placement:null,templateUrl:"alert/alert.tpl.html",container:!1,element:null,backdrop:!1,keyboard:!0,show:!0,duration:!1,type:!1,dismissable:!0};this.$get=["$modal","$timeout",function($modal,$timeout){return function(config){var $alert={},options=angular.extend({},defaults,config);($alert=$modal(options)).$scope.dismissable=!!options.dismissable,options.type&&($alert.$scope.type=options.type);var show=$alert.show;return options.duration&&($alert.show=function(){show(),$timeout(function(){$alert.hide()},1e3*options.duration)}),$alert}}]}).directive("bsAlert",["$window","$sce","$alert",function($window,$sce,$alert){return{restrict:"EAC",scope:!0,link:function(scope,element,attr,transclusion){var options={scope:scope,element:element,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","placement","keyboard","html","container","animation","duration","dismissable"],function(key){angular.isDefined(attr[key])&&(options[key]=attr[key])});var falseValueRegExp=/^(false|0|)$/i;angular.forEach(["keyboard","html","container","dismissable"],function(key){angular.isDefined(attr[key])&&falseValueRegExp.test(attr[key])&&(options[key]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(key){var bsKey="bs"+key.charAt(0).toUpperCase()+key.slice(1);angular.isDefined(attr[bsKey])&&(options[key]=scope.$eval(attr[bsKey]))}),scope.hasOwnProperty("title")||(scope.title=""),angular.forEach(["title","content","type"],function(key){attr[key]&&attr.$observe(key,function(newValue,oldValue){scope[key]=$sce.trustAsHtml(newValue)})}),attr.bsAlert&&scope.$watch(attr.bsAlert,function(newValue,oldValue){angular.isObject(newValue)?angular.extend(scope,newValue):scope.content=newValue},!0);var alert=$alert(options);element.on(attr.trigger||"click",alert.toggle),scope.$on("$destroy",function(){alert&&alert.destroy(),alert=options=null})}}}]),angular.module("mgcrea.ngStrap.affix",["mgcrea.ngStrap.helpers.dimensions","mgcrea.ngStrap.helpers.debounce"]).provider("$affix",function(){var defaults=this.defaults={offsetTop:"auto",inlineStyles:!0,setWidth:!0};this.$get=["$window","debounce","dimensions",function($window,debounce,dimensions){var bodyEl=angular.element($window.document.body),windowEl=angular.element($window);return function(element,config){var $affix={},options=angular.extend({},defaults,config),targetEl=options.target,setWidth=!1,initialAffixTop=0,initialOffsetTop=0,offsetTop=0,offsetBottom=0,affixed=null,unpin=null,parent=element.parent();if(options.offsetParent)if(options.offsetParent.match(/^\d+$/))for(var i=0;i<1*options.offsetParent-1;i++)parent=parent.parent();else parent=angular.element(options.offsetParent);function getScrollTop(){return targetEl[0]===$window?$window.pageYOffset:targetEl[0].scrollTop}function getScrollHeight(){return targetEl[0]===$window?$window.document.body.scrollHeight:targetEl[0].scrollHeight}return $affix.init=function(){this.$parseOffsets(),initialOffsetTop=dimensions.offset(element[0]).top+initialAffixTop,setWidth=options.setWidth&&!element[0].style.width,targetEl.on("scroll",this.checkPosition),targetEl.on("click",this.checkPositionWithEventLoop),windowEl.on("resize",this.$debouncedOnResize),this.checkPosition(),this.checkPositionWithEventLoop()},$affix.destroy=function(){targetEl.off("scroll",this.checkPosition),targetEl.off("click",this.checkPositionWithEventLoop),windowEl.off("resize",this.$debouncedOnResize)},$affix.checkPositionWithEventLoop=function(){setTimeout($affix.checkPosition,1)},$affix.checkPosition=function(){var scrollTop=getScrollTop(),position=dimensions.offset(element[0]),elementHeight=dimensions.height(element[0]),affix=function(_unpin,position,elementHeight){var scrollTop=getScrollTop(),scrollHeight=getScrollHeight();return scrollTop<=offsetTop?"top":null!==_unpin?scrollTop+_unpin<=position.top?"middle":"bottom":null!==offsetBottom&&position.top+elementHeight+initialAffixTop>=scrollHeight-offsetBottom?"bottom":"middle"}(unpin,position,elementHeight);affixed!==affix&&("top"===(affixed=affix)?(unpin=null,setWidth&&element.css("width",""),options.inlineStyles&&(element.css("position",options.offsetParent?"":"relative"),element.css("top",""))):"bottom"===affix?(unpin=options.offsetUnpin?-1*options.offsetUnpin:position.top-scrollTop,setWidth&&element.css("width",""),options.inlineStyles&&(element.css("position",options.offsetParent?"":"relative"),element.css("top",options.offsetParent?"":bodyEl[0].offsetHeight-offsetBottom-elementHeight-initialOffsetTop+"px"))):(unpin=null,setWidth&&element.css("width",element[0].offsetWidth+"px"),options.inlineStyles&&(element.css("position","fixed"),element.css("top",initialAffixTop+"px"))),element.removeClass("affix affix-top affix-bottom").addClass("affix"+("middle"!==affix?"-"+affix:"")))},$affix.$onResize=function(){$affix.$parseOffsets(),$affix.checkPosition()},$affix.$debouncedOnResize=debounce($affix.$onResize,50),$affix.$parseOffsets=function(){var initialPosition=element[0].style.position,initialTop=element[0].style.top;options.inlineStyles&&(element.css("position",options.offsetParent?"":"relative"),element.css("top","")),options.offsetTop&&("auto"===options.offsetTop&&(options.offsetTop="+0"),offsetTop=options.offsetTop.match(/^[-+]\d+$/)?(initialAffixTop=1*-options.offsetTop,options.offsetParent?dimensions.offset(parent[0]).top+1*options.offsetTop:dimensions.offset(element[0]).top-dimensions.css(element[0],"marginTop",!0)+1*options.offsetTop):1*options.offsetTop),options.offsetBottom&&(offsetBottom=options.offsetParent&&options.offsetBottom.match(/^[-+]\d+$/)?getScrollHeight()-(dimensions.offset(parent[0]).top+dimensions.height(parent[0]))+1*options.offsetBottom+1:1*options.offsetBottom),options.inlineStyles&&(element.css("position",initialPosition),element.css("top",initialTop))},$affix.init(),$affix}}]}).directive("bsAffix",["$affix","$window","$timeout",function($affix,$window,$timeout){return{restrict:"EAC",require:"^?bsAffixTarget",link:function(scope,element,attr,affixTarget){var affix,options={scope:scope,target:affixTarget?affixTarget.$element:angular.element($window)};angular.forEach(["offsetTop","offsetBottom","offsetParent","offsetUnpin","inlineStyles","setWidth"],function(key){if(angular.isDefined(attr[key])){var option=attr[key];/true/i.test(option)&&(option=!0),/false/i.test(option)&&(option=!1),options[key]=option}}),$timeout(function(){affix=$affix(element,options)}),scope.$on("$destroy",function(){affix&&affix.destroy(),affix=options=null})}}}]).directive("bsAffixTarget",function(){return{controller:["$element",function($element){this.$element=$element}]}}),angular.module("mgcrea.ngStrap",["mgcrea.ngStrap.modal","mgcrea.ngStrap.aside","mgcrea.ngStrap.alert","mgcrea.ngStrap.button","mgcrea.ngStrap.select","mgcrea.ngStrap.datepicker","mgcrea.ngStrap.timepicker","mgcrea.ngStrap.navbar","mgcrea.ngStrap.tooltip","mgcrea.ngStrap.popover","mgcrea.ngStrap.dropdown","mgcrea.ngStrap.typeahead","mgcrea.ngStrap.scrollspy","mgcrea.ngStrap.affix","mgcrea.ngStrap.tab","mgcrea.ngStrap.collapse"])}(window,document),function(window,document,undefined){"use strict";angular.module("mgcrea.ngStrap.alert").run(["$templateCache",function($templateCache){$templateCache.put("alert/alert.tpl.html",'<div class="alert" ng-class="[type ? \'alert-\' + type : null]"><button type="button" class="close" ng-if="dismissable" ng-click="$hide()">&times;</button> <span ng-if="title"><strong ng-bind="title"></strong>&nbsp;<span ng-bind-html="content"></span> </span><span ng-if="!title" ng-bind-html="content"></span></div>')}]),angular.module("mgcrea.ngStrap.aside").run(["$templateCache",function($templateCache){$templateCache.put("aside/aside.tpl.html",'<div class="aside" tabindex="-1" role="dialog"><div class="aside-dialog"><div class="aside-content"><div class="aside-header" ng-show="title"><button type="button" class="close" ng-click="$hide()">&times;</button><h4 class="aside-title" ng-bind="title"></h4></div><div class="aside-body" ng-bind="content"></div><div class="aside-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>')}]),angular.module("mgcrea.ngStrap.datepicker").run(["$templateCache",function($templateCache){$templateCache.put("datepicker/datepicker.tpl.html",'<div class="dropdown-menu datepicker" ng-class="\'datepicker-mode-\' + $mode" style="max-width: 320px"><table style="table-layout: fixed; height: 100%; width: 100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$selectPane(-1)"><i class="{{$iconLeft}}"></i></button></th><th colspan="{{ rows[0].length - 2 }}"><button tabindex="-1" type="button" class="btn btn-default btn-block text-strong" ng-click="$toggleMode()"><strong style="text-transform: capitalize" ng-bind="title"></strong></button></th><th><button tabindex="-1" type="button" class="btn btn-default pull-right" ng-click="$selectPane(+1)"><i class="{{$iconRight}}"></i></button></th></tr><tr ng-if="showLabels" ng-bind-html="labels"></tr></thead><tbody><tr ng-repeat="(i, row) in rows" height="{{ 100 / rows.length }}%"><td class="text-center" ng-repeat="(j, el) in row"><button tabindex="-1" type="button" class="btn btn-default" style="width: 100%" ng-class="{\'btn-primary\': el.selected, \'btn-info btn-today\': el.isToday && !el.selected}" ng-click="$select(el.date, el.disabled)" ng-disabled="el.disabled"><span ng-class="{\'text-muted\': el.muted}" ng-bind="el.label"></span></button></td></tr></tbody><tfoot><tr><td colspan="{{ rows[0].length }}"><div class="btn-group btn-group-justified" role="group"><div class="btn-group" role="group" ng-if="$hasToday"><button type="button" class="btn btn-default today" ng-click="$setToday()" ng-disabled="isTodayDisabled"><strong style="text-transform: capitalize">Today</strong></button></div><div class="btn-group" role="group" ng-if="$hasClear"><button type="button" class="btn btn-default clear" ng-click="$clear()"><strong style="text-transform: capitalize">Clear</strong></button></div></div></td></tr></tfoot></table></div>')}]),angular.module("mgcrea.ngStrap.dropdown").run(["$templateCache",function($templateCache){$templateCache.put("dropdown/dropdown.tpl.html",'<ul tabindex="-1" class="dropdown-menu" role="menu" ng-show="content && content.length"><li role="presentation" ng-class="{divider: item.divider, active: item.active}" ng-repeat="item in content"><a role="menuitem" tabindex="-1" ng-href="{{item.href}}" ng-if="!item.divider && item.href" target="{{item.target || \'\'}}" ng-bind="item.text"></a> <a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-if="!item.divider && item.click" ng-click="$eval(item.click);$hide()" ng-bind="item.text"></a></li></ul>')}]),angular.module("mgcrea.ngStrap.modal").run(["$templateCache",function($templateCache){$templateCache.put("modal/modal.tpl.html",'<div class="modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header" ng-show="title"><button type="button" class="close" aria-label="Close" ng-click="$hide()"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" ng-bind="title"></h4></div><div class="modal-body" ng-bind="content"></div><div class="modal-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>')}]),angular.module("mgcrea.ngStrap.popover").run(["$templateCache",function($templateCache){$templateCache.put("popover/popover.tpl.html",'<div class="popover" tabindex="-1"><div class="arrow"></div><h3 class="popover-title" ng-bind="title" ng-show="title"></h3><div class="popover-content" ng-bind="content"></div></div>')}]),angular.module("mgcrea.ngStrap.select").run(["$templateCache",function($templateCache){$templateCache.put("select/select.tpl.html",'<ul tabindex="-1" class="select dropdown-menu" ng-show="$isVisible()" role="select"><li ng-if="$showAllNoneButtons"><div class="btn-group" style="margin-bottom: 5px; margin-left: 5px"><button type="button" class="btn btn-default btn-xs" ng-click="$selectAll()">{{$allText}}</button> <button type="button" class="btn btn-default btn-xs" ng-click="$selectNone()">{{$noneText}}</button></div></li><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $isActive($index)}"><a style="cursor: default" role="menuitem" tabindex="-1" ng-click="$select($index, $event)"><i class="{{$iconCheckmark}} pull-right" ng-if="$isMultiple && $isActive($index)"></i> <span ng-bind="match.label"></span></a></li></ul>')}]),angular.module("mgcrea.ngStrap.tab").run(["$templateCache",function($templateCache){$templateCache.put("tab/tab.tpl.html",'<ul class="nav" ng-class="$navClass" role="tablist"><li role="presentation" ng-repeat="$pane in $panes track by $index" ng-class="[ $isActive($pane, $index) ? $activeClass : \'\', $pane.disabled ? \'disabled\' : \'\' ]"><a role="tab" data-toggle="tab" ng-click="!$pane.disabled && $setActive($pane.name || $index)" data-index="{{ $index }}" ng-bind-html="$pane.title" aria-controls="$pane.title" href=""></a></li></ul><div ng-transclude class="tab-content"></div>')}]),angular.module("mgcrea.ngStrap.timepicker").run(["$templateCache",function($templateCache){$templateCache.put("timepicker/timepicker.tpl.html",'<div class="dropdown-menu timepicker" style="min-width: 0px;width: auto"><table height="100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 0)"><i class="{{ $iconUp }}"></i></button></th><th>&nbsp;</th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 1)"><i class="{{ $iconUp }}"></i></button></th><th ng-if="showSeconds">&nbsp;</th><th ng-if="showSeconds"><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 2)"><i class="{{ $iconUp }}"></i></button></th></tr></thead><tbody><tr ng-repeat="(i, row) in rows"><td class="text-center"><button tabindex="-1" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[0].selected}" ng-click="$select(row[0].date, 0)" ng-disabled="row[0].disabled"><span ng-class="{\'text-muted\': row[0].muted}" ng-bind="row[0].label"></span></button></td><td><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td class="text-center"><button tabindex="-1" ng-if="row[1].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[1].selected}" ng-click="$select(row[1].date, 1)" ng-disabled="row[1].disabled"><span ng-class="{\'text-muted\': row[1].muted}" ng-bind="row[1].label"></span></button></td><td ng-if="showSeconds"><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td ng-if="showSeconds" class="text-center"><button tabindex="-1" ng-if="row[2].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[2].selected}" ng-click="$select(row[2].date, 2)" ng-disabled="row[2].disabled"><span ng-class="{\'text-muted\': row[2].muted}" ng-bind="row[2].label"></span></button></td><td ng-if="showAM">&nbsp;</td><td ng-if="showAM"><button tabindex="-1" ng-show="i == midIndex - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !!isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">AM</button> <button tabindex="-1" ng-show="i == midIndex + 1 - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">PM</button></td></tr></tbody><tfoot><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 0)"><i class="{{ $iconDown }}"></i></button></th><th>&nbsp;</th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 1)"><i class="{{ $iconDown }}"></i></button></th><th ng-if="showSeconds">&nbsp;</th><th ng-if="showSeconds"><button ng-if="showSeconds" tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 2)"><i class="{{ $iconDown }}"></i></button></th></tr></tfoot></table></div>')}]),angular.module("mgcrea.ngStrap.tooltip").run(["$templateCache",function($templateCache){$templateCache.put("tooltip/tooltip.tpl.html",'<div class="tooltip in" ng-show="title"><div class="tooltip-arrow"></div><div class="tooltip-inner" ng-bind="title"></div></div>')}]),angular.module("mgcrea.ngStrap.typeahead").run(["$templateCache",function($templateCache){$templateCache.put("typeahead/typeahead.tpl.html",'<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select"><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}"><a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a></li></ul>')}])}(0,document),function(window,angular){"use strict";var bind,extend,forEach,isDefined,lowercase,noop,htmlParser,htmlSanitizeWriter,$sanitizeMinErr=angular.$$minErr("$sanitize");angular.module("ngSanitize",[]).provider("$sanitize",function(){var svgEnabled=!1;this.$get=["$$sanitizeUri",function($$sanitizeUri){return svgEnabled&&extend(validElements,svgElements),function(html){var buf=[];return htmlParser(html,htmlSanitizeWriter(buf,function(uri,isImage){return!/^unsafe:/.test($$sanitizeUri(uri,isImage))})),buf.join("")}}],this.enableSvg=function(enableSvg){return isDefined(enableSvg)?(svgEnabled=enableSvg,this):svgEnabled},bind=angular.bind,extend=angular.extend,forEach=angular.forEach,isDefined=angular.isDefined,lowercase=angular.lowercase,noop=angular.noop,htmlParser=function(html,handler){null===html||html===undefined?html="":"string"!=typeof html&&(html=""+html),inertBodyElement.innerHTML=html;var mXSSAttempts=5;do{if(0===mXSSAttempts)throw $sanitizeMinErr("uinput","Failed to sanitize html because the input is unstable");mXSSAttempts--,window.document.documentMode&&stripCustomNsAttrs(inertBodyElement),html=inertBodyElement.innerHTML,inertBodyElement.innerHTML=html}while(html!==inertBodyElement.innerHTML);for(var node=inertBodyElement.firstChild;node;){switch(node.nodeType){case 1:handler.start(node.nodeName.toLowerCase(),attrToMap(node.attributes));break;case 3:handler.chars(node.textContent)}var nextNode;if(!((nextNode=node.firstChild)||(1===node.nodeType&&handler.end(node.nodeName.toLowerCase()),nextNode=node.nextSibling)))for(;null==nextNode&&(node=node.parentNode)!==inertBodyElement;)nextNode=node.nextSibling,1===node.nodeType&&handler.end(node.nodeName.toLowerCase());node=nextNode}for(;node=inertBodyElement.firstChild;)inertBodyElement.removeChild(node)},htmlSanitizeWriter=function(buf,uriValidator){var ignoreCurrentElement=!1,out=bind(buf,buf.push);return{start:function(tag,attrs){tag=lowercase(tag),!ignoreCurrentElement&&blockedElements[tag]&&(ignoreCurrentElement=tag),ignoreCurrentElement||!0!==validElements[tag]||(out("<"),out(tag),forEach(attrs,function(value,key){var lkey=lowercase(key),isImage="img"===tag&&"src"===lkey||"background"===lkey;!0!==validAttrs[lkey]||!0===uriAttrs[lkey]&&!uriValidator(value,isImage)||(out(" "),out(key),out('="'),out(encodeEntities(value)),out('"'))}),out(">"))},end:function(tag){tag=lowercase(tag),ignoreCurrentElement||!0!==validElements[tag]||!0===voidElements[tag]||(out("</"),out(tag),out(">")),tag==ignoreCurrentElement&&(ignoreCurrentElement=!1)},chars:function(chars){ignoreCurrentElement||out(encodeEntities(chars))}}};var inertBodyElement,SURROGATE_PAIR_REGEXP=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,NON_ALPHANUMERIC_REGEXP=/([^#-~ |!])/g,voidElements=toMap("area,br,col,hr,img,wbr"),optionalEndTagBlockElements=toMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),optionalEndTagInlineElements=toMap("rp,rt"),optionalEndTagElements=extend({},optionalEndTagInlineElements,optionalEndTagBlockElements),blockElements=extend({},optionalEndTagBlockElements,toMap("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),inlineElements=extend({},optionalEndTagInlineElements,toMap("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),svgElements=toMap("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),blockedElements=toMap("script,style"),validElements=extend({},voidElements,blockElements,inlineElements,optionalEndTagElements),uriAttrs=toMap("background,cite,href,longdesc,src,xlink:href"),htmlAttrs=toMap("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),svgAttrs=toMap("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),validAttrs=extend({},uriAttrs,svgAttrs,htmlAttrs);function toMap(str,lowercaseKeys){var i,obj={},items=str.split(",");for(i=0;i<items.length;i++)obj[lowercaseKeys?lowercase(items[i]):items[i]]=!0;return obj}function attrToMap(attrs){for(var map={},i=0,ii=attrs.length;i<ii;i++){var attr=attrs[i];map[attr.name]=attr.value}return map}function encodeEntities(value){return value.replace(/&/g,"&amp;").replace(SURROGATE_PAIR_REGEXP,function(value){return"&#"+(1024*(value.charCodeAt(0)-55296)+(value.charCodeAt(1)-56320)+65536)+";"}).replace(NON_ALPHANUMERIC_REGEXP,function(value){return"&#"+value.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function stripCustomNsAttrs(node){for(;node;){if(node.nodeType===window.Node.ELEMENT_NODE)for(var attrs=node.attributes,i=0,l=attrs.length;i<l;i++){var attrNode=attrs[i],attrName=attrNode.name.toLowerCase();"xmlns:ns1"!==attrName&&0!==attrName.lastIndexOf("ns1:",0)||(node.removeAttributeNode(attrNode),i--,l--)}var nextNode=node.firstChild;nextNode&&stripCustomNsAttrs(nextNode),node=node.nextSibling}}!function(window){var doc;if(!window.document||!window.document.implementation)throw $sanitizeMinErr("noinert","Can't create an inert html document");var bodyElements=((doc=window.document.implementation.createHTMLDocument("inert")).documentElement||doc.getDocumentElement()).getElementsByTagName("body");if(1===bodyElements.length)inertBodyElement=bodyElements[0];else{var html=doc.createElement("html");inertBodyElement=doc.createElement("body"),html.appendChild(inertBodyElement),doc.appendChild(html)}}(window)}),angular.module("ngSanitize").filter("linky",["$sanitize",function($sanitize){var LINKY_URL_REGEXP=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,MAILTO_REGEXP=/^mailto:/i,linkyMinErr=angular.$$minErr("linky"),isDefined=angular.isDefined,isFunction=angular.isFunction,isObject=angular.isObject,isString=angular.isString;return function(text,target,attributes){if(null==text||""===text)return text;if(!isString(text))throw linkyMinErr("notstring","Expected string but received: {0}",text);for(var match,url,i,attributesFn=isFunction(attributes)?attributes:isObject(attributes)?function(){return attributes}:function(){return{}},raw=text,html=[];match=raw.match(LINKY_URL_REGEXP);)url=match[0],match[2]||match[4]||(url=(match[3]?"http://":"mailto:")+url),i=match.index,addText(raw.substr(0,i)),addLink(url,match[0].replace(MAILTO_REGEXP,"")),raw=raw.substring(i+match[0].length);return addText(raw),$sanitize(html.join(""));function addText(text){var chars,buf;text&&html.push((chars=text,htmlSanitizeWriter(buf=[],noop).chars(chars),buf.join("")))}function addLink(url,text){var key,linkAttributes=attributesFn(url);for(key in html.push("<a "),linkAttributes)html.push(key+'="'+linkAttributes[key]+'" ');!isDefined(target)||"target"in linkAttributes||html.push('target="',target,'" '),html.push('href="',url.replace(/"/g,"&quot;"),'">'),addText(text),html.push("</a>")}}}])}(window,svi.angular),function(window,angular){"use strict";var ngAriaModule=angular.module("ngAria",["ng"]).provider("$aria",function(){var config={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeypress:!0,bindRoleForClick:!0};function watchExpr(attrName,ariaAttr,nodeBlackList,negate){return function(scope,elem,attr){var ariaCamelName=attr.$normalize(ariaAttr);!config[ariaCamelName]||isNodeOneOf(elem,nodeBlackList)||attr[ariaCamelName]||scope.$watch(attr[attrName],function(boolVal){boolVal=negate?!boolVal:!!boolVal,elem.attr(ariaAttr,boolVal)})}}this.config=function(newConfig){config=angular.extend(config,newConfig)},this.$get=function(){return{config:function(key){return config[key]},$$watchExpr:watchExpr}}}),nodeBlackList=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],isNodeOneOf=function(elem,nodeTypeArray){if(-1!==nodeTypeArray.indexOf(elem[0].nodeName))return!0};ngAriaModule.directive("ngShow",["$aria",function($aria){return $aria.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function($aria){return $aria.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function($aria){return $aria.$$watchExpr("ngValue","aria-checked",nodeBlackList,!1)}]).directive("ngChecked",["$aria",function($aria){return $aria.$$watchExpr("ngChecked","aria-checked",nodeBlackList,!1)}]).directive("ngReadonly",["$aria",function($aria){return $aria.$$watchExpr("ngReadonly","aria-readonly",nodeBlackList,!1)}]).directive("ngRequired",["$aria",function($aria){return $aria.$$watchExpr("ngRequired","aria-required",nodeBlackList,!1)}]).directive("ngModel",["$aria",function($aria){function shouldAttachAttr(attr,normalizedAttr,elem,allowBlacklistEls){return $aria.config(normalizedAttr)&&!elem.attr(attr)&&(allowBlacklistEls||!isNodeOneOf(elem,nodeBlackList))}function shouldAttachRole(role,elem){return!elem.attr("role")&&elem.attr("type")===role&&"INPUT"!==elem[0].nodeName}return{restrict:"A",require:"ngModel",priority:200,compile:function(elem,attr){var shape=function(attr,elem){var type=attr.type,role=attr.role;return"checkbox"===(type||role)||"menuitemcheckbox"===role?"checkbox":"radio"===(type||role)||"menuitemradio"===role?"radio":"range"===type||"progressbar"===role||"slider"===role?"range":""}(attr);return{pre:function(scope,elem,attr,ngModel){"checkbox"===shape&&(ngModel.$isEmpty=function(value){return!1===value})},post:function(scope,elem,attr,ngModel){var needsTabIndex=shouldAttachAttr("tabindex","tabindex",elem,!1);function ngAriaWatchModelValue(){return ngModel.$modelValue}switch(shape){case"radio":case"checkbox":shouldAttachRole(shape,elem)&&elem.attr("role",shape),shouldAttachAttr("aria-checked","ariaChecked",elem,!1)&&scope.$watch(ngAriaWatchModelValue,"radio"===shape?function(newVal){var boolVal=attr.value==ngModel.$viewValue;elem.attr("aria-checked",boolVal)}:function(){elem.attr("aria-checked",!ngModel.$isEmpty(ngModel.$viewValue))}),needsTabIndex&&elem.attr("tabindex",0);break;case"range":if(shouldAttachRole(shape,elem)&&elem.attr("role","slider"),$aria.config("ariaValue")){var needsAriaValuemin=!elem.attr("aria-valuemin")&&(attr.hasOwnProperty("min")||attr.hasOwnProperty("ngMin")),needsAriaValuemax=!elem.attr("aria-valuemax")&&(attr.hasOwnProperty("max")||attr.hasOwnProperty("ngMax")),needsAriaValuenow=!elem.attr("aria-valuenow");needsAriaValuemin&&attr.$observe("min",function(newVal){elem.attr("aria-valuemin",newVal)}),needsAriaValuemax&&attr.$observe("max",function(newVal){elem.attr("aria-valuemax",newVal)}),needsAriaValuenow&&scope.$watch(ngAriaWatchModelValue,function(newVal){elem.attr("aria-valuenow",newVal)})}needsTabIndex&&elem.attr("tabindex",0)}!attr.hasOwnProperty("ngRequired")&&ngModel.$validators.required&&shouldAttachAttr("aria-required","ariaRequired",elem,!1)&&attr.$observe("required",function(){elem.attr("aria-required",!!attr.required)}),shouldAttachAttr("aria-invalid","ariaInvalid",elem,!0)&&scope.$watch(function(){return ngModel.$invalid},function(newVal){elem.attr("aria-invalid",!!newVal)})}}}}}]).directive("ngDisabled",["$aria",function($aria){return $aria.$$watchExpr("ngDisabled","aria-disabled",nodeBlackList,!1)}]).directive("ngMessages",function(){return{restrict:"A",require:"?ngMessages",link:function(scope,elem,attr,ngMessages){elem.attr("aria-live")||elem.attr("aria-live","assertive")}}}).directive("ngClick",["$aria","$parse",function($aria,$parse){return{restrict:"A",compile:function(elem,attr){var fn=$parse(attr.ngClick,null,!0);return function(scope,elem,attr){isNodeOneOf(elem,nodeBlackList)||($aria.config("bindRoleForClick")&&!elem.attr("role")&&elem.attr("role","button"),$aria.config("tabindex")&&!elem.attr("tabindex")&&elem.attr("tabindex",0),$aria.config("bindKeypress")&&!attr.ngKeypress&&elem.on("keypress",function(event){var keyCode=event.which||event.keyCode;32!==keyCode&&13!==keyCode||scope.$apply(function(){fn(scope,{$event:event})})}))}}}}]).directive("ngDblclick",["$aria",function($aria){return function(scope,elem,attr){!$aria.config("tabindex")||elem.attr("tabindex")||isNodeOneOf(elem,nodeBlackList)||elem.attr("tabindex",0)}}])}(0,svi.angular),function(window,angular){"use strict";function $$CookieWriter($document,$log,$browser){var cookiePath=$browser.baseHref(),rawDocument=$document[0];return function(name,value,options){rawDocument.cookie=function(name,value,options){var path,expires;expires=(options=options||{}).expires,path=angular.isDefined(options.path)?options.path:cookiePath,angular.isUndefined(value)&&(expires="Thu, 01 Jan 1970 00:00:00 GMT",value=""),angular.isString(expires)&&(expires=new Date(expires));var str=encodeURIComponent(name)+"="+encodeURIComponent(value);str+=path?";path="+path:"",str+=options.domain?";domain="+options.domain:"",str+=expires?";expires="+expires.toUTCString():"";var cookieLength=(str+=options.secure?";secure":"").length+1;return 4096<cookieLength&&$log.warn("Cookie '"+name+"' possibly not set or overflowed because it was too large ("+cookieLength+" > 4096 bytes)!"),str}(name,value,options)}}angular.module("ngCookies",["ng"]).provider("$cookies",[function(){var defaults=this.defaults={};function calcOptions(options){return options?angular.extend({},defaults,options):defaults}this.$get=["$$cookieReader","$$cookieWriter",function($$cookieReader,$$cookieWriter){return{get:function(key){return $$cookieReader()[key]},getObject:function(key){var value=this.get(key);return value?angular.fromJson(value):value},getAll:function(){return $$cookieReader()},put:function(key,value,options){$$cookieWriter(key,value,calcOptions(options))},putObject:function(key,value,options){this.put(key,angular.toJson(value),options)},remove:function(key,options){$$cookieWriter(key,undefined,calcOptions(options))}}}]}]),angular.module("ngCookies").factory("$cookieStore",["$cookies",function($cookies){return{get:function(key){return $cookies.getObject(key)},put:function(key,value){$cookies.putObject(key,value)},remove:function(key){$cookies.remove(key)}}}]),$$CookieWriter.$inject=["$document","$log","$browser"],angular.module("ngCookies").provider("$$cookieWriter",function(){this.$get=$$CookieWriter})}(0,svi.angular),function(window,document,undefined){!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):jQuery&&!jQuery.fn.qtip&&factory(jQuery)}(function($){"use strict";var QTIP,PROTOTYPE,CORNER,CHECKS,trackingBound,TRUE=!0,FALSE=!1,NULL=null,X="x",Y="y",WIDTH="width",TOP="top",LEFT="left",RIGHT="right",CENTER="center",PLUGINS={},NAMESPACE="qtip",ATTR_ID="data-qtip-id",WIDGET=["ui-widget","ui-tooltip"],SELECTOR="."+NAMESPACE,INACTIVE_EVENTS="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),CLASS_FIXED=NAMESPACE+"-fixed",CLASS_DEFAULT=NAMESPACE+"-default",CLASS_FOCUS=NAMESPACE+"-focus",CLASS_HOVER=NAMESPACE+"-hover",CLASS_DISABLED=NAMESPACE+"-disabled",BROWSER={ie:function(){for(var v=4,i=document.createElement("div");(i.innerHTML="\x3c!--[if gt IE "+v+"]><i></i><![endif]--\x3e")&&i.getElementsByTagName("i")[0];v+=1);return 4<v?v:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||FALSE};function QTip(target,options,id,attr){this.id=id,this.target=target,this.tooltip=NULL,this.elements={target:target},this._id=NAMESPACE+"-"+id,this.timers={img:{}},this.options=options,this.plugins={},this.cache={event:{},target:$(),disabled:FALSE,attr:attr,onTooltip:FALSE,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=FALSE}function invalidOpt(a){return a===NULL||"object"!==$.type(a)}function invalidContent(c){return!($.isFunction(c)||c&&c.attr||c.length||"object"===$.type(c)&&(c.jquery||c.then))}function sanitizeOptions(opts){var content,text,ajax,once;return invalidOpt(opts)?FALSE:(invalidOpt(opts.metadata)&&(opts.metadata={type:opts.metadata}),"content"in opts&&(invalidOpt(content=opts.content)||content.jquery||content.done?content=opts.content={text:text=invalidContent(content)?FALSE:content}:text=content.text,"ajax"in content&&(ajax=content.ajax,once=ajax&&ajax.once!==FALSE,delete content.ajax,content.text=function(event,api){var loading=text||$(this).attr(api.options.content.attr)||"Loading...",deferred=$.ajax($.extend({},ajax,{context:api})).then(ajax.success,NULL,ajax.error).then(function(content){return content&&once&&api.set("content.text",content),content},function(xhr,status,error){api.destroyed||0===xhr.status||api.set("content.text",status+": "+error)});return once?loading:(api.set("content.text",loading),deferred)}),"title"in content&&($.isPlainObject(content.title)&&(content.button=content.title.button,content.title=content.title.text),invalidContent(content.title||FALSE)&&(content.title=FALSE))),"position"in opts&&invalidOpt(opts.position)&&(opts.position={my:opts.position,at:opts.position}),"show"in opts&&invalidOpt(opts.show)&&(opts.show=opts.show.jquery?{target:opts.show}:opts.show===TRUE?{ready:TRUE}:{event:opts.show}),"hide"in opts&&invalidOpt(opts.hide)&&(opts.hide=opts.hide.jquery?{target:opts.hide}:{event:opts.hide}),"style"in opts&&invalidOpt(opts.style)&&(opts.style={classes:opts.style}),$.each(PLUGINS,function(){this.sanitize&&this.sanitize(opts)}),opts)}function convertNotation(options,notation){for(var obj,i=0,option=options,levels=notation.split(".");option=option[levels[i++]];)i<levels.length&&(obj=option);return[obj||options,levels.pop()]}function setCallback(notation,args){var category,rule,match;for(category in this.checks)for(rule in this.checks[category])(match=new RegExp(rule,"i").exec(notation))&&(args.push(match),("builtin"===category||this.plugins[category])&&this.checks[category][rule].apply(this.plugins[category]||this,args))}(PROTOTYPE=QTip.prototype)._when=function(deferreds){return $.when.apply($,deferreds)},PROTOTYPE.render=function(show){if(this.rendered||this.destroyed)return this;var self=this,options=this.options,cache=this.cache,elements=this.elements,text=options.content.text,title=options.content.title,button=options.content.button,posOptions=options.position,deferreds=(this._id,[]);return $.attr(this.target[0],"aria-describedby",this._id),cache.posClass=this._createPosClass((this.position={my:posOptions.my,at:posOptions.at}).my),this.tooltip=elements.tooltip=$("<div/>",{id:this._id,class:[NAMESPACE,CLASS_DEFAULT,options.style.classes,cache.posClass].join(" "),width:options.style.width||"",height:options.style.height||"",tracking:"mouse"===posOptions.target&&posOptions.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":FALSE,"aria-describedby":this._id+"-content","aria-hidden":TRUE}).toggleClass(CLASS_DISABLED,this.disabled).attr(ATTR_ID,this.id).data(NAMESPACE,this).appendTo(posOptions.container).append(elements.content=$("<div />",{class:NAMESPACE+"-content",id:this._id+"-content","aria-atomic":TRUE})),this.rendered=-1,this.positioning=TRUE,title&&(this._createTitle(),$.isFunction(title)||deferreds.push(this._updateTitle(title,FALSE))),button&&this._createButton(),$.isFunction(text)||deferreds.push(this._updateContent(text,FALSE)),this.rendered=TRUE,this._setWidget(),$.each(PLUGINS,function(name){var instance;"render"===this.initialize&&(instance=this(self))&&(self.plugins[name]=instance)}),this._unassignEvents(),this._assignEvents(),this._when(deferreds).then(function(){self._trigger("render"),self.positioning=FALSE,self.hiddenDuringWait||!options.show.ready&&!show||self.toggle(TRUE,cache.event,FALSE),self.hiddenDuringWait=FALSE}),QTIP.api[this.id]=this},PROTOTYPE.destroy=function(immediate){if(this.destroyed)return this.target;function process(){if(!this.destroyed){this.destroyed=TRUE;var timer,target=this.target,title=target.attr("oldtitle");for(timer in this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),$.each(this.plugins,function(name){this.destroy&&this.destroy()}),this.timers)clearTimeout(this.timers[timer]);target.removeData(NAMESPACE).removeAttr(ATTR_ID).removeAttr("data-hasqtip").removeAttr("aria-describedby"),this.options.suppress&&title&&target.attr("title",title).removeAttr("oldtitle"),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=NULL,delete QTIP.api[this.id]}}return immediate===TRUE&&"hide"!==this.triggering||!this.rendered?process.call(this):(this.tooltip.one("tooltiphidden",$.proxy(process,this)),!this.triggering&&this.hide()),this.target},CHECKS=PROTOTYPE.checks={builtin:{"^id$":function(obj,o,v,prev){var id=v===TRUE?QTIP.nextid:v,new_id=NAMESPACE+"-"+id;id!==FALSE&&0<id.length&&!$("#"+new_id).length?(this._id=new_id,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):obj[o]=prev},"^prerender":function(obj,o,v){v&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(obj,o,v){this._updateContent(v)},"^content.attr$":function(obj,o,v,prev){this.options.content.text===this.target.attr(prev)&&this._updateContent(this.target.attr(v))},"^content.title$":function(obj,o,v){if(!v)return this._removeTitle();v&&!this.elements.title&&this._createTitle(),this._updateTitle(v)},"^content.button$":function(obj,o,v){this._updateButton(v)},"^content.title.(text|button)$":function(obj,o,v){this.set("content."+o,v)},"^position.(my|at)$":function(obj,o,v){"string"==typeof v&&(this.position[o]=obj[o]=new CORNER(v,"at"===o))},"^position.container$":function(obj,o,v){this.rendered&&this.tooltip.appendTo(v)},"^show.ready$":function(obj,o,v){v&&(!this.rendered&&this.render(TRUE)||this.toggle(TRUE))},"^style.classes$":function(obj,o,v,p){this.rendered&&this.tooltip.removeClass(p).addClass(v)},"^style.(width|height)":function(obj,o,v){this.rendered&&this.tooltip.css(o,v)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(obj,o,v){this.rendered&&this.tooltip.toggleClass(CLASS_DEFAULT,!!v)},"^events.(render|show|move|hide|focus|blur)$":function(obj,o,v){this.rendered&&this.tooltip[($.isFunction(v)?"":"un")+"bind"]("tooltip"+o,v)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var posOptions=this.options.position;this.tooltip.attr("tracking","mouse"===posOptions.target&&posOptions.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},PROTOTYPE.get=function(notation){if(this.destroyed)return this;var o=convertNotation(this.options,notation.toLowerCase()),result=o[0][o[1]];return result.precedance?result.string():result};var rmove=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,rrender=/^prerender|show\.ready/i;PROTOTYPE.set=function(option,value){if(this.destroyed)return this;var name,rendered=this.rendered,reposition=FALSE,options=this.options;this.checks;return"string"==typeof option?(name=option,(option={})[name]=value):option=$.extend({},option),$.each(option,function(notation,value){if(rendered&&rrender.test(notation))delete option[notation];else{var previous,obj=convertNotation(options,notation.toLowerCase());previous=obj[0][obj[1]],obj[0][obj[1]]=value&&value.nodeType?$(value):value,reposition=rmove.test(notation)||reposition,option[notation]=[obj[0],obj[1],value,previous]}}),sanitizeOptions(options),this.positioning=TRUE,$.each(option,$.proxy(setCallback,this)),this.positioning=FALSE,this.rendered&&0<this.tooltip[0].offsetWidth&&reposition&&this.reposition("mouse"===options.position.target?NULL:this.cache.event),this},PROTOTYPE._update=function(content,element,reposition){var self=this,cache=this.cache;return this.rendered&&content?($.isFunction(content)&&(content=content.call(this.elements.target,cache.event,this)||""),$.isFunction(content.then)?(cache.waiting=TRUE,content.then(function(c){return cache.waiting=FALSE,self._update(c,element)},NULL,function(e){return self._update(e,element)})):content===FALSE||!content&&""!==content?FALSE:(content.jquery&&0<content.length?element.empty().append(content.css({display:"block",visibility:"visible"})):element.html(content),this._waitForContent(element).then(function(images){self.rendered&&0<self.tooltip[0].offsetWidth&&self.reposition(cache.event,!images.length)}))):FALSE},PROTOTYPE._waitForContent=function(element){var cache=this.cache;return cache.waiting=TRUE,($.fn.imagesLoaded?element.imagesLoaded():$.Deferred().resolve([])).done(function(){cache.waiting=FALSE}).promise()},PROTOTYPE._updateContent=function(content,reposition){this._update(content,this.elements.content,reposition)},PROTOTYPE._updateTitle=function(content,reposition){this._update(content,this.elements.title,reposition)===FALSE&&this._removeTitle(FALSE)},PROTOTYPE._createTitle=function(){var elements=this.elements,id=this._id+"-title";elements.titlebar&&this._removeTitle(),elements.titlebar=$("<div />",{class:NAMESPACE+"-titlebar "+(this.options.style.widget?createWidgetClass("header"):"")}).append(elements.title=$("<div />",{id:id,class:NAMESPACE+"-title","aria-atomic":TRUE})).insertBefore(elements.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(event){$(this).toggleClass("ui-state-active ui-state-focus","down"===event.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(event){$(this).toggleClass("ui-state-hover","mouseover"===event.type)}),this.options.content.button&&this._createButton()},PROTOTYPE._removeTitle=function(reposition){var elements=this.elements;elements.title&&(elements.titlebar.remove(),elements.titlebar=elements.title=elements.button=NULL,reposition!==FALSE&&this.reposition())},PROTOTYPE._createPosClass=function(my){return NAMESPACE+"-pos-"+(my||this.options.position.my).abbrev()},PROTOTYPE.reposition=function(event,effect){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=TRUE;var pluginCalculations,offset,adjusted,newClass,cache=this.cache,tooltip=this.tooltip,posOptions=this.options.position,target=posOptions.target,my=posOptions.my,at=posOptions.at,viewport=posOptions.viewport,container=posOptions.container,adjust=posOptions.adjust,method=adjust.method.split(" "),tooltipWidth=tooltip.outerWidth(FALSE),tooltipHeight=tooltip.outerHeight(FALSE),targetWidth=0,targetHeight=0,type=tooltip.css("position"),position={left:0,top:0},visible=0<tooltip[0].offsetWidth,isScroll=event&&"scroll"===event.type,win=$(window),doc=container[0].ownerDocument,mouse=this.mouse;if($.isArray(target)&&2===target.length)at={x:LEFT,y:TOP},position={left:target[0],top:target[1]};else if("mouse"===target)at={x:LEFT,y:TOP},(!adjust.mouse||this.options.hide.distance)&&cache.origin&&cache.origin.pageX?event=cache.origin:!event||event&&("resize"===event.type||"scroll"===event.type)?event=cache.event:mouse&&mouse.pageX&&(event=mouse),"static"!==type&&(position=container.offset()),doc.body.offsetWidth!==(window.innerWidth||doc.documentElement.clientWidth)&&(offset=$(document.body).offset()),position={left:event.pageX-position.left+(offset&&offset.left||0),top:event.pageY-position.top+(offset&&offset.top||0)},adjust.mouse&&isScroll&&mouse&&(position.left-=(mouse.scrollX||0)-win.scrollLeft(),position.top-=(mouse.scrollY||0)-win.scrollTop());else{if("event"===target?event&&event.target&&"scroll"!==event.type&&"resize"!==event.type?cache.target=$(event.target):event.target||(cache.target=this.elements.target):"event"!==target&&(cache.target=$(target.jquery?target:this.elements.target)),target=cache.target,0===(target=$(target).eq(0)).length)return this;target[0]===document||target[0]===window?(targetWidth=BROWSER.iOS?window.innerWidth:target.width(),targetHeight=BROWSER.iOS?window.innerHeight:target.height(),target[0]===window&&(position={top:(viewport||target).scrollTop(),left:(viewport||target).scrollLeft()})):PLUGINS.imagemap&&target.is("area")?pluginCalculations=PLUGINS.imagemap(this,target,at,PLUGINS.viewport?method:FALSE):PLUGINS.svg&&target&&target[0].ownerSVGElement?pluginCalculations=PLUGINS.svg(this,target,at,PLUGINS.viewport?method:FALSE):(targetWidth=target.outerWidth(FALSE),targetHeight=target.outerHeight(FALSE),position=target.offset()),pluginCalculations&&(targetWidth=pluginCalculations.width,targetHeight=pluginCalculations.height,offset=pluginCalculations.offset,position=pluginCalculations.position),position=this.reposition.offset(target,position,container),(3.1<BROWSER.iOS&&BROWSER.iOS<4.1||4.3<=BROWSER.iOS&&BROWSER.iOS<4.33||!BROWSER.iOS&&"fixed"===type)&&(position.left-=win.scrollLeft(),position.top-=win.scrollTop()),(!pluginCalculations||pluginCalculations&&pluginCalculations.adjustable!==FALSE)&&(position.left+=at.x===RIGHT?targetWidth:at.x===CENTER?targetWidth/2:0,position.top+="bottom"===at.y?targetHeight:at.y===CENTER?targetHeight/2:0)}return position.left+=adjust.x+(my.x===RIGHT?-tooltipWidth:my.x===CENTER?-tooltipWidth/2:0),position.top+=adjust.y+("bottom"===my.y?-tooltipHeight:my.y===CENTER?-tooltipHeight/2:0),PLUGINS.viewport?(adjusted=position.adjusted=PLUGINS.viewport(this,position,posOptions,targetWidth,targetHeight,tooltipWidth,tooltipHeight),offset&&adjusted.left&&(position.left+=offset.left),offset&&adjusted.top&&(position.top+=offset.top),adjusted.my&&(this.position.my=adjusted.my)):position.adjusted={left:0,top:0},cache.posClass!==(newClass=this._createPosClass(this.position.my))&&tooltip.removeClass(cache.posClass).addClass(cache.posClass=newClass),this._trigger("move",[position,viewport.elem||viewport],event)&&(delete position.adjusted,effect===FALSE||!visible||isNaN(position.left)||isNaN(position.top)||"mouse"===target||!$.isFunction(posOptions.effect)?tooltip.css(position):$.isFunction(posOptions.effect)&&(posOptions.effect.call(tooltip,this,$.extend({},position)),tooltip.queue(function(next){$(this).css({opacity:"",height:""}),BROWSER.ie&&this.style.removeAttribute("filter"),next()})),this.positioning=FALSE),this},PROTOTYPE.reposition.offset=function(elem,pos,container){if(!container[0])return pos;var scrolled,position,parentOffset,overflow,ownerDocument=$(elem[0].ownerDocument),quirks=!!BROWSER.ie&&"CSS1Compat"!==document.compatMode,parent=container[0];function scroll(e,i){pos.left+=i*e.scrollLeft(),pos.top+=i*e.scrollTop()}for(;"static"!==(position=$.css(parent,"position"))&&("fixed"===position?(parentOffset=parent.getBoundingClientRect(),scroll(ownerDocument,-1)):((parentOffset=$(parent).position()).left+=parseFloat($.css(parent,"borderLeftWidth"))||0,parentOffset.top+=parseFloat($.css(parent,"borderTopWidth"))||0),pos.left-=parentOffset.left+(parseFloat($.css(parent,"marginLeft"))||0),pos.top-=parentOffset.top+(parseFloat($.css(parent,"marginTop"))||0),scrolled||"hidden"===(overflow=$.css(parent,"overflow"))||"visible"===overflow||(scrolled=$(parent))),parent=parent.offsetParent;);return scrolled&&(scrolled[0]!==ownerDocument[0]||quirks)&&scroll(scrolled,1),pos};var C=(CORNER=PROTOTYPE.reposition.Corner=function(corner,forceY){corner=(""+corner).replace(/([A-Z])/," $1").replace(/middle/gi,CENTER).toLowerCase(),this.x=(corner.match(/left|right/i)||corner.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(corner.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!forceY;var f=corner.charAt(0);this.precedance="t"===f||"b"===f?Y:X}).prototype;function createWidgetClass(cls){return WIDGET.concat("").join(cls?"-"+cls+" ":" ")}function delay(callback,duration){if(0<duration)return setTimeout($.proxy(callback,this),duration);callback.call(this)}function showMethod(event){this.tooltip.hasClass(CLASS_DISABLED)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=delay.call(this,function(){this.toggle(TRUE,event)},this.options.show.delay))}function hideMethod(event){if(!this.tooltip.hasClass(CLASS_DISABLED)&&!this.destroyed){var relatedTarget=$(event.relatedTarget),ontoTooltip=relatedTarget.closest(SELECTOR)[0]===this.tooltip[0],ontoTarget=relatedTarget[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==relatedTarget[0]&&"mouse"===this.options.position.target&&ontoTooltip||this.options.hide.fixed&&/mouse(out|leave|move)/.test(event.type)&&(ontoTooltip||ontoTarget))try{event.preventDefault(),event.stopImmediatePropagation()}catch(e){}else this.timers.hide=delay.call(this,function(){this.toggle(FALSE,event)},this.options.hide.delay,this)}}function inactiveMethod(event){!this.tooltip.hasClass(CLASS_DISABLED)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=delay.call(this,function(){this.hide(event)},this.options.hide.inactive))}function repositionMethod(event){this.rendered&&0<this.tooltip[0].offsetWidth&&this.reposition(event)}function delegate(selector,events,method){$(document.body).delegate(selector,(events.split?events:events.join("."+NAMESPACE+" "))+"."+NAMESPACE,function(){var api=QTIP.api[$.attr(this,ATTR_ID)];api&&!api.disabled&&method.apply(api,arguments)})}C.invert=function(z,center){this[z]=this[z]===LEFT?RIGHT:this[z]===RIGHT?LEFT:center||this[z]},C.string=function(join){var x=this.x,y=this.y,result=x!==y?"center"===x||"center"!==y&&(this.precedance===Y||this.forceY)?[y,x]:[x,y]:[x];return!1!==join?result.join(" "):result},C.abbrev=function(){var result=this.string(!1);return result[0].charAt(0)+(result[1]&&result[1].charAt(0)||"")},C.clone=function(){return new CORNER(this.string(),this.forceY)},PROTOTYPE.toggle=function(state,event){var cache=this.cache,options=this.options,tooltip=this.tooltip;if(event){if(/over|enter/.test(event.type)&&cache.event&&/out|leave/.test(cache.event.type)&&options.show.target.add(event.target).length===options.show.target.length&&tooltip.has(event.relatedTarget).length)return this;cache.event=$.event.fix(event)}if(this.waiting&&!state&&(this.hiddenDuringWait=TRUE),!this.rendered)return state?this.render(1):this;if(this.destroyed||this.disabled)return this;var identicalState,allow,after,type=state?"show":"hide",opts=this.options[type],posOptions=(this.options[state?"hide":"show"],this.options.position),contentOptions=this.options.content,width=this.tooltip.css("width"),visible=this.tooltip.is(":visible"),animate=state||1===opts.target.length,sameTarget=!event||opts.target.length<2||cache.target[0]===event.target;return(typeof state).search("boolean|number")&&(state=!visible),allow=(identicalState=!tooltip.is(":animated")&&visible===state&&sameTarget)?NULL:!!this._trigger(type,[90]),this.destroyed?this:(allow!==FALSE&&state&&this.focus(event),!allow||identicalState||($.attr(tooltip[0],"aria-hidden",!state),state?(this.mouse&&(cache.origin=$.event.fix(this.mouse)),$.isFunction(contentOptions.text)&&this._updateContent(contentOptions.text,FALSE),$.isFunction(contentOptions.title)&&this._updateTitle(contentOptions.title,FALSE),!trackingBound&&"mouse"===posOptions.target&&posOptions.adjust.mouse&&($(document).bind("mousemove."+NAMESPACE,this._storeMouse),trackingBound=TRUE),width||tooltip.css("width",tooltip.outerWidth(FALSE)),this.reposition(event,arguments[2]),width||tooltip.css("width",""),opts.solo&&("string"==typeof opts.solo?$(opts.solo):$(SELECTOR,opts.solo)).not(tooltip).not(opts.target).qtip("hide",$.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete cache.origin,trackingBound&&!$(SELECTOR+'[tracking="true"]:visible',opts.solo).not(tooltip).length&&($(document).unbind("mousemove."+NAMESPACE),trackingBound=FALSE),this.blur(event)),after=$.proxy(function(){state?(BROWSER.ie&&tooltip[0].style.removeAttribute("filter"),tooltip.css("overflow",""),"string"==typeof opts.autofocus&&$(this.options.show.autofocus,tooltip).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):tooltip.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(state?"visible":"hidden")},this),opts.effect===FALSE||animate===FALSE?(tooltip[type](),after()):$.isFunction(opts.effect)?(tooltip.stop(1,1),opts.effect.call(tooltip,this),tooltip.queue("fx",function(n){after(),n()})):tooltip.fadeTo(90,state?1:0,after),state&&opts.target.trigger("qtip-"+this.id+"-inactive")),this)},PROTOTYPE.show=function(event){return this.toggle(TRUE,event)},PROTOTYPE.hide=function(event){return this.toggle(FALSE,event)},PROTOTYPE.focus=function(event){if(!this.rendered||this.destroyed)return this;var qtips=$(SELECTOR),tooltip=this.tooltip,curIndex=parseInt(tooltip[0].style.zIndex,10),newIndex=QTIP.zindex+qtips.length;return tooltip.hasClass(CLASS_FOCUS)||this._trigger("focus",[newIndex],event)&&(curIndex!==newIndex&&(qtips.each(function(){this.style.zIndex>curIndex&&(this.style.zIndex=this.style.zIndex-1)}),qtips.filter("."+CLASS_FOCUS).qtip("blur",event)),tooltip.addClass(CLASS_FOCUS)[0].style.zIndex=newIndex),this},PROTOTYPE.blur=function(event){return!this.rendered||this.destroyed||(this.tooltip.removeClass(CLASS_FOCUS),this._trigger("blur",[this.tooltip.css("zIndex")],event)),this},PROTOTYPE.disable=function(state){return this.destroyed||("toggle"===state?state=!(this.rendered?this.tooltip.hasClass(CLASS_DISABLED):this.disabled):"boolean"!=typeof state&&(state=TRUE),this.rendered&&this.tooltip.toggleClass(CLASS_DISABLED,state).attr("aria-disabled",state),this.disabled=!!state),this},PROTOTYPE.enable=function(){return this.disable(FALSE)},PROTOTYPE._createButton=function(){var self=this,elements=this.elements,tooltip=elements.tooltip,button=this.options.content.button,close="string"==typeof button?button:"Close tooltip";elements.button&&elements.button.remove(),button.jquery?elements.button=button:elements.button=$("<a />",{class:"qtip-close "+(this.options.style.widget?"":NAMESPACE+"-icon"),title:close,"aria-label":close}).prepend($("<span />",{class:"ui-icon ui-icon-close",html:"&times;"})),elements.button.appendTo(elements.titlebar||tooltip).attr("role","button").click(function(event){return tooltip.hasClass(CLASS_DISABLED)||self.hide(event),FALSE})},PROTOTYPE._updateButton=function(button){if(!this.rendered)return FALSE;var elem=this.elements.button;button?this._createButton():elem.remove()},PROTOTYPE._setWidget=function(){var on=this.options.style.widget,elements=this.elements,tooltip=elements.tooltip,disabled=tooltip.hasClass(CLASS_DISABLED);tooltip.removeClass(CLASS_DISABLED),CLASS_DISABLED=on?"ui-state-disabled":"qtip-disabled",tooltip.toggleClass(CLASS_DISABLED,disabled),tooltip.toggleClass("ui-helper-reset "+createWidgetClass(),on).toggleClass(CLASS_DEFAULT,this.options.style.def&&!on),elements.content&&elements.content.toggleClass(createWidgetClass("content"),on),elements.titlebar&&elements.titlebar.toggleClass(createWidgetClass("header"),on),elements.button&&elements.button.toggleClass(NAMESPACE+"-icon",!on)},PROTOTYPE._storeMouse=function(event){return(this.mouse=$.event.fix(event)).type="mousemove",this},PROTOTYPE._bind=function(targets,events,method,suffix,context){if(targets&&method&&events.length){var ns="."+this._id+(suffix?"-"+suffix:"");return $(targets).bind((events.split?events:events.join(ns+" "))+ns,$.proxy(method,context||this)),this}},PROTOTYPE._unbind=function(targets,suffix){return targets&&$(targets).unbind("."+this._id+(suffix?"-"+suffix:"")),this},PROTOTYPE._trigger=function(type,args,event){var callback=$.Event("tooltip"+type);return callback.originalEvent=event&&$.extend({},event)||this.cache.event||NULL,this.triggering=type,this.tooltip.trigger(callback,[this].concat(args||[])),this.triggering=FALSE,!callback.isDefaultPrevented()},PROTOTYPE._bindEvents=function(showEvents,hideEvents,showTargets,hideTargets,showMethod,hideMethod){var similarTargets=showTargets.filter(hideTargets).add(hideTargets.filter(showTargets)),toggleEvents=[];similarTargets.length&&($.each(hideEvents,function(i,type){var showIndex=$.inArray(type,showEvents);-1<showIndex&&toggleEvents.push(showEvents.splice(showIndex,1)[0])}),toggleEvents.length&&(this._bind(similarTargets,toggleEvents,function(event){(!!this.rendered&&0<this.tooltip[0].offsetWidth?hideMethod:showMethod).call(this,event)}),showTargets=showTargets.not(similarTargets),hideTargets=hideTargets.not(similarTargets))),this._bind(showTargets,showEvents,showMethod),this._bind(hideTargets,hideEvents,hideMethod)},PROTOTYPE._assignInitialEvents=function(event){var options=this.options,showTarget=options.show.target,hideTarget=options.hide.target,showEvents=options.show.event?$.trim(""+options.show.event).split(" "):[],hideEvents=options.hide.event?$.trim(""+options.hide.event).split(" "):[];function hoverIntent(event){if(this.disabled||this.destroyed)return FALSE;this.cache.event=event&&$.event.fix(event),this.cache.target=event&&$(event.target),clearTimeout(this.timers.show),this.timers.show=delay.call(this,function(){this.render("object"==typeof event||options.show.ready)},options.prerender?0:options.show.delay)}this._bind(this.elements.target,["remove","removeqtip"],function(event){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(options.show.event)&&!/mouse(out|leave)/i.test(options.hide.event)&&hideEvents.push("mouseleave"),this._bind(showTarget,"mousemove",function(event){this._storeMouse(event),this.cache.onTarget=TRUE}),this._bindEvents(showEvents,hideEvents,showTarget,hideTarget,hoverIntent,function(){if(!this.timers)return FALSE;clearTimeout(this.timers.show)}),(options.show.ready||options.prerender)&&hoverIntent.call(this,event)},PROTOTYPE._assignEvents=function(){var self=this,options=this.options,posOptions=options.position,tooltip=this.tooltip,showTarget=options.show.target,hideTarget=options.hide.target,containerTarget=posOptions.container,viewportTarget=posOptions.viewport,documentTarget=$(document),windowTarget=($(document.body),$(window)),showEvents=options.show.event?$.trim(""+options.show.event).split(" "):[],hideEvents=options.hide.event?$.trim(""+options.hide.event).split(" "):[];$.each(options.events,function(name,callback){self._bind(tooltip,"toggle"===name?["tooltipshow","tooltiphide"]:["tooltip"+name],callback,null,tooltip)}),/mouse(out|leave)/i.test(options.hide.event)&&"window"===options.hide.leave&&this._bind(documentTarget,["mouseout","blur"],function(event){/select|option/.test(event.target.nodeName)||event.relatedTarget||this.hide(event)}),options.hide.fixed?hideTarget=hideTarget.add(tooltip.addClass(CLASS_FIXED)):/mouse(over|enter)/i.test(options.show.event)&&this._bind(hideTarget,"mouseleave",function(){clearTimeout(this.timers.show)}),-1<(""+options.hide.event).indexOf("unfocus")&&this._bind(containerTarget.closest("html"),["mousedown","touchstart"],function(event){var elem=$(event.target),enabled=this.rendered&&!this.tooltip.hasClass(CLASS_DISABLED)&&0<this.tooltip[0].offsetWidth,isAncestor=0<elem.parents(SELECTOR).filter(this.tooltip[0]).length;elem[0]===this.target[0]||elem[0]===this.tooltip[0]||isAncestor||this.target.has(elem[0]).length||!enabled||this.hide(event)}),"number"==typeof options.hide.inactive&&(this._bind(showTarget,"qtip-"+this.id+"-inactive",inactiveMethod,"inactive"),this._bind(hideTarget.add(tooltip),QTIP.inactiveEvents,inactiveMethod)),this._bindEvents(showEvents,hideEvents,showTarget,hideTarget,showMethod,hideMethod),this._bind(showTarget.add(tooltip),"mousemove",function(event){if("number"==typeof options.hide.distance){var origin=this.cache.origin||{},limit=this.options.hide.distance,abs=Math.abs;(abs(event.pageX-origin.pageX)>=limit||abs(event.pageY-origin.pageY)>=limit)&&this.hide(event)}this._storeMouse(event)}),"mouse"===posOptions.target&&posOptions.adjust.mouse&&(options.hide.event&&this._bind(showTarget,["mouseenter","mouseleave"],function(event){if(!this.cache)return FALSE;this.cache.onTarget="mouseenter"===event.type}),this._bind(documentTarget,"mousemove",function(event){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(CLASS_DISABLED)&&0<this.tooltip[0].offsetWidth&&this.reposition(event)})),(posOptions.adjust.resize||viewportTarget.length)&&this._bind($.event.special.resize?viewportTarget:windowTarget,"resize",repositionMethod),posOptions.adjust.scroll&&this._bind(windowTarget.add(posOptions.container),"scroll",repositionMethod)},PROTOTYPE._unassignEvents=function(){var options=this.options,showTargets=options.show.target,hideTargets=options.hide.target,targets=$.grep([this.elements.target[0],this.rendered&&this.tooltip[0],options.position.container[0],options.position.viewport[0],options.position.container.closest("html")[0],window,document],function(i){return"object"==typeof i});showTargets&&showTargets.toArray&&(targets=targets.concat(showTargets.toArray())),hideTargets&&hideTargets.toArray&&(targets=targets.concat(hideTargets.toArray())),this._unbind(targets)._unbind(targets,"destroy")._unbind(targets,"inactive")},$(function(){delegate(SELECTOR,["mouseenter","mouseleave"],function(event){var state="mouseenter"===event.type,tooltip=$(event.currentTarget),target=$(event.relatedTarget||event.target),options=this.options;state?(this.focus(event),tooltip.hasClass(CLASS_FIXED)&&!tooltip.hasClass(CLASS_DISABLED)&&clearTimeout(this.timers.hide)):"mouse"===options.position.target&&options.position.adjust.mouse&&options.hide.event&&options.show.target&&!target.closest(options.show.target[0]).length&&this.hide(event),tooltip.toggleClass(CLASS_HOVER,state)}),delegate("["+ATTR_ID+"]",INACTIVE_EVENTS,inactiveMethod)}),QTIP=$.fn.qtip=function(options,notation,newValue){var command=(""+options).toLowerCase(),returned=NULL,args=$.makeArray(arguments).slice(1),event=args[args.length-1],opts=this[0]?$.data(this[0],NAMESPACE):NULL;return!arguments.length&&opts||"api"===command?opts:"string"==typeof options?(this.each(function(){var api=$.data(this,NAMESPACE);if(!api)return TRUE;if(event&&event.timeStamp&&(api.cache.event=event),!notation||"option"!==command&&"options"!==command)api[command]&&api[command].apply(api,args);else{if(void 0===newValue&&!$.isPlainObject(notation))return returned=api.get(notation),FALSE;api.set(notation,newValue)}}),returned!==NULL?returned:this):"object"!=typeof options&&arguments.length?void 0:(opts=sanitizeOptions($.extend(TRUE,{},options)),this.each(function(i){var api,id;if(id=!(id=$.isArray(opts.id)?opts.id[i]:opts.id)||id===FALSE||id.length<1||QTIP.api[id]?QTIP.nextid++:id,(api=function(elem,id,opts){var obj,posOptions,attr,config,title,docBody=$(document.body),newTarget=elem[0]===document?docBody:elem,metadata=elem.metadata?elem.metadata(opts.metadata):NULL,metadata5="html5"===opts.metadata.type&&metadata?metadata[opts.metadata.name]:NULL,html5=elem.data(opts.metadata.name||"qtipopts");try{html5="string"==typeof html5?$.parseJSON(html5):html5}catch(e){}if(posOptions=(config=$.extend(TRUE,{},QTIP.defaults,opts,"object"==typeof html5?sanitizeOptions(html5):NULL,sanitizeOptions(metadata5||metadata))).position,config.id=id,"boolean"==typeof config.content.text){if(attr=elem.attr(config.content.attr),config.content.attr===FALSE||!attr)return FALSE;config.content.text=attr}if(posOptions.container.length||(posOptions.container=docBody),posOptions.target===FALSE&&(posOptions.target=newTarget),config.show.target===FALSE&&(config.show.target=newTarget),config.show.solo===TRUE&&(config.show.solo=posOptions.container.closest("body")),config.hide.target===FALSE&&(config.hide.target=newTarget),config.position.viewport===TRUE&&(config.position.viewport=posOptions.container),posOptions.container=posOptions.container.eq(0),posOptions.at=new CORNER(posOptions.at,TRUE),posOptions.my=new CORNER(posOptions.my),elem.data(NAMESPACE))if(config.overwrite)elem.qtip("destroy",!0);else if(config.overwrite===FALSE)return FALSE;return elem.attr("data-hasqtip",id),config.suppress&&(title=elem.attr("title"))&&elem.removeAttr("title").attr("oldtitle",title).attr("title",""),obj=new QTip(elem,config,id,!!attr),elem.data(NAMESPACE,obj),obj}($(this),id,opts))===FALSE)return TRUE;QTIP.api[id]=api,$.each(PLUGINS,function(){"initialize"===this.initialize&&this(api)}),api._assignInitialEvents(event)}))},$.qtip=QTip,QTIP.api={},$.each({attr:function(attr,val){if(this.length){var self=this[0],api=$.data(self,"qtip");if("title"===attr&&api&&"object"==typeof api&&api.options.suppress)return arguments.length<2?$.attr(self,"oldtitle"):(api&&"title"===api.options.content.attr&&api.cache.attr&&api.set("content.text",val),this.attr("oldtitle",val))}return $.fn.attr_replacedByqTip.apply(this,arguments)},clone:function(keepData){$([]);var elems=$.fn.clone_replacedByqTip.apply(this,arguments);return keepData||elems.filter("[oldtitle]").attr("title",function(){return $.attr(this,"oldtitle")}).removeAttr("oldtitle"),elems}},function(name,func){if(!func||$.fn[name+"_replacedByqTip"])return TRUE;var old=$.fn[name+"_replacedByqTip"]=$.fn[name];$.fn[name]=function(){return func.apply(this,arguments)||old.apply(this,arguments)}}),$.ui||($.cleanData_replacedByqTip=$.cleanData,$.cleanData=function(elems){for(var elem,i=0;(elem=$(elems[i])).length;i++)if(elem.attr("data-hasqtip"))try{elem.triggerHandler("removeqtip")}catch(e){}$.cleanData_replacedByqTip.apply(this,arguments)}),QTIP.version="2.2.1",QTIP.nextid=0,QTIP.inactiveEvents=INACTIVE_EVENTS,QTIP.zindex=15e3,QTIP.defaults={prerender:FALSE,id:FALSE,overwrite:TRUE,suppress:TRUE,content:{text:TRUE,attr:"title",title:FALSE,button:FALSE},position:{my:"top left",at:"bottom right",target:FALSE,container:FALSE,viewport:FALSE,adjust:{x:0,y:0,mouse:TRUE,scroll:TRUE,resize:TRUE,method:"flipinvert flipinvert"},effect:function(api,pos,viewport){$(this).animate(pos,{duration:200,queue:FALSE})}},show:{target:FALSE,event:"mouseenter",effect:TRUE,delay:90,solo:FALSE,ready:FALSE,autofocus:FALSE},hide:{target:FALSE,event:"mouseleave",effect:TRUE,delay:0,fixed:FALSE,inactive:FALSE,leave:"window",distance:FALSE},style:{classes:"",widget:FALSE,width:FALSE,height:FALSE,def:TRUE},events:{render:NULL,move:NULL,show:NULL,hide:NULL,toggle:NULL,visible:NULL,hidden:NULL,focus:NULL,blur:NULL}};var TIP,BG_COLOR="background-color",HASCANVAS=!!document.createElement("canvas").getContext,INVALID=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i;function camel(s){return s.charAt(0).toUpperCase()+s.slice(1)}var context,cssProps={},cssPrefixes=["Webkit","O","Moz","ms"];function intCss(elem,prop){return Math.ceil(parseFloat(function(elem,prop){var cur,val,ucProp=prop.charAt(0).toUpperCase()+prop.slice(1),props=(prop+" "+cssPrefixes.join(ucProp+" ")+ucProp).split(" "),i=0;if(cssProps[prop])return elem.css(cssProps[prop]);for(;cur=props[i++];)if(void 0!==(val=elem.css(cur)))return cssProps[prop]=cur,val}(elem,prop)))}if(HASCANVAS)var SCALE=(window.devicePixelRatio||1)/((context=document.createElement("canvas").getContext("2d")).backingStorePixelRatio||context.webkitBackingStorePixelRatio||context.mozBackingStorePixelRatio||context.msBackingStorePixelRatio||context.oBackingStorePixelRatio||1);else var createVML=function(tag,props,style){return"<qtipvml:"+tag+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(props||"")+' style="behavior: url(#default#VML); '+(style||"")+'" />'};function Tip(qtip,options){this._ns="tip",this.options=options,this.offset=options.offset,this.size=[options.width,options.height],this.init(this.qtip=qtip)}$.extend(Tip.prototype,{init:function(qtip){var context,tip;tip=this.element=qtip.elements.tip=$("<div />",{class:NAMESPACE+"-tip"}).prependTo(qtip.tooltip),HASCANVAS?((context=$("<canvas />").appendTo(this.element)[0].getContext("2d")).lineJoin="miter",context.miterLimit=1e5,context.save()):(context=createVML("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(context+context),qtip._bind($("*",tip).add(tip),["click","mousedown"],function(event){event.stopPropagation()},this._ns)),qtip._bind(qtip.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(corner){var titlebar=this.qtip.elements.titlebar;return titlebar&&(corner.y===TOP||corner.y===CENTER&&this.element.position().top+this.size[1]/2+this.options.offset<titlebar.outerHeight(TRUE))},_parseCorner:function(corner){var my=this.qtip.options.position.my;return corner===FALSE||my===FALSE?corner=FALSE:corner===TRUE?corner=new CORNER(my.string()):corner.string||((corner=new CORNER(corner)).fixed=TRUE),corner},_parseWidth:function(corner,side,use){var elements=this.qtip.elements,prop="border"+camel(side)+"Width";return(use?intCss(use,prop):intCss(elements.content,prop)||intCss(this._useTitle(corner)&&elements.titlebar||elements.content,prop)||intCss(elements.tooltip,prop))||0},_parseRadius:function(corner){var elements=this.qtip.elements,prop="border"+camel(corner.y)+camel(corner.x)+"Radius";return BROWSER.ie<9?0:intCss(this._useTitle(corner)&&elements.titlebar||elements.content,prop)||intCss(elements.tooltip,prop)||0},_invalidColour:function(elem,prop,compare){var val=elem.css(prop);return!val||compare&&val===elem.css(compare)||INVALID.test(val)?FALSE:val},_parseColours:function(corner){var elements=this.qtip.elements,tip=this.element.css("cssText",""),borderSide="border"+camel(corner[corner.precedance])+camel("color"),colorElem=this._useTitle(corner)&&elements.titlebar||elements.content,css=this._invalidColour,color=[];return color[0]=css(tip,BG_COLOR)||css(colorElem,BG_COLOR)||css(elements.content,BG_COLOR)||css(elements.tooltip,BG_COLOR)||tip.css(BG_COLOR),color[1]=css(tip,borderSide,"color")||css(colorElem,borderSide,"color")||css(elements.content,borderSide,"color")||css(elements.tooltip,borderSide,"color")||elements.tooltip.css(borderSide),$("*",tip).add(tip).css("cssText",BG_COLOR+":transparent !important;border:0 !important;"),color},_calculateSize:function(corner){var ratio,result,y=corner.precedance===Y,width=this.options.width,height=this.options.height,isCenter="c"===corner.abbrev(),base=(y?width:height)*(isCenter?.5:1),pow=Math.pow,round=Math.round,smallHyp=Math.sqrt(pow(base,2)+pow(height,2)),hyp=[this.border/base*smallHyp,this.border/height*smallHyp];return hyp[2]=Math.sqrt(pow(hyp[0],2)-pow(this.border,2)),hyp[3]=Math.sqrt(pow(hyp[1],2)-pow(this.border,2)),result=[round((ratio=(smallHyp+hyp[2]+hyp[3]+(isCenter?0:hyp[0]))/smallHyp)*width),round(ratio*height)],y?result:result.reverse()},_calculateTip:function(corner,size,scale){scale=scale||1;var width=(size=size||this.size)[0]*scale,height=size[1]*scale,width2=Math.ceil(width/2),height2=Math.ceil(height/2),tips={br:[0,0,width,height,width,0],bl:[0,0,width,0,0,height],tr:[0,height,width,0,width,height],tl:[0,0,0,height,width,height],tc:[0,height,width2,0,width,height],bc:[0,0,width,0,width2,height],rc:[0,0,width,height2,0,height],lc:[width,0,width,height,0,height2]};return tips.lt=tips.br,tips.rt=tips.bl,tips.lb=tips.tr,tips.rb=tips.tl,tips[corner.abbrev()]},_drawCoords:function(context,coords){context.beginPath(),context.moveTo(coords[0],coords[1]),context.lineTo(coords[2],coords[3]),context.lineTo(coords[4],coords[5]),context.closePath()},create:function(){var c=this.corner=(HASCANVAS||BROWSER.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=c.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(corner,position){if(!this.enabled)return this;var color,precedance,context,coords,bigCoords,translate,newSize,border,elements=this.qtip.elements,tip=this.element,inner=tip.children(),options=this.options,curSize=this.size,mimic=options.mimic,round=Math.round;corner||(corner=this.qtip.cache.corner||this.corner),mimic===FALSE?mimic=corner:((mimic=new CORNER(mimic)).precedance=corner.precedance,"inherit"===mimic.x?mimic.x=corner.x:"inherit"===mimic.y?mimic.y=corner.y:mimic.x===mimic.y&&(mimic[corner.precedance]=corner[corner.precedance])),precedance=mimic.precedance,corner.precedance===X?this._swapDimensions():this._resetDimensions(),"transparent"!==(color=this.color=this._parseColours(corner))[1]?(border=this.border=this._parseWidth(corner,corner[corner.precedance]),options.border&&border<1&&!INVALID.test(color[1])&&(color[0]=color[1]),this.border=border=options.border!==TRUE?options.border:border):this.border=border=0,newSize=this.size=this._calculateSize(corner),tip.css({width:newSize[0],height:newSize[1],lineHeight:newSize[1]+"px"}),translate=corner.precedance===Y?[round(mimic.x===LEFT?border:mimic.x===RIGHT?newSize[0]-curSize[0]-border:(newSize[0]-curSize[0])/2),round(mimic.y===TOP?newSize[1]-curSize[1]:0)]:[round(mimic.x===LEFT?newSize[0]-curSize[0]:0),round(mimic.y===TOP?border:"bottom"===mimic.y?newSize[1]-curSize[1]-border:(newSize[1]-curSize[1])/2)],HASCANVAS?((context=inner[0].getContext("2d")).restore(),context.save(),context.clearRect(0,0,6e3,6e3),coords=this._calculateTip(mimic,curSize,SCALE),bigCoords=this._calculateTip(mimic,this.size,SCALE),inner.attr(WIDTH,newSize[0]*SCALE).attr("height",newSize[1]*SCALE),inner.css(WIDTH,newSize[0]).css("height",newSize[1]),this._drawCoords(context,bigCoords),context.fillStyle=color[1],context.fill(),context.translate(translate[0]*SCALE,translate[1]*SCALE),this._drawCoords(context,coords),context.fillStyle=color[0],context.fill()):(coords="m"+(coords=this._calculateTip(mimic))[0]+","+coords[1]+" l"+coords[2]+","+coords[3]+" "+coords[4]+","+coords[5]+" xe",translate[2]=border&&/^(r|b)/i.test(corner.string())?8===BROWSER.ie?2:1:0,inner.css({coordsize:newSize[0]+border+" "+(newSize[1]+border),antialias:""+(-1<mimic.string().indexOf(CENTER)),left:translate[0]-translate[2]*Number(precedance===X),top:translate[1]-translate[2]*Number(precedance===Y),width:newSize[0]+border,height:newSize[1]+border}).each(function(i){var $this=$(this);$this[$this.prop?"prop":"attr"]({coordsize:newSize[0]+border+" "+(newSize[1]+border),path:coords,fillcolor:color[0],filled:!!i,stroked:!i}).toggle(!(!border&&!i)),!i&&$this.html(createVML("stroke",'weight="'+2*border+'px" color="'+color[1]+'" miterlimit="1000" joinstyle="miter"'))})),window.opera&&setTimeout(function(){elements.tip.css({display:"inline-block",visibility:"visible"})},1),position!==FALSE&&this.calculate(corner,newSize)},calculate:function(corner,size){if(!this.enabled)return FALSE;var precedance,corners,self=this,elements=this.qtip.elements,tip=this.element,userOffset=this.options.offset,position=(elements.tooltip.hasClass("ui-widget"),{});return corner=corner||this.corner,precedance=corner.precedance,size=size||this._calculateSize(corner),corners=[corner.x,corner.y],precedance===X&&corners.reverse(),$.each(corners,function(i,side){var b,bc,br;side===CENTER?(position[b=precedance===Y?LEFT:TOP]="50%",position["margin-"+b]=-Math.round(size[precedance===Y?0:1]/2)+userOffset):(b=self._parseWidth(corner,side,elements.tooltip),bc=self._parseWidth(corner,side,elements.content),br=self._parseRadius(corner),position[side]=Math.max(-self.border,i?bc:userOffset+(b<br?br:-b)))}),position[corner[precedance]]-=size[precedance===X?0:1],tip.css({margin:"",top:"",bottom:"",left:"",right:""}).css(position),position},reposition:function(event,api,pos,viewport){if(this.enabled){var offset,props,cache=api.cache,newCorner=this.corner.clone(),adjust=pos.adjusted,method=api.options.position.adjust.method.split(" "),horizontal=method[0],vertical=method[1]||method[0],shift={left:FALSE,top:FALSE,x:0,y:0},css={};this.corner.fixed!==TRUE&&(shiftflip(horizontal,X,Y,LEFT,RIGHT),shiftflip(vertical,Y,X,TOP,"bottom"),newCorner.string()===cache.corner.string()&&cache.cornerTop===adjust.top&&cache.cornerLeft===adjust.left||this.update(newCorner,FALSE)),void 0!==(offset=this.calculate(newCorner)).right&&(offset.left=-offset.right),void 0!==offset.bottom&&(offset.top=-offset.bottom),offset.user=this.offset,(shift.left="shift"===horizontal&&!!adjust.left)&&shiftonly(X,LEFT,RIGHT),(shift.top="shift"===vertical&&!!adjust.top)&&shiftonly(Y,TOP,"bottom"),this.element.css(css).toggle(!(shift.x&&shift.y||newCorner.x===CENTER&&shift.y||newCorner.y===CENTER&&shift.x)),pos.left-=offset.left.charAt?offset.user:"shift"!==horizontal||shift.top||!shift.left&&!shift.top?offset.left+this.border:0,pos.top-=offset.top.charAt?offset.user:"shift"!==vertical||shift.left||!shift.left&&!shift.top?offset.top+this.border:0,cache.cornerLeft=adjust.left,cache.cornerTop=adjust.top,cache.corner=newCorner.clone()}function shiftflip(direction,precedance,popposite,side,opposite){"shift"===direction&&newCorner.precedance===precedance&&adjust[side]&&newCorner[popposite]!==CENTER?newCorner.precedance=newCorner.precedance===X?Y:X:"shift"!==direction&&adjust[side]&&(newCorner[precedance]=newCorner[precedance]===CENTER?0<adjust[side]?side:opposite:newCorner[precedance]===side?opposite:side)}function shiftonly(xy,side,opposite){newCorner[xy]===CENTER?css["margin-"+side]=shift[xy]=offset["margin-"+side]-adjust[side]:(props=void 0!==offset[opposite]?[adjust[side],-offset[side]]:[-adjust[side],offset[side]],(shift[xy]=Math.max(props[0],props[1]))>props[0]&&(pos[side]-=adjust[side],shift[side]=FALSE),css[void 0!==offset[opposite]?opposite:side]=shift[xy])}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),(TIP=PLUGINS.tip=function(api){return new Tip(api,api.options.style.tip)}).initialize="render",TIP.sanitize=function(options){if(options.style&&"tip"in options.style){var opts=options.style.tip;"object"!=typeof opts&&(opts=options.style.tip={corner:opts}),/string|boolean/i.test(typeof opts.corner)||(opts.corner=TRUE)}},CHECKS.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(obj){this.size=[obj.width,obj.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},$.extend(TRUE,QTIP.defaults,{style:{tip:{corner:TRUE,mimic:FALSE,width:6,height:6,border:TRUE,offset:0}}});var MODAL,OVERLAY;function Modal(api,options){this.options=options,this._ns="-modal",this.init(this.qtip=api)}OVERLAY=new(OVERLAY=function(){var current,prevState,elem,self=this,focusableElems={};function focusInputs(blurElems){focusableElems.length<1&&blurElems.length?blurElems.not("body").blur():focusableElems.first().focus()}function stealFocus(event){if(elem.is(":visible")){var target=$(event.target),tooltip=current.tooltip,container=target.closest(SELECTOR);(container.length<1?FALSE:parseInt(container[0].style.zIndex,10)>parseInt(tooltip[0].style.zIndex,10))||target.closest(SELECTOR)[0]===tooltip[0]||focusInputs(target),event.target===focusableElems[focusableElems.length-1]}}$.extend(self,{init:function(){return elem=self.elem=$("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return FALSE}}).hide(),$(document.body).bind("focusin.qtip-modal",stealFocus),$(document).bind("keydown.qtip-modal",function(event){current&&current.options.show.modal.escape&&27===event.keyCode&&current.hide(event)}),elem.bind("click.qtip-modal",function(event){current&&current.options.show.modal.blur&&current.hide(event)}),self},update:function(api){focusableElems=(current=api).options.show.modal.stealfocus!==FALSE?api.tooltip.find("*").filter(function(){return function(element){if($.expr[":"].focusable)return $.expr[":"].focusable;var map,mapName,img,isTabIndexNotNaN=!isNaN($.attr(element,"tabindex")),nodeName=element.nodeName&&element.nodeName.toLowerCase();return"area"===nodeName?(mapName=(map=element.parentNode).name,!(!element.href||!mapName||"map"!==map.nodeName.toLowerCase())&&!!(img=$("img[usemap=#"+mapName+"]")[0])&&img.is(":visible")):/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName&&element.href||isTabIndexNotNaN}(this)}):[]},toggle:function(api,state,duration){$(document.body);var tooltip=api.tooltip,options=api.options.show.modal,effect=options.effect,type=state?"show":"hide",visible=elem.is(":visible"),visibleModals=$(".qtip-modal").filter(":visible:not(:animated)").not(tooltip);return self.update(api),state&&options.stealfocus!==FALSE&&focusInputs($(":focus")),elem.toggleClass("blurs",options.blur),state&&elem.appendTo(document.body),elem.is(":animated")&&visible===state&&prevState!==FALSE||!state&&visibleModals.length||(elem.stop(TRUE,FALSE),$.isFunction(effect)?effect.call(elem,state):effect===FALSE?elem[type]():elem.fadeTo(parseInt(duration,10)||90,state?1:0,function(){state||elem.hide()}),state||elem.queue(function(next){elem.css({left:"",top:""}),$(".qtip-modal").length||elem.detach(),next()}),prevState=state,current.destroyed&&(current=NULL)),self}}),self.init()}),$.extend(Modal.prototype,{init:function(qtip){var tooltip=qtip.tooltip;if(!this.options.on)return this;qtip.elements.overlay=OVERLAY.elem,tooltip.addClass("qtip-modal").css("z-index",QTIP.modal_zindex+$(".qtip-modal").length),qtip._bind(tooltip,["tooltipshow","tooltiphide"],function(event,api,duration){var oEvent=event.originalEvent;if(event.target===tooltip[0])if(oEvent&&"tooltiphide"===event.type&&/mouse(leave|enter)/.test(oEvent.type)&&$(oEvent.relatedTarget).closest(OVERLAY.elem[0]).length)try{event.preventDefault()}catch(e){}else(!oEvent||oEvent&&"tooltipsolo"!==oEvent.type)&&this.toggle(event,"tooltipshow"===event.type,duration)},this._ns,this),qtip._bind(tooltip,"tooltipfocus",function(event,api){if(!event.isDefaultPrevented()&&event.target===tooltip[0]){var qtips=$(".qtip-modal"),newIndex=QTIP.modal_zindex+qtips.length,curIndex=parseInt(tooltip[0].style.zIndex,10);OVERLAY.elem[0].style.zIndex=newIndex-1,qtips.each(function(){this.style.zIndex>curIndex&&(this.style.zIndex-=1)}),qtips.filter("."+CLASS_FOCUS).qtip("blur",event.originalEvent),tooltip.addClass(CLASS_FOCUS)[0].style.zIndex=newIndex,OVERLAY.update(api);try{event.preventDefault()}catch(e){}}},this._ns,this),qtip._bind(tooltip,"tooltiphide",function(event){event.target===tooltip[0]&&$(".qtip-modal").filter(":visible").not(tooltip).last().qtip("focus",event)},this._ns,this)},toggle:function(event,state,duration){if(event&&event.isDefaultPrevented())return this;OVERLAY.toggle(this.qtip,!!state,duration)},destroy:function(){this.qtip.tooltip.removeClass("qtip-modal"),this.qtip._unbind(this.qtip.tooltip,this._ns),OVERLAY.toggle(this.qtip,FALSE),delete this.qtip.elements.overlay}}),(MODAL=PLUGINS.modal=function(api){return new Modal(api,api.options.show.modal)}).sanitize=function(opts){opts.show&&("object"!=typeof opts.show.modal?opts.show.modal={on:!!opts.show.modal}:void 0===opts.show.modal.on&&(opts.show.modal.on=TRUE))},QTIP.modal_zindex=QTIP.zindex-200,MODAL.initialize="render",CHECKS.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(0<this.qtip.tooltip[0].offsetWidth)}},$.extend(TRUE,QTIP.defaults,{show:{modal:{on:FALSE,effect:TRUE,blur:TRUE,stealfocus:TRUE,escape:TRUE}}}),PLUGINS.viewport=function(api,position,posOptions,targetWidth,targetHeight,elemWidth,elemHeight){var fixed,newMy,containerOffset,containerStatic,viewportWidth,viewportHeight,viewportScroll,viewportOffset,target=posOptions.target,tooltip=api.elements.tooltip,my=posOptions.my,at=posOptions.at,adjust=posOptions.adjust,method=adjust.method.split(" "),methodX=method[0],methodY=method[1]||method[0],viewport=posOptions.viewport,container=posOptions.container,adjusted=(api.cache,{left:0,top:0});if(!viewport.jquery||target[0]===window||target[0]===document.body||"none"===adjust.method)return adjusted;function calculate(side,otherSide,type,adjust,side1,side2,lengthName,targetLength,elemLength){var initialPos=position[side1],mySide=my[side],atSide=at[side],isShift="shift"===type,myLength=mySide===side1?elemLength:mySide===side2?-elemLength:-elemLength/2,atLength=atSide===side1?targetLength:atSide===side2?-targetLength:-targetLength/2,sideOffset=viewportScroll[side1]+viewportOffset[side1]-(containerStatic?0:containerOffset[side1]),overflow1=sideOffset-initialPos,overflow2=initialPos+elemLength-(lengthName===WIDTH?viewportWidth:viewportHeight)-sideOffset,offset=myLength-(my.precedance===side||mySide===my[otherSide]?atLength:0)-(atSide===CENTER?targetLength/2:0);return isShift?(offset=(mySide===side1?1:-1)*myLength,position[side1]+=0<overflow1?overflow1:0<overflow2?-overflow2:0,position[side1]=Math.max(-containerOffset[side1]+viewportOffset[side1],initialPos-offset,Math.min(Math.max(-containerOffset[side1]+viewportOffset[side1]+(lengthName===WIDTH?viewportWidth:viewportHeight),initialPos+offset),position[side1],"center"===mySide?initialPos-myLength:1e9))):(adjust*="flipinvert"===type?2:0,0<overflow1&&(mySide!==side1||0<overflow2)?(position[side1]-=offset+adjust,newMy.invert(side,side1)):0<overflow2&&(mySide!==side2||0<overflow1)&&(position[side1]-=(mySide===CENTER?-offset:offset)+adjust,newMy.invert(side,side2)),position[side1]<viewportScroll&&-position[side1]>overflow2&&(position[side1]=initialPos,newMy=my.clone())),position[side1]-initialPos}return containerOffset=container.offset()||adjusted,containerStatic="static"===container.css("position"),fixed="fixed"===tooltip.css("position"),viewportWidth=viewport[0]===window?viewport.width():viewport.outerWidth(FALSE),viewportHeight=viewport[0]===window?viewport.height():viewport.outerHeight(FALSE),viewportScroll={left:fixed?0:viewport.scrollLeft(),top:fixed?0:viewport.scrollTop()},viewportOffset=viewport.offset()||adjusted,"shift"===methodX&&"shift"===methodY||(newMy=my.clone()),adjusted={left:"none"!==methodX?calculate(X,Y,methodX,adjust.x,LEFT,RIGHT,WIDTH,targetWidth,elemWidth):0,top:"none"!==methodY?calculate(Y,X,methodY,adjust.y,TOP,"bottom","height",targetHeight,elemHeight):0,my:newMy}},PLUGINS.polys={polygon:function(baseCoords,corner){var next,newWidth,newHeight,result={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:FALSE},i=0,coords=[],compareX=1,compareY=1,realX=0,realY=0;for(i=baseCoords.length;i--;)(next=[parseInt(baseCoords[--i],10),parseInt(baseCoords[i+1],10)])[0]>result.position.right&&(result.position.right=next[0]),next[0]<result.position.left&&(result.position.left=next[0]),next[1]>result.position.bottom&&(result.position.bottom=next[1]),next[1]<result.position.top&&(result.position.top=next[1]),coords.push(next);if(newWidth=result.width=Math.abs(result.position.right-result.position.left),newHeight=result.height=Math.abs(result.position.bottom-result.position.top),"c"===corner.abbrev())result.position={left:result.position.left+result.width/2,top:result.position.top+result.height/2};else{for(;0<newWidth&&0<newHeight&&0<compareX&&0<compareY;)for(newWidth=Math.floor(newWidth/2),newHeight=Math.floor(newHeight/2),corner.x===LEFT?compareX=newWidth:corner.x===RIGHT?compareX=result.width-newWidth:compareX+=Math.floor(newWidth/2),corner.y===TOP?compareY=newHeight:"bottom"===corner.y?compareY=result.height-newHeight:compareY+=Math.floor(newHeight/2),i=coords.length;i--&&!(coords.length<2);)realX=coords[i][0]-result.position.left,realY=coords[i][1]-result.position.top,(corner.x===LEFT&&compareX<=realX||corner.x===RIGHT&&realX<=compareX||corner.x===CENTER&&(realX<compareX||realX>result.width-compareX)||corner.y===TOP&&compareY<=realY||"bottom"===corner.y&&realY<=compareY||corner.y===CENTER&&(realY<compareY||realY>result.height-compareY))&&coords.splice(i,1);result.position={left:coords[0][0],top:coords[0][1]}}return result},rect:function(ax,ay,bx,by){return{width:Math.abs(bx-ax),height:Math.abs(by-ay),position:{left:Math.min(ax,bx),top:Math.min(ay,by)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(cx,cy,rx,ry,corner){var c=PLUGINS.polys._angles[corner.abbrev()],rxc=0===c?0:rx*Math.cos(c*Math.PI),rys=ry*Math.sin(c*Math.PI);return{width:2*rx-Math.abs(rxc),height:2*ry-Math.abs(rys),position:{left:cx+rxc,top:cy+rys},adjustable:FALSE}},circle:function(cx,cy,r,corner){return PLUGINS.polys.ellipse(cx,cy,r,r,corner)}},PLUGINS.svg=function(api,svg,corner){$(document);for(var frameOffset,mtx,transformed,len,next,i,points,result,position,elem=svg[0],root=$(elem.ownerSVGElement),ownerDocument=elem.ownerDocument,strokeWidth2=(parseInt(svg.css("stroke-width"),10)||0)/2;!elem.getBBox;)elem=elem.parentNode;if(!elem.getBBox||!elem.parentNode)return FALSE;switch(elem.nodeName){case"ellipse":case"circle":result=PLUGINS.polys.ellipse(elem.cx.baseVal.value,elem.cy.baseVal.value,(elem.rx||elem.r).baseVal.value+strokeWidth2,(elem.ry||elem.r).baseVal.value+strokeWidth2,corner);break;case"line":case"polygon":case"polyline":for(result=[],i=-1,len=(points=elem.points||[{x:elem.x1.baseVal.value,y:elem.y1.baseVal.value},{x:elem.x2.baseVal.value,y:elem.y2.baseVal.value}]).numberOfItems||points.length;++i<len;)next=points.getItem?points.getItem(i):points[i],result.push.apply(result,[next.x,next.y]);result=PLUGINS.polys.polygon(result,corner);break;default:result={width:(result=elem.getBBox()).width,height:result.height,position:{left:result.x,top:result.y}}}return position=result.position,(root=root[0]).createSVGPoint&&(mtx=elem.getScreenCTM(),(points=root.createSVGPoint()).x=position.left,points.y=position.top,transformed=points.matrixTransform(mtx),position.left=transformed.x,position.top=transformed.y),ownerDocument!==document&&"mouse"!==api.position.target&&(frameOffset=$((ownerDocument.defaultView||ownerDocument.parentWindow).frameElement).offset())&&(position.left+=frameOffset.left,position.top+=frameOffset.top),ownerDocument=$(ownerDocument),position.left+=ownerDocument.scrollLeft(),position.top+=ownerDocument.scrollTop(),result},PLUGINS.imagemap=function(api,area,corner,adjustMethod){area.jquery||(area=$(area));var imageOffset,coords,i,result,len,shape=(area.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),image=$('img[usemap="#'+area.parent("map").attr("name")+'"]'),coordsArray=$.trim(area.attr("coords")).replace(/,$/,"").split(",");if(!image.length)return FALSE;if("polygon"===shape)result=PLUGINS.polys.polygon(coordsArray,corner);else{if(!PLUGINS.polys[shape])return FALSE;for(i=-1,len=coordsArray.length,coords=[];++i<len;)coords.push(parseInt(coordsArray[i],10));result=PLUGINS.polys[shape].apply(this,coords.concat(corner))}return(imageOffset=image.offset()).left+=Math.ceil((image.outerWidth(FALSE)-image.width())/2),imageOffset.top+=Math.ceil((image.outerHeight(FALSE)-image.height())/2),result.position.left+=imageOffset.left,result.position.top+=imageOffset.top,result};function Ie6(api,qtip){this._ns="ie6",this.init(this.qtip=api)}$.extend(Ie6.prototype,{_scroll:function(){var overlay=this.qtip.elements.overlay;overlay&&(overlay[0].style.top=$(window).scrollTop()+"px")},init:function(qtip){var tooltip=qtip.tooltip;$("select, object").length<1&&(this.bgiframe=qtip.elements.bgiframe=$('<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>').appendTo(tooltip),qtip._bind(tooltip,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=$("<div/>",{id:NAMESPACE+"-rcontainer"}).appendTo(document.body),qtip.elements.overlay&&qtip.elements.overlay.addClass("qtipmodal-ie6fix")&&(qtip._bind(window,["scroll","resize"],this._scroll,this._ns,this),qtip._bind(tooltip,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var tipAdjust,offset,tooltip=this.qtip.tooltip,dimensions={height:tooltip.outerHeight(FALSE),width:tooltip.outerWidth(FALSE)},plugin=this.qtip.plugins.tip,tip=this.qtip.elements.tip;offset={left:-(offset=parseInt(tooltip.css("borderLeftWidth"),10)||0),top:-offset},plugin&&tip&&(offset[(tipAdjust="x"===plugin.corner.precedance?[WIDTH,LEFT]:["height",TOP])[1]]-=tip[tipAdjust[0]]()),this.bgiframe.css(offset).css(dimensions)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var perc,width,max,min,tooltip=this.qtip.tooltip,style=this.qtip.options.style,container=this.qtip.options.position.container;return this.qtip.drawing=1,style.height&&tooltip.css("height",style.height),style.width?tooltip.css(WIDTH,style.width):(tooltip.css(WIDTH,"").appendTo(this.redrawContainer),(width=tooltip.width())%2<1&&(width+=1),perc=-1<((max=tooltip.css("maxWidth")||"")+(min=tooltip.css("minWidth")||"")).indexOf("%")?container.width()/100:0,width=(max=(-1<max.indexOf("%")?perc:1)*parseInt(max,10)||width)+(min=(-1<min.indexOf("%")?perc:1)*parseInt(min,10)||0)?Math.min(Math.max(width,min),max):width,tooltip.css(WIDTH,Math.round(width)).appendTo(container)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([window,this.qtip.tooltip],this._ns)}}),(PLUGINS.ie6=function(api){return 6===BROWSER.ie?new Ie6(api):FALSE}).initialize="render",CHECKS.ie6={"^content|style$":function(){this.redraw()}}})}(window,document),function(window,undefined){var jq_throttle,$=jQuery||window.Cowboy||(window.Cowboy={});$.throttle=jq_throttle=function(delay,no_trailing,callback,debounce_mode){var timeout_id,last_exec=0;function wrapper(){var that=this,elapsed=+new Date-last_exec,args=arguments;function exec(){last_exec=+new Date,callback.apply(that,args)}debounce_mode&&!timeout_id&&exec(),timeout_id&&clearTimeout(timeout_id),void 0===debounce_mode&&delay<elapsed?exec():!0!==no_trailing&&(timeout_id=setTimeout(debounce_mode?function(){timeout_id=void 0}:exec,void 0===debounce_mode?delay-elapsed:delay))}return"boolean"!=typeof no_trailing&&(debounce_mode=callback,callback=no_trailing,no_trailing=void 0),$.guid&&(wrapper.guid=callback.guid=callback.guid||$.guid++),wrapper},$.debounce=function(delay,at_begin,callback){return void 0===callback?jq_throttle(delay,at_begin,!1):jq_throttle(delay,callback,!1!==at_begin)}}(this),factory=function(jQuery){"use strict";function uaMatch(ua){ua===undefined&&(ua=window.navigator.userAgent),ua=ua.toLowerCase();var match=/(edge)\/([\w.]+)/.exec(ua)||/(opr)[\/]([\w.]+)/.exec(ua)||/(chrome)[ \/]([\w.]+)/.exec(ua)||/(iemobile)[\/]([\w.]+)/.exec(ua)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||0<=ua.indexOf("trident")&&/(rv)(?::| )([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[],platform_match=/(ipad)/.exec(ua)||/(ipod)/.exec(ua)||/(windows phone)/.exec(ua)||/(iphone)/.exec(ua)||/(kindle)/.exec(ua)||/(silk)/.exec(ua)||/(android)/.exec(ua)||/(win)/.exec(ua)||/(mac)/.exec(ua)||/(linux)/.exec(ua)||/(cros)/.exec(ua)||/(playbook)/.exec(ua)||/(bb)/.exec(ua)||/(blackberry)/.exec(ua)||[],browser={},matched={browser:match[5]||match[3]||match[1]||"",version:match[2]||match[4]||"0",versionNumber:match[4]||match[2]||"0",platform:platform_match[0]||""};if(matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version,browser.versionNumber=parseInt(matched.versionNumber,10)),matched.platform&&(browser[matched.platform]=!0),(browser.android||browser.bb||browser.blackberry||browser.ipad||browser.iphone||browser.ipod||browser.kindle||browser.playbook||browser.silk||browser["windows phone"])&&(browser.mobile=!0),(browser.cros||browser.mac||browser.linux||browser.win)&&(browser.desktop=!0),(browser.chrome||browser.opr||browser.safari)&&(browser.webkit=!0),browser.rv||browser.iemobile){matched.browser="msie",browser.msie=!0}if(browser.edge){delete browser.edge;matched.browser="msedge",browser.msedge=!0}if(browser.safari&&browser.blackberry){matched.browser="blackberry",browser.blackberry=!0}if(browser.safari&&browser.playbook){matched.browser="playbook",browser.playbook=!0}if(browser.bb){var bb="blackberry";browser[matched.browser=bb]=!0}if(browser.opr){matched.browser="opera",browser.opera=!0}if(browser.safari&&browser.android){matched.browser="android",browser.android=!0}if(browser.safari&&browser.kindle){matched.browser="kindle",browser.kindle=!0}if(browser.safari&&browser.silk){matched.browser="silk",browser.silk=!0}return browser.name=matched.browser,browser.platform=matched.platform,browser}return window.jQBrowser=uaMatch(window.navigator.userAgent),window.jQBrowser.uaMatch=uaMatch,jQuery&&(jQuery.browser=window.jQBrowser),window.jQBrowser},"function"==typeof define&&define.amd?define(["jquery"],function($){return factory($)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=factory(require("jquery")):factory(jQuery),function(){"use strict";var keyCounter=0,allWaypoints={};function Waypoint(options){if(!options)throw new Error("No options passed to Waypoint constructor");if(!options.element)throw new Error("No element option passed to Waypoint constructor");if(!options.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+keyCounter,this.options=Waypoint.Adapter.extend({},Waypoint.defaults,options),this.element=this.options.element,this.adapter=new Waypoint.Adapter(this.element),this.callback=options.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=Waypoint.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=Waypoint.Context.findOrCreateByElement(this.options.context),Waypoint.offsetAliases[this.options.offset]&&(this.options.offset=Waypoint.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),allWaypoints[this.key]=this,keyCounter+=1}Waypoint.prototype.queueTrigger=function(direction){this.group.queueTrigger(this,direction)},Waypoint.prototype.trigger=function(args){this.enabled&&this.callback&&this.callback.apply(this,args)},Waypoint.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete allWaypoints[this.key]},Waypoint.prototype.disable=function(){return this.enabled=!1,this},Waypoint.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},Waypoint.prototype.next=function(){return this.group.next(this)},Waypoint.prototype.previous=function(){return this.group.previous(this)},Waypoint.invokeAll=function(method){var allWaypointsArray=[];for(var waypointKey in allWaypoints)allWaypointsArray.push(allWaypoints[waypointKey]);for(var i=0,end=allWaypointsArray.length;i<end;i++)allWaypointsArray[i][method]()},Waypoint.destroyAll=function(){Waypoint.invokeAll("destroy")},Waypoint.disableAll=function(){Waypoint.invokeAll("disable")},Waypoint.enableAll=function(){Waypoint.invokeAll("enable")},Waypoint.refreshAll=function(){Waypoint.Context.refreshAll()},Waypoint.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},Waypoint.viewportWidth=function(){return document.documentElement.clientWidth},Waypoint.adapters=[],Waypoint.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},Waypoint.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=Waypoint}(),function(){"use strict";function requestAnimationFrameShim(callback){window.setTimeout(callback,1e3/60)}var keyCounter=0,contexts={},Waypoint=window.Waypoint,oldWindowLoad=window.onload;function Context(element){this.element=element,this.Adapter=Waypoint.Adapter,this.adapter=new this.Adapter(element),this.key="waypoint-context-"+keyCounter,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},element.waypointContextKey=this.key,contexts[element.waypointContextKey]=this,keyCounter+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}Context.prototype.add=function(waypoint){var axis=waypoint.options.horizontal?"horizontal":"vertical";this.waypoints[axis][waypoint.key]=waypoint,this.refresh()},Context.prototype.checkEmpty=function(){var horizontalEmpty=this.Adapter.isEmptyObject(this.waypoints.horizontal),verticalEmpty=this.Adapter.isEmptyObject(this.waypoints.vertical);horizontalEmpty&&verticalEmpty&&(this.adapter.off(".waypoints"),delete contexts[this.key])},Context.prototype.createThrottledResizeHandler=function(){var self=this;function resizeHandler(){self.handleResize(),self.didResize=!1}this.adapter.on("resize.waypoints",function(){self.didResize||(self.didResize=!0,Waypoint.requestAnimationFrame(resizeHandler))})},Context.prototype.createThrottledScrollHandler=function(){var self=this;function scrollHandler(){self.handleScroll(),self.didScroll=!1}this.adapter.on("scroll.waypoints",function(){self.didScroll&&!Waypoint.isTouch||(self.didScroll=!0,Waypoint.requestAnimationFrame(scrollHandler))})},Context.prototype.handleResize=function(){Waypoint.Context.refreshAll()},Context.prototype.handleScroll=function(){var triggeredGroups={},axes={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var axisKey in axes){var axis=axes[axisKey],direction=axis.newScroll>axis.oldScroll?axis.forward:axis.backward;for(var waypointKey in this.waypoints[axisKey]){var waypoint=this.waypoints[axisKey][waypointKey],wasBeforeTriggerPoint=axis.oldScroll<waypoint.triggerPoint,nowAfterTriggerPoint=axis.newScroll>=waypoint.triggerPoint;(wasBeforeTriggerPoint&&nowAfterTriggerPoint||!wasBeforeTriggerPoint&&!nowAfterTriggerPoint)&&(waypoint.queueTrigger(direction),triggeredGroups[waypoint.group.id]=waypoint.group)}}for(var groupKey in triggeredGroups)triggeredGroups[groupKey].flushTriggers();this.oldScroll={x:axes.horizontal.newScroll,y:axes.vertical.newScroll}},Context.prototype.innerHeight=function(){return this.element==this.element.window?Waypoint.viewportHeight():this.adapter.innerHeight()},Context.prototype.remove=function(waypoint){delete this.waypoints[waypoint.axis][waypoint.key],this.checkEmpty()},Context.prototype.innerWidth=function(){return this.element==this.element.window?Waypoint.viewportWidth():this.adapter.innerWidth()},Context.prototype.destroy=function(){var allWaypoints=[];for(var axis in this.waypoints)for(var waypointKey in this.waypoints[axis])allWaypoints.push(this.waypoints[axis][waypointKey]);for(var i=0,end=allWaypoints.length;i<end;i++)allWaypoints[i].destroy()},Context.prototype.refresh=function(){var axes,isWindow=this.element==this.element.window,contextOffset=isWindow?undefined:this.adapter.offset(),triggeredGroups={};for(var axisKey in this.handleScroll(),axes={horizontal:{contextOffset:isWindow?0:contextOffset.left,contextScroll:isWindow?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:isWindow?0:contextOffset.top,contextScroll:isWindow?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}}){var axis=axes[axisKey];for(var waypointKey in this.waypoints[axisKey]){var contextModifier,wasBeforeScroll,nowAfterScroll,triggeredForward,waypoint=this.waypoints[axisKey][waypointKey],adjustment=waypoint.options.offset,oldTriggerPoint=waypoint.triggerPoint,elementOffset=0,freshWaypoint=null==oldTriggerPoint;waypoint.element!==waypoint.element.window&&(elementOffset=waypoint.adapter.offset()[axis.offsetProp]),"function"==typeof adjustment?adjustment=adjustment.apply(waypoint):"string"==typeof adjustment&&(adjustment=parseFloat(adjustment),-1<waypoint.options.offset.indexOf("%")&&(adjustment=Math.ceil(axis.contextDimension*adjustment/100))),contextModifier=axis.contextScroll-axis.contextOffset,waypoint.triggerPoint=elementOffset+contextModifier-adjustment,wasBeforeScroll=oldTriggerPoint<axis.oldScroll,nowAfterScroll=waypoint.triggerPoint>=axis.oldScroll,triggeredForward=!wasBeforeScroll&&!nowAfterScroll,!freshWaypoint&&(wasBeforeScroll&&nowAfterScroll)?(waypoint.queueTrigger(axis.backward),triggeredGroups[waypoint.group.id]=waypoint.group):!freshWaypoint&&triggeredForward?(waypoint.queueTrigger(axis.forward),triggeredGroups[waypoint.group.id]=waypoint.group):freshWaypoint&&axis.oldScroll>=waypoint.triggerPoint&&(waypoint.queueTrigger(axis.forward),triggeredGroups[waypoint.group.id]=waypoint.group)}}return Waypoint.requestAnimationFrame(function(){for(var groupKey in triggeredGroups)triggeredGroups[groupKey].flushTriggers()}),this},Context.findOrCreateByElement=function(element){return Context.findByElement(element)||new Context(element)},Context.refreshAll=function(){for(var contextId in contexts)contexts[contextId].refresh()},Context.findByElement=function(element){return contexts[element.waypointContextKey]},window.onload=function(){oldWindowLoad&&oldWindowLoad(),Context.refreshAll()},Waypoint.requestAnimationFrame=function(callback){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||requestAnimationFrameShim).call(window,callback)},Waypoint.Context=Context}(),function(){"use strict";function byTriggerPoint(a,b){return a.triggerPoint-b.triggerPoint}function byReverseTriggerPoint(a,b){return b.triggerPoint-a.triggerPoint}var groups={vertical:{},horizontal:{}},Waypoint=window.Waypoint;function Group(options){this.name=options.name,this.axis=options.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),groups[this.axis][this.name]=this}Group.prototype.add=function(waypoint){this.waypoints.push(waypoint)},Group.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},Group.prototype.flushTriggers=function(){for(var direction in this.triggerQueues){var waypoints=this.triggerQueues[direction],reverse="up"===direction||"left"===direction;waypoints.sort(reverse?byReverseTriggerPoint:byTriggerPoint);for(var i=0,end=waypoints.length;i<end;i+=1){var waypoint=waypoints[i];(waypoint.options.continuous||i===waypoints.length-1)&&waypoint.trigger([direction])}}this.clearTriggerQueues()},Group.prototype.next=function(waypoint){this.waypoints.sort(byTriggerPoint);var index=Waypoint.Adapter.inArray(waypoint,this.waypoints);return index===this.waypoints.length-1?null:this.waypoints[index+1]},Group.prototype.previous=function(waypoint){this.waypoints.sort(byTriggerPoint);var index=Waypoint.Adapter.inArray(waypoint,this.waypoints);return index?this.waypoints[index-1]:null},Group.prototype.queueTrigger=function(waypoint,direction){this.triggerQueues[direction].push(waypoint)},Group.prototype.remove=function(waypoint){var index=Waypoint.Adapter.inArray(waypoint,this.waypoints);-1<index&&this.waypoints.splice(index,1)},Group.prototype.first=function(){return this.waypoints[0]},Group.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},Group.findOrCreate=function(options){return groups[options.axis][options.name]||new Group(options)},Waypoint.Group=Group}(),function(){"use strict";var $=jQuery,Waypoint=window.Waypoint;function JQueryAdapter(element){this.$element=$(element)}$.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(i,method){JQueryAdapter.prototype[method]=function(){var args=Array.prototype.slice.call(arguments);return this.$element[method].apply(this.$element,args)}}),$.each(["extend","inArray","isEmptyObject"],function(i,method){JQueryAdapter[method]=$[method]}),Waypoint.adapters.push({name:"jquery",Adapter:JQueryAdapter}),Waypoint.Adapter=JQueryAdapter}(),function(){"use strict";var Waypoint=window.Waypoint;function createExtension(framework){return function(){var waypoints=[],overrides=arguments[0];return framework.isFunction(arguments[0])&&((overrides=framework.extend({},arguments[1])).handler=arguments[0]),this.each(function(){var options=framework.extend({},overrides,{element:this});"string"==typeof options.context&&(options.context=framework(this).closest(options.context)[0]),waypoints.push(new Waypoint(options))}),waypoints}}jQuery&&(jQuery.fn.waypoint=createExtension(jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=createExtension(window.Zepto))}(),function($,undefined){var orig,removeData,uuid=0,runiqueId=/^ui-id-\d+$/;function focusable(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();return"area"===nodeName?(mapName=(map=element.parentNode).name,!(!element.href||!mapName||"map"!==map.nodeName.toLowerCase())&&(!!(img=$("img[usemap=#"+mapName+"]")[0])&&visible(img))):(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName&&element.href||isTabIndexNotNaN)&&visible(element)}function visible(element){return $.expr.filters.visible(element)&&!$(element).parents().addBack().filter(function(){return"hidden"===$.css(this,"visibility")}).length}$.ui=$.ui||{},$.extend($.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),$.fn.extend({focus:(orig=$.fn.focus,function(delay,fn){return"number"==typeof delay?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus(),fn&&fn.call(elem)},delay)}):orig.apply(this,arguments)}),scrollParent:function(){var scrollParent;return scrollParent=$.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test($.css(this,"position"))&&/(auto|scroll)/.test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!scrollParent.length?$(document):scrollParent},zIndex:function(zIndex){if(void 0!==zIndex)return this.css("zIndex",zIndex);if(this.length)for(var position,value,elem=$(this[0]);elem.length&&elem[0]!==document;){if(("absolute"===(position=elem.css("position"))||"relative"===position||"fixed"===position)&&(value=parseInt(elem.css("zIndex"),10),!isNaN(value)&&0!==value))return value;elem=elem.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++uuid)})},removeUniqueId:function(){return this.each(function(){runiqueId.test(this.id)&&$(this).removeAttr("id")})}}),$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")))},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||0<=tabIndex)&&focusable(element,!isTabIndexNaN)}}),$("<a>").outerWidth(1).jquery||$.each(["Width","Height"],function(i,name){var side="Width"===name?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};function reduce(elem,size,border,margin){return $.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0,border&&(size-=parseFloat($.css(elem,"border"+this+"Width"))||0),margin&&(size-=parseFloat($.css(elem,"margin"+this))||0)}),size}$.fn["inner"+name]=function(size){return void 0===size?orig["inner"+name].call(this):this.each(function(){$(this).css(type,reduce(this,size)+"px")})},$.fn["outer"+name]=function(size,margin){return"number"!=typeof size?orig["outer"+name].call(this,size):this.each(function(){$(this).css(type,reduce(this,size,!0,margin)+"px")})}}),$.fn.addBack||($.fn.addBack=function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}),$("<a>").data("a-b","a").removeData("a-b").data("a-b")&&($.fn.removeData=(removeData=$.fn.removeData,function(key){return arguments.length?removeData.call(this,$.camelCase(key)):removeData.call(this)})),$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),$.support.selectstart="onselectstart"in document.createElement("div"),$.fn.extend({disableSelection:function(){return this.bind(($.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(event){event.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),$.extend($.ui,{plugin:{add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set)proto.plugins[i]=proto.plugins[i]||[],proto.plugins[i].push([option,set[i]])},call:function(instance,name,args){var i,set=instance.plugins[name];if(set&&instance.element[0].parentNode&&11!==instance.element[0].parentNode.nodeType)for(i=0;i<set.length;i++)instance.options[set[i][0]]&&set[i][1].apply(instance.element,args)}},hasScroll:function(el,a){if("hidden"===$(el).css("overflow"))return!1;var has,scroll=a&&"left"===a?"scrollLeft":"scrollTop";return 0<el[scroll]||(el[scroll]=1,has=0<el[scroll],el[scroll]=0,has)}})}(jQuery),function($,undefined){var uuid=0,slice=Array.prototype.slice,_cleanData=$.cleanData;$.cleanData=function(elems){for(var elem,i=0;null!=(elem=elems[i]);i++)try{$(elem).triggerHandler("remove")}catch(e){}_cleanData(elems)},$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];name=name.split(".")[1],fullName=namespace+"-"+name,prototype||(prototype=base,base=$.Widget),$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName)},$[namespace]=$[namespace]||{},existingConstructor=$[namespace][name],constructor=$[namespace][name]=function(options,element){if(!this._createWidget)return new constructor(options,element);arguments.length&&this._createWidget(options,element)},$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]}),(basePrototype=new base).options=$.widget.extend({},basePrototype.options),$.each(prototype,function(prop,value){var _super,_superApply;$.isFunction(value)?proxiedPrototype[prop]=(_super=function(){return base.prototype[prop].apply(this,arguments)},_superApply=function(args){return base.prototype[prop].apply(this,args)},function(){var returnValue,__super=this._super,__superApply=this._superApply;return this._super=_super,this._superApply=_superApply,returnValue=value.apply(this,arguments),this._super=__super,this._superApply=__superApply,returnValue}):proxiedPrototype[prop]=value}),constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor&&basePrototype.widgetEventPrefix||name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName}),existingConstructor?($.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto)}),delete existingConstructor._childConstructors):base._childConstructors.push(constructor),$.widget.bridge(name,constructor)},$.widget.extend=function(target){for(var key,value,input=slice.call(arguments,1),inputIndex=0,inputLength=input.length;inputIndex<inputLength;inputIndex++)for(key in input[inputIndex])value=input[inputIndex][key],input[inputIndex].hasOwnProperty(key)&&void 0!==value&&($.isPlainObject(value)?target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value):target[key]=value);return target},$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall="string"==typeof options,args=slice.call(arguments,1),returnValue=this;return options=!isMethodCall&&args.length?$.widget.extend.apply(null,[options].concat(args)):options,isMethodCall?this.each(function(){var methodValue,instance=$.data(this,fullName);return instance?$.isFunction(instance[options])&&"_"!==options.charAt(0)?(methodValue=instance[options].apply(instance,args))!==instance&&void 0!==methodValue?(returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue,!1):void 0:$.error("no such method '"+options+"' for "+name+" widget instance"):$.error("cannot call methods on "+name+" prior to initialization; attempted to call method '"+options+"'")}):this.each(function(){var instance=$.data(this,fullName);instance?instance.option(options||{})._init():$.data(this,fullName,new object(options,this))}),returnValue}},$.Widget=function(){},$.Widget._childConstructors=[],$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0],this.element=$(element),this.uuid=uuid++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=$.widget.extend({},this.options,this._getCreateOptions(),options),this.bindings=$(),this.hoverable=$(),this.focusable=$(),element!==this&&($.data(element,this.widgetFullName,this),this._on(!0,this.element,{remove:function(event){event.target===element&&this.destroy()}}),this.document=$(element.style?element.ownerDocument:element.document||element),this.window=$(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var parts,curOption,i,options=key;if(0===arguments.length)return $.widget.extend({},this.options);if("string"==typeof key)if(options={},key=(parts=key.split(".")).shift(),parts.length){for(curOption=options[key]=$.widget.extend({},this.options[key]),i=0;i<parts.length-1;i++)curOption[parts[i]]=curOption[parts[i]]||{},curOption=curOption[parts[i]];if(key=parts.pop(),1===arguments.length)return void 0===curOption[key]?null:curOption[key];curOption[key]=value}else{if(1===arguments.length)return void 0===this.options[key]?null:this.options[key];options[key]=value}return this._setOptions(options),this},_setOptions:function(options){var key;for(key in options)this._setOption(key,options[key]);return this},_setOption:function(key,value){return this.options[key]=value,"disabled"===key&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!value).attr("aria-disabled",value),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(suppressDisabledCheck,element,handlers){var delegateElement,instance=this;"boolean"!=typeof suppressDisabledCheck&&(handlers=element,element=suppressDisabledCheck,suppressDisabledCheck=!1),handlers?(element=delegateElement=$(element),this.bindings=this.bindings.add(element)):(handlers=element,element=this.element,delegateElement=this.widget()),$.each(handlers,function(event,handler){function handlerProxy(){if(suppressDisabledCheck||!0!==instance.options.disabled&&!$(this).hasClass("ui-state-disabled"))return("string"==typeof handler?instance[handler]:handler).apply(instance,arguments)}"string"!=typeof handler&&(handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++);var match=event.match(/^(\w+)\s*(.*)$/),eventName=match[1]+instance.eventNamespace,selector=match[2];selector?delegateElement.delegate(selector,eventName,handlerProxy):element.bind(eventName,handlerProxy)})},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,element.unbind(eventName).undelegate(eventName)},_delay:function(handler,delay){var instance=this;return setTimeout(function(){return("string"==typeof handler?instance[handler]:handler).apply(instance,arguments)},delay||0)},_hoverable:function(element){this.hoverable=this.hoverable.add(element),this._on(element,{mouseenter:function(event){$(event.currentTarget).addClass("ui-state-hover")},mouseleave:function(event){$(event.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(element){this.focusable=this.focusable.add(element),this._on(element,{focusin:function(event){$(event.currentTarget).addClass("ui-state-focus")},focusout:function(event){$(event.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(type,event,data){var prop,orig,callback=this.options[type];if(data=data||{},(event=$.Event(event)).type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase(),event.target=this.element[0],orig=event.originalEvent)for(prop in orig)prop in event||(event[prop]=orig[prop]);return this.element.trigger(event,data),!($.isFunction(callback)&&!1===callback.apply(this.element[0],[event].concat(data))||event.isDefaultPrevented())}},$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){"string"==typeof options&&(options={effect:options});var hasOptions,effectName=options?!0===options||"number"==typeof options?defaultEffect:options.effect||defaultEffect:method;"number"==typeof(options=options||{})&&(options={duration:options}),hasOptions=!$.isEmptyObject(options),options.complete=callback,options.delay&&element.delay(options.delay),hasOptions&&$.effects&&$.effects.effect[effectName]?element[method](options):effectName!==method&&element[effectName]?element[effectName](options.duration,options.easing,callback):element.queue(function(next){$(this)[method](),callback&&callback.call(element[0]),next()})}})}(jQuery),function($,undefined){var mouseHandled=!1;$(document).mouseup(function(){mouseHandled=!1}),$.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.bind("mousedown."+this.widgetName,function(event){return that._mouseDown(event)}).bind("click."+this.widgetName,function(event){if(!0===$.data(event.target,that.widgetName+".preventClickEvent"))return $.removeData(event.target,that.widgetName+".preventClickEvent"),event.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&$(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(event){if(!mouseHandled){this._mouseStarted&&this._mouseUp(event),this._mouseDownEvent=event;var that=this,btnIsLeft=1===event.which,elIsCancel=!("string"!=typeof this.options.cancel||!event.target.nodeName)&&$(event.target).closest(this.options.cancel).length;return!(btnIsLeft&&!elIsCancel&&this._mouseCapture(event))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(event)&&this._mouseDelayMet(event)&&(this._mouseStarted=!1!==this._mouseStart(event),!this._mouseStarted)?(event.preventDefault(),!0):(!0===$.data(event.target,this.widgetName+".preventClickEvent")&&$.removeData(event.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(event){return that._mouseMove(event)},this._mouseUpDelegate=function(event){return that._mouseUp(event)},$(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),event.preventDefault(),mouseHandled=!0))}},_mouseMove:function(event){return $.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button?this._mouseUp(event):this._mouseStarted?(this._mouseDrag(event),event.preventDefault()):(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,event),this._mouseStarted?this._mouseDrag(event):this._mouseUp(event)),!this._mouseStarted)},_mouseUp:function(event){return $(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,event.target===this._mouseDownEvent.target&&$.data(event.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(event)),!1},_mouseDistanceMet:function(event){return Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function($,undefined){$.ui=$.ui||{};var cachedScrollbarWidth,max=Math.max,abs=Math.abs,round=Math.round,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)]}function parseCss(element,property){return parseInt($.css(element,property),10)||0}$.position={scrollbarWidth:function(){if(void 0!==cachedScrollbarWidth)return cachedScrollbarWidth;var w1,w2,div=$("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),innerDiv=div.children()[0];return $("body").append(div),w1=innerDiv.offsetWidth,div.css("overflow","scroll"),w1===(w2=innerDiv.offsetWidth)&&(w2=div[0].clientWidth),div.remove(),cachedScrollbarWidth=w1-w2},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX="scroll"===overflowX||"auto"===overflowX&&within.width<within.element[0].scrollWidth;return{width:"scroll"===overflowY||"auto"===overflowY&&within.height<within.element[0].scrollHeight?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0}},getWithinInfo:function(element){var withinElement=$(element||window),isWindow=$.isWindow(withinElement[0]);return{element:withinElement,isWindow:isWindow,isDocument:!!withinElement[0]&&9===withinElement[0].nodeType,offset:withinElement.offset()||{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:isWindow?withinElement.width():withinElement.outerWidth(),height:isWindow?withinElement.height():withinElement.outerHeight()}}},$.fn.position=function(options){if(!options||!options.of)return _position.apply(this,arguments);options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,elem,raw,target=$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={};return dimensions=9===(raw=(elem=target)[0]).nodeType?{width:elem.width(),height:elem.height(),offset:{top:0,left:0}}:$.isWindow(raw)?{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}}:raw.preventDefault?{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}}:{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()},target[0].preventDefault&&(options.at="left top"),targetWidth=dimensions.width,targetHeight=dimensions.height,targetOffset=dimensions.offset,basePosition=$.extend({},targetOffset),$.each(["my","at"],function(){var horizontalOffset,verticalOffset,pos=(options[this]||"").split(" ");1===pos.length&&(pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"]),pos[0]=rhorizontal.test(pos[0])?pos[0]:"center",pos[1]=rvertical.test(pos[1])?pos[1]:"center",horizontalOffset=roffset.exec(pos[0]),verticalOffset=roffset.exec(pos[1]),offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0],options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]]}),1===collision.length&&(collision[1]=collision[0]),"right"===options.at[0]?basePosition.left+=targetWidth:"center"===options.at[0]&&(basePosition.left+=targetWidth/2),"bottom"===options.at[1]?basePosition.top+=targetHeight:"center"===options.at[1]&&(basePosition.top+=targetHeight/2),atOffset=getOffsets(offsets.at,targetWidth,targetHeight),basePosition.left+=atOffset[0],basePosition.top+=atOffset[1],this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());"right"===options.my[0]?position.left-=elemWidth:"center"===options.my[0]&&(position.left-=elemWidth/2),"bottom"===options.my[1]?position.top-=elemHeight:"center"===options.my[1]&&(position.top-=elemHeight/2),position.left+=myOffset[0],position.top+=myOffset[1],$.support.offsetFractions||(position.left=round(position.left),position.top=round(position.top)),collisionPosition={marginLeft:marginLeft,marginTop:marginTop},$.each(["left","top"],function(i,dir){$.ui.position[collision[i]]&&$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within:within,elem:elem})}),options.using&&(using=function(props){var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:right<0?"left":0<left?"right":"center",vertical:bottom<0?"top":0<top?"bottom":"middle"};targetWidth<elemWidth&&abs(left+right)<targetWidth&&(feedback.horizontal="center"),targetHeight<elemHeight&&abs(top+bottom)<targetHeight&&(feedback.vertical="middle"),max(abs(left),abs(right))>max(abs(top),abs(bottom))?feedback.important="horizontal":feedback.important="vertical",options.using.call(this,props,feedback)}),elem.offset($.extend(position,{using:using}))})},$.ui.position={fit:{left:function(position,data){var newOverRight,within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset;data.collisionWidth>outerWidth?0<overLeft&&overRight<=0?(newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset,position.left+=overLeft-newOverRight):position.left=0<overRight&&overLeft<=0?withinOffset:overRight<overLeft?withinOffset+outerWidth-data.collisionWidth:withinOffset:0<overLeft?position.left+=overLeft:0<overRight?position.left-=overRight:position.left=max(position.left-collisionPosLeft,position.left)},top:function(position,data){var newOverBottom,within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset;data.collisionHeight>outerHeight?0<overTop&&overBottom<=0?(newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset,position.top+=overTop-newOverBottom):position.top=0<overBottom&&overTop<=0?withinOffset:overBottom<overTop?withinOffset+outerHeight-data.collisionHeight:withinOffset:0<overTop?position.top+=overTop:0<overBottom?position.top-=overBottom:position.top=max(position.top-collisionPosTop,position.top)}},flip:{left:function(position,data){var newOverRight,newOverLeft,within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset="left"===data.my[0]?-data.elemWidth:"right"===data.my[0]?data.elemWidth:0,atOffset="left"===data.at[0]?data.targetWidth:"right"===data.at[0]?-data.targetWidth:0,offset=-2*data.offset[0];overLeft<0?((newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset)<0||newOverRight<abs(overLeft))&&(position.left+=myOffset+atOffset+offset):0<overRight&&(0<(newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft)||abs(newOverLeft)<overRight)&&(position.left+=myOffset+atOffset+offset)},top:function(position,data){var newOverTop,newOverBottom,within=data.within,withinOffset=within.offset.top+within.scrollTop,outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,myOffset="top"===data.my[1]?-data.elemHeight:"bottom"===data.my[1]?data.elemHeight:0,atOffset="top"===data.at[1]?data.targetHeight:"bottom"===data.at[1]?-data.targetHeight:0,offset=-2*data.offset[1];overTop<0?(newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset,position.top+myOffset+atOffset+offset>overTop&&(newOverBottom<0||newOverBottom<abs(overTop))&&(position.top+=myOffset+atOffset+offset)):0<overBottom&&(newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop,position.top+myOffset+atOffset+offset>overBottom&&(0<newOverTop||abs(newOverTop)<overBottom)&&(position.top+=myOffset+atOffset+offset))}},flipfit:{left:function(){$.ui.position.flip.left.apply(this,arguments),$.ui.position.fit.left.apply(this,arguments)},top:function(){$.ui.position.flip.top.apply(this,arguments),$.ui.position.fit.top.apply(this,arguments)}}},function(){var testElement,testElementParent,testElementStyle,offsetLeft,i,body=document.getElementsByTagName("body")[0],div=document.createElement("div");for(i in testElement=document.createElement(body?"div":"body"),testElementStyle={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},body&&$.extend(testElementStyle,{position:"absolute",left:"-1000px",top:"-1000px"}),testElementStyle)testElement.style[i]=testElementStyle[i];testElement.appendChild(div),(testElementParent=body||document.documentElement).insertBefore(testElement,testElementParent.firstChild),div.style.cssText="position: absolute; left: 10.7432222px;",offsetLeft=$(div).offset().left,$.support.offsetFractions=10<offsetLeft&&offsetLeft<11,testElement.innerHTML="",testElementParent.removeChild(testElement)}()}(jQuery),function($,undefined){$.widget("ui.draggable",$.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(event){var o=this.options;return!(this.helper||o.disabled||0<$(event.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(event),!!this.handle&&($(!0===o.iframeFix?"iframe":o.iframeFix).each(function(){$("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css($(this).offset()).appendTo("body")}),!0))},_mouseStart:function(event){var o=this.options;return this.helper=this._createHelper(event),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),$.ui.ddmanager&&($.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(event),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this._setContainment(),!1===this._trigger("start",event)?(this._clear(),!1):(this._cacheHelperProportions(),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this._mouseDrag(event,!0),$.ui.ddmanager&&$.ui.ddmanager.dragStart(this,event),!0)},_mouseDrag:function(event,noPropagation){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(event),this.positionAbs=this._convertPositionTo("absolute"),!noPropagation){var ui=this._uiHash();if(!1===this._trigger("drag",event,ui))return this._mouseUp({}),!1;this.position=ui.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),!1},_mouseStop:function(event){var that=this,dropped=!1;return $.ui.ddmanager&&!this.options.dropBehaviour&&(dropped=$.ui.ddmanager.drop(this,event)),this.dropped&&(dropped=this.dropped,this.dropped=!1),("original"!==this.options.helper||$.contains(this.element[0].ownerDocument,this.element[0]))&&("invalid"===this.options.revert&&!dropped||"valid"===this.options.revert&&dropped||!0===this.options.revert||$.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped)?$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==that._trigger("stop",event)&&that._clear()}):!1!==this._trigger("stop",event)&&this._clear()),!1},_mouseUp:function(event){return $("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),$.ui.ddmanager&&$.ui.ddmanager.dragStop(this,event),$.ui.mouse.prototype._mouseUp.call(this,event)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(event){return!this.options.handle||!!$(event.target).closest(this.element.find(this.options.handle)).length},_createHelper:function(event){var o=this.options,helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):"clone"===o.helper?this.element.clone().removeAttr("id"):this.element;return helper.parents("body").length||helper.appendTo("parent"===o.appendTo?this.element[0].parentNode:o.appendTo),helper[0]===this.element[0]||/(fixed|absolute)/.test(helper.css("position"))||helper.css("position","absolute"),helper},_adjustOffsetFromHelper:function(obj){"string"==typeof obj&&(obj=obj.split(" ")),$.isArray(obj)&&(obj={left:+obj[0],top:+obj[1]||0}),"left"in obj&&(this.offset.click.left=obj.left+this.margins.left),"right"in obj&&(this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left),"top"in obj&&(this.offset.click.top=obj.top+this.margins.top),"bottom"in obj&&(this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top)},_getParentOffset:function(){var po=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])&&(po.left+=this.scrollParent.scrollLeft(),po.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&$.ui.ie)&&(po={top:0,left:0}),{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var over,c,ce,o=this.options;o.containment?"window"!==o.containment?"document"!==o.containment?o.containment.constructor!==Array?("parent"===o.containment&&(o.containment=this.helper[0].parentNode),(ce=(c=$(o.containment))[0])&&(over="hidden"!==c.css("overflow"),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c)):this.containment=o.containment:this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(d,pos){pos||(pos=this.position);var mod="absolute"===d?1:-1,scroll="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:scroll.scrollTop(),left:scroll.scrollLeft()}),{top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*mod}},_generatePosition:function(event){var containment,co,top,left,o=this.options,scroll="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,pageX=event.pageX,pageY=event.pageY;return this.offset.scroll||(this.offset.scroll={top:scroll.scrollTop(),left:scroll.scrollLeft()}),this.originalPosition&&(this.containment&&(containment=this.relative_container?(co=this.relative_container.offset(),[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top]):this.containment,event.pageX-this.offset.click.left<containment[0]&&(pageX=containment[0]+this.offset.click.left),event.pageY-this.offset.click.top<containment[1]&&(pageY=containment[1]+this.offset.click.top),event.pageX-this.offset.click.left>containment[2]&&(pageX=containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>containment[3]&&(pageY=containment[3]+this.offset.click.top)),o.grid&&(top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,pageY=containment?top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3]?top:top-this.offset.click.top>=containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,pageX=containment?left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2]?left:left-this.offset.click.left>=containment[0]?left-o.grid[0]:left+o.grid[0]:left)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(type,event,ui){return ui=ui||this._uiHash(),$.ui.plugin.call(this,type,[event,ui]),"drag"===type&&(this.positionAbs=this._convertPositionTo("absolute")),$.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("ui-draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[],$(o.connectToSortable).each(function(){var sortable=$.data(this,"ui-sortable");sortable&&!sortable.options.disabled&&(inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert}),sortable.refreshPositions(),sortable._trigger("activate",event,uiSortable))})},stop:function(event,ui){var inst=$(this).data("ui-draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){this.instance.isOver?(this.instance.isOver=0,inst.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(event),this.instance.options.helper=this.instance.options._helper,"original"===inst.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",event,uiSortable))})},drag:function(event,ui){var inst=$(this).data("ui-draggable"),that=this;$.each(inst.sortables,function(){var innermostIntersecting=!1,thisSortable=this;this.instance.positionAbs=inst.positionAbs,this.instance.helperProportions=inst.helperProportions,this.instance.offset.click=inst.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(innermostIntersecting=!0,$.each(inst.sortables,function(){return this.instance.positionAbs=inst.positionAbs,this.instance.helperProportions=inst.helperProportions,this.instance.offset.click=inst.offset.click,this!==thisSortable&&this.instance._intersectsWith(this.instance.containerCache)&&$.contains(thisSortable.instance.element[0],this.instance.element[0])&&(innermostIntersecting=!1),innermostIntersecting})),innermostIntersecting?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=$(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return ui.helper[0]},event.target=this.instance.currentItem[0],this.instance._mouseCapture(event,!0),this.instance._mouseStart(event,!0,!0),this.instance.offset.click.top=inst.offset.click.top,this.instance.offset.click.left=inst.offset.click.left,this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top,inst._trigger("toSortable",event),inst.dropped=this.instance.element,inst.currentItem=inst.element,this.instance.fromOutside=inst),this.instance.currentItem&&this.instance._mouseDrag(event)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",event,this.instance._uiHash(this.instance)),this.instance._mouseStop(event,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),inst._trigger("fromSortable",event),inst.dropped=!1)})}}),$.ui.plugin.add("draggable","cursor",{start:function(){var t=$("body"),o=$(this).data("ui-draggable").options;t.css("cursor")&&(o._cursor=t.css("cursor")),t.css("cursor",o.cursor)},stop:function(){var o=$(this).data("ui-draggable").options;o._cursor&&$("body").css("cursor",o._cursor)}}),$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("ui-draggable").options;t.css("opacity")&&(o._opacity=t.css("opacity")),t.css("opacity",o.opacity)},stop:function(event,ui){var o=$(this).data("ui-draggable").options;o._opacity&&$(ui.helper).css("opacity",o._opacity)}}),$.ui.plugin.add("draggable","scroll",{start:function(){var i=$(this).data("ui-draggable");i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName&&(i.overflowOffset=i.scrollParent.offset())},drag:function(event){var i=$(this).data("ui-draggable"),o=i.options,scrolled=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-event.pageY<o.scrollSensitivity?i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed:event.pageY-i.overflowOffset.top<o.scrollSensitivity&&(i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed)),o.axis&&"y"===o.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-event.pageX<o.scrollSensitivity?i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed:event.pageX-i.overflowOffset.left<o.scrollSensitivity&&(i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed))):(o.axis&&"x"===o.axis||(event.pageY-$(document).scrollTop()<o.scrollSensitivity?scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed):$(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity&&(scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed))),o.axis&&"y"===o.axis||(event.pageX-$(document).scrollLeft()<o.scrollSensitivity?scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed):$(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity&&(scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)))),!1!==scrolled&&$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(i,event)}}),$.ui.plugin.add("draggable","snap",{start:function(){var i=$(this).data("ui-draggable"),o=i.options;i.snapElements=[],$(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var $t=$(this),$o=$t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left})})},drag:function(event,ui){var ts,bs,ls,rs,l,r,t,b,i,first,inst=$(this).data("ui-draggable"),o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;0<=i;i--)r=(l=inst.snapElements[i].left)+inst.snapElements[i].width,b=(t=inst.snapElements[i].top)+inst.snapElements[i].height,x2<l-d||r+d<x1||y2<t-d||b+d<y1||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)?(inst.snapElements[i].snapping&&inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=!1):("inner"!==o.snapMode&&(ts=Math.abs(t-y2)<=d,bs=Math.abs(b-y1)<=d,ls=Math.abs(l-x2)<=d,rs=Math.abs(r-x1)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left)),first=ts||bs||ls||rs,"outer"!==o.snapMode&&(ts=Math.abs(t-y1)<=d,bs=Math.abs(b-y2)<=d,ls=Math.abs(l-x1)<=d,rs=Math.abs(r-x2)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left)),!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)&&inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=ts||bs||ls||rs||first)}}),$.ui.plugin.add("draggable","stack",{start:function(){var min,o=this.data("ui-draggable").options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)});group.length&&(min=parseInt($(group[0]).css("zIndex"),10)||0,$(group).each(function(i){$(this).css("zIndex",min+i)}),this.css("zIndex",min+group.length))}}),$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("ui-draggable").options;t.css("zIndex")&&(o._zIndex=t.css("zIndex")),t.css("zIndex",o.zIndex)},stop:function(event,ui){var o=$(this).data("ui-draggable").options;o._zIndex&&$(ui.helper).css("zIndex",o._zIndex)}})}(jQuery),function($,undefined){function isOverAxis(x,reference,size){return reference<x&&x<reference+size}$.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=!1,this.isout=!0,this.accept=$.isFunction(accept)?accept:function(d){return d.is(accept)},this.proportions=function(){if(!arguments.length)return proportions||(proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});proportions=arguments[0]},$.ui.ddmanager.droppables[o.scope]=$.ui.ddmanager.droppables[o.scope]||[],$.ui.ddmanager.droppables[o.scope].push(this),o.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var i=0,drop=$.ui.ddmanager.droppables[this.options.scope];i<drop.length;i++)drop[i]===this&&drop.splice(i,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(key,value){"accept"===key&&(this.accept=$.isFunction(value)?value:function(d){return d.is(value)}),$.Widget.prototype._setOption.apply(this,arguments)},_activate:function(event){var draggable=$.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),draggable&&this._trigger("activate",event,this.ui(draggable))},_deactivate:function(event){var draggable=$.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),draggable&&this._trigger("deactivate",event,this.ui(draggable))},_over:function(event){var draggable=$.ui.ddmanager.current;draggable&&(draggable.currentItem||draggable.element)[0]!==this.element[0]&&this.accept.call(this.element[0],draggable.currentItem||draggable.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",event,this.ui(draggable)))},_out:function(event){var draggable=$.ui.ddmanager.current;draggable&&(draggable.currentItem||draggable.element)[0]!==this.element[0]&&this.accept.call(this.element[0],draggable.currentItem||draggable.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",event,this.ui(draggable)))},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current,childrenIntersection=!1;return!(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var inst=$.data(this,"ui-droppable");if(inst.options.greedy&&!inst.options.disabled&&inst.options.scope===draggable.options.scope&&inst.accept.call(inst.element[0],draggable.currentItem||draggable.element)&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance))return!(childrenIntersection=!0)}),!childrenIntersection&&(!!this.accept.call(this.element[0],draggable.currentItem||draggable.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",event,this.ui(draggable)),this.element)))},ui:function(c){return{draggable:c.currentItem||c.element,helper:c.helper,position:c.position,offset:c.positionAbs}}}),$.ui.intersect=function(draggable,droppable,toleranceMode){if(!droppable.offset)return!1;var draggableLeft,x1=(draggable.positionAbs||draggable.position.absolute).left,y1=(draggable.positionAbs||draggable.position.absolute).top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case"fit":return l<=x1&&x2<=r&&t<=y1&&y2<=b;case"intersect":return l<x1+draggable.helperProportions.width/2&&x2-draggable.helperProportions.width/2<r&&t<y1+draggable.helperProportions.height/2&&y2-draggable.helperProportions.height/2<b;case"pointer":return draggableLeft=(draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left,isOverAxis((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top,t,droppable.proportions().height)&&isOverAxis(draggableLeft,l,droppable.proportions().width);case"touch":return(t<=y1&&y1<=b||t<=y2&&y2<=b||y1<t&&b<y2)&&(l<=x1&&x1<=r||l<=x2&&x2<=r||x1<l&&r<x2);default:return!1}},$.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i<m.length;i++)if(!(m[i].options.disabled||t&&!m[i].accept.call(m[i].element[0],t.currentItem||t.element))){for(j=0;j<list.length;j++)if(list[j]===m[i].element[0]){m[i].proportions().height=0;continue droppablesLoop}m[i].visible="none"!==m[i].element.css("display"),m[i].visible&&("mousedown"===type&&m[i]._activate.call(m[i],event),m[i].offset=m[i].element.offset(),m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight}))}},drop:function(draggable,event){var dropped=!1;return $.each(($.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance)&&(dropped=this._drop.call(this,event)||dropped),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],draggable.currentItem||draggable.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,event)))}),dropped},dragStart:function(draggable,event){draggable.element.parentsUntil("body").bind("scroll.droppable",function(){draggable.options.refreshPositions||$.ui.ddmanager.prepareOffsets(draggable,event)})},drag:function(draggable,event){draggable.options.refreshPositions&&$.ui.ddmanager.prepareOffsets(draggable,event),$.each($.ui.ddmanager.droppables[draggable.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var parentInstance,scope,parent,intersects=$.ui.intersect(draggable,this,this.options.tolerance),c=!intersects&&this.isover?"isout":intersects&&!this.isover?"isover":null;c&&(this.options.greedy&&(scope=this.options.scope,(parent=this.element.parents(":data(ui-droppable)").filter(function(){return $.data(this,"ui-droppable").options.scope===scope})).length&&((parentInstance=$.data(parent[0],"ui-droppable")).greedyChild="isover"===c)),parentInstance&&"isover"===c&&(parentInstance.isover=!1,parentInstance.isout=!0,parentInstance._out.call(parentInstance,event)),this[c]=!0,this["isout"===c?"isover":"isout"]=!1,this["isover"===c?"_over":"_out"].call(this,event),parentInstance&&"isout"===c&&(parentInstance.isout=!1,parentInstance.isover=!0,parentInstance._over.call(parentInstance,event)))}})},dragStop:function(draggable,event){draggable.element.parentsUntil("body").unbind("scroll.droppable"),draggable.options.refreshPositions||$.ui.ddmanager.prepareOffsets(draggable,event)}}}(jQuery),function($,undefined){var sizeRelatedOptions={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};$.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;topOffset<0&&$(this).css("top",pos.top-topOffset)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&$.fn.draggable&&this._makeDraggable(),this.options.resizable&&$.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var element=this.options.appendTo;return element&&(element.jquery||element.nodeType)?$(element):this.document.find(element||"body").eq(0)},_destroy:function(){var next,originalPosition=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(next=originalPosition.parent.children().eq(originalPosition.index)).length&&next[0]!==this.element[0]?next.before(this.element):originalPosition.parent.append(this.element)},widget:function(){return this.uiDialog},disable:$.noop,enable:$.noop,close:function(event){var activeElement,that=this;if(this._isOpen&&!1!==this._trigger("beforeClose",event)){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{(activeElement=this.document[0].activeElement)&&"body"!==activeElement.nodeName.toLowerCase()&&$(activeElement).blur()}catch(error){}this._hide(this.uiDialog,this.options.hide,function(){that._trigger("close",event)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(event,silent){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return moved&&!silent&&this._trigger("focus",event),moved},open:function(){var that=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=$(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){that._focusTabbable(),that._trigger("focus")}),this._trigger("open"))},_focusTabbable:function(){var hasFocus=this.element.find("[autofocus]");hasFocus.length||(hasFocus=this.element.find(":tabbable")),hasFocus.length||(hasFocus=this.uiDialogButtonPane.find(":tabbable")),hasFocus.length||(hasFocus=this.uiDialogTitlebarClose.filter(":tabbable")),hasFocus.length||(hasFocus=this.uiDialog),hasFocus.eq(0).focus()},_keepFocus:function(event){function checkFocus(){var activeElement=this.document[0].activeElement;this.uiDialog[0]===activeElement||$.contains(this.uiDialog[0],activeElement)||this._focusTabbable()}event.preventDefault(),checkFocus.call(this),this._delay(checkFocus)},_createWrapper:function(){this.uiDialog=$("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(event){if(this.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE)return event.preventDefault(),void this.close(event);if(event.keyCode===$.ui.keyCode.TAB){var tabbables=this.uiDialog.find(":tabbable"),first=tabbables.filter(":first"),last=tabbables.filter(":last");event.target!==last[0]&&event.target!==this.uiDialog[0]||event.shiftKey?event.target!==first[0]&&event.target!==this.uiDialog[0]||!event.shiftKey||(last.focus(1),event.preventDefault()):(first.focus(1),event.preventDefault())}},mousedown:function(event){this._moveToTop(event)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var uiDialogTitle;this.uiDialogTitlebar=$("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(event){$(event.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=$("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(event){event.preventDefault(),this.close(event)}}),uiDialogTitle=$("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(uiDialogTitle),this.uiDialog.attr({"aria-labelledby":uiDialogTitle.attr("id")})},_title:function(title){this.options.title||title.html("&#160;"),title.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=$("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=$("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var that=this,buttons=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),$.isEmptyObject(buttons)||$.isArray(buttons)&&!buttons.length?this.uiDialog.removeClass("ui-dialog-buttons"):($.each(buttons,function(name,props){var click,buttonOptions;props=$.isFunction(props)?{click:props,text:name}:props,props=$.extend({type:"button"},props),click=props.click,props.click=function(){click.apply(that.element[0],arguments)},buttonOptions={icons:props.icons,text:props.showText},delete props.icons,delete props.showText,$("<button></button>",props).button(buttonOptions).appendTo(that.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var that=this,options=this.options;function filteredUi(ui){return{position:ui.position,offset:ui.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){$(this).addClass("ui-dialog-dragging"),that._blockFrames(),that._trigger("dragStart",event,filteredUi(ui))},drag:function(event,ui){that._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){options.position=[ui.position.left-that.document.scrollLeft(),ui.position.top-that.document.scrollTop()],$(this).removeClass("ui-dialog-dragging"),that._unblockFrames(),that._trigger("dragStop",event,filteredUi(ui))}})},_makeResizable:function(){var that=this,options=this.options,handles=options.resizable,position=this.uiDialog.css("position"),resizeHandles="string"==typeof handles?handles:"n,e,s,w,se,sw,ne,nw";function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:this._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing"),that._blockFrames(),that._trigger("resizeStart",event,filteredUi(ui))},resize:function(event,ui){that._trigger("resize",event,filteredUi(ui))},stop:function(event,ui){options.height=$(this).height(),options.width=$(this).width(),$(this).removeClass("ui-dialog-resizing"),that._unblockFrames(),that._trigger("resizeStop",event,filteredUi(ui))}}).css("position",position)},_minHeight:function(){var options=this.options;return"auto"===options.height?options.minHeight:Math.min(options.minHeight,options.height)},_position:function(){var isVisible=this.uiDialog.is(":visible");isVisible||this.uiDialog.show(),this.uiDialog.position(this.options.position),isVisible||this.uiDialog.hide()},_setOptions:function(options){var that=this,resize=!1,resizableOptions={};$.each(options,function(key,value){that._setOption(key,value),key in sizeRelatedOptions&&(resize=!0),key in resizableRelatedOptions&&(resizableOptions[key]=value)}),resize&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",resizableOptions)},_setOption:function(key,value){var isDraggable,isResizable,uiDialog=this.uiDialog;"dialogClass"===key&&uiDialog.removeClass(this.options.dialogClass).addClass(value),"disabled"!==key&&(this._super(key,value),"appendTo"===key&&this.uiDialog.appendTo(this._appendTo()),"buttons"===key&&this._createButtons(),"closeText"===key&&this.uiDialogTitlebarClose.button({label:""+value}),"draggable"===key&&((isDraggable=uiDialog.is(":data(ui-draggable)"))&&!value&&uiDialog.draggable("destroy"),!isDraggable&&value&&this._makeDraggable()),"position"===key&&this._position(),"resizable"===key&&((isResizable=uiDialog.is(":data(ui-resizable)"))&&!value&&uiDialog.resizable("destroy"),isResizable&&"string"==typeof value&&uiDialog.resizable("option","handles",value),isResizable||!1===value||this._makeResizable()),"title"===key&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var nonContentHeight,minContentHeight,maxContentHeight,options=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),options.minWidth>options.width&&(options.width=options.minWidth),nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).outerHeight(),minContentHeight=Math.max(0,options.minHeight-nonContentHeight),maxContentHeight="number"==typeof options.maxHeight?Math.max(0,options.maxHeight-nonContentHeight):"none","auto"===options.height?this.element.css({minHeight:minContentHeight,maxHeight:maxContentHeight,height:"auto"}):this.element.height(Math.max(0,options.height-nonContentHeight)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var iframe=$(this);return $("<div>").css({position:"absolute",width:iframe.outerWidth(),height:iframe.outerHeight()}).appendTo(iframe.parent()).offset(iframe.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(event){return!!$(event.target).closest(".ui-dialog").length||!!$(event.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var that=this,widgetFullName=this.widgetFullName;$.ui.dialog.overlayInstances||this._delay(function(){$.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(event){that._allowInteraction(event)||(event.preventDefault(),$(".ui-dialog:visible:last .ui-dialog-content").data(widgetFullName)._focusTabbable())})}),this.overlay=$("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),$.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&($.ui.dialog.overlayInstances--,$.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),$.ui.dialog.overlayInstances=0,!1!==$.uiBackCompat&&$.widget("ui.dialog",$.ui.dialog,{_position:function(){var isVisible,position=this.options.position,myAt=[],offset=[0,0];position=position?(("string"==typeof position||"object"==typeof position&&"0"in position)&&(1===(myAt=position.split?position.split(" "):[position[0],position[1]]).length&&(myAt[1]=myAt[0]),$.each(["left","top"],function(i,offsetPosition){+myAt[i]===myAt[i]&&(offset[i]=myAt[i],myAt[i]=offsetPosition)}),position={my:myAt[0]+(offset[0]<0?offset[0]:"+"+offset[0])+" "+myAt[1]+(offset[1]<0?offset[1]:"+"+offset[1]),at:myAt.join(" ")}),$.extend({},$.ui.dialog.prototype.options.position,position)):$.ui.dialog.prototype.options.position,(isVisible=this.uiDialog.is(":visible"))||this.uiDialog.show(),this.uiDialog.position(position),isVisible||this.uiDialog.hide()}})}(jQuery),function($,undefined){function isOverAxis(x,reference,size){return reference<x&&x<reference+size}function isFloating(item){return/left|right/.test(item.css("float"))||/inline|table-cell/.test(item.css("display"))}$.widget("ui.sortable",$.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var o=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===o.axis||isFloating(this.items[0].item)),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var i=this.items.length-1;0<=i;i--)this.items[i].item.removeData(this.widgetName+"-item");return this},_setOption:function(key,value){"disabled"===key?(this.options[key]=value,this.widget().toggleClass("ui-sortable-disabled",!!value)):$.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=!1,that=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(event),$(event.target).parents().each(function(){if($.data(this,that.widgetName+"-item")===that)return currentItem=$(this),!1}),$.data(event.target,that.widgetName+"-item")===that&&(currentItem=$(event.target)),!!currentItem&&(!(this.options.handle&&!overrideHandle&&($(this.options.handle,currentItem).find("*").addBack().each(function(){this===event.target&&(validHandle=!0)}),!validHandle))&&(this.currentItem=currentItem,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;if((this.currentContainer=this).refreshPositions(),this.helper=this._createHelper(event),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(event),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(body=this.document.find("body"),this.storedCursor=body.css("cursor"),body.css("cursor",o.cursor),this.storedStylesheet=$("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",event,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!noActivation)for(i=this.containers.length-1;0<=i;i--)this.containers[i]._trigger("activate",event,this._uiHash(this));return $.ui.ddmanager&&($.ui.ddmanager.current=this),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(event),!0},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options,scrolled=!1;for(this.position=this._generatePosition(event),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-event.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed:event.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-event.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed:event.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(event.pageY-$(document).scrollTop()<o.scrollSensitivity?scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed):$(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity&&(scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)),event.pageX-$(document).scrollLeft()<o.scrollSensitivity?scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed):$(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity&&(scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed))),!1!==scrolled&&$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;0<=i;i--)if(itemElement=(item=this.items[i]).item[0],(intersection=this._intersectsWithPointer(item))&&item.instance===this.currentContainer&&!(itemElement===this.currentItem[0]||this.placeholder[1===intersection?"next":"prev"]()[0]===itemElement||$.contains(this.placeholder[0],itemElement)||"semi-dynamic"===this.options.type&&$.contains(this.element[0],itemElement))){if(this.direction=1===intersection?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(item))break;this._rearrange(event,item),this._trigger("change",event,this._uiHash());break}return this._contactContainers(event),$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),this._trigger("sort",event,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(event,noPropagation){if(event){if($.ui.ddmanager&&!this.options.dropBehaviour&&$.ui.ddmanager.drop(this,event),this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};axis&&"x"!==axis||(animation.left=cur.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),axis&&"y"!==axis||(animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event)})}else this._clear(event,noPropagation);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var i=this.containers.length-1;0<=i;i--)this.containers[i]._trigger("deactivate",null,this._uiHash(this)),this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",null,this._uiHash(this)),this.containers[i].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),$.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?$(this.domPosition.prev).after(this.currentItem):$(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];return o=o||{},$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||/(.+)[\-=_](.+)/);res&&str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]))}),!str.length&&o.key&&str.push(o.key+"="),str.join("&")},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];return o=o||{},items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"")}),ret},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight="x"===this.options.axis||t<y1+dyClick&&y1+dyClick<b,isOverElementWidth="y"===this.options.axis||l<x1+dxClick&&x1+dxClick<r,isOverElement=isOverElementHeight&&isOverElementWidth;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"]?isOverElement:l<x1+this.helperProportions.width/2&&x2-this.helperProportions.width/2<r&&t<y1+this.helperProportions.height/2&&y2-this.helperProportions.height/2<b},_intersectsWithPointer:function(item){var isOverElementHeight="x"===this.options.axis||isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth="y"===this.options.axis||isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();return!!isOverElement&&(this.floating?horizontalDirection&&"right"===horizontalDirection||"down"===verticalDirection?2:1:verticalDirection&&("down"===verticalDirection?2:1))},_intersectsWithSides:function(item){var isOverBottomHalf=isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+item.height/2,item.height),isOverRightHalf=isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+item.width/2,item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();return this.floating&&horizontalDirection?"right"===horizontalDirection&&isOverRightHalf||"left"===horizontalDirection&&!isOverRightHalf:verticalDirection&&("down"===verticalDirection&&isOverBottomHalf||"up"===verticalDirection&&!isOverBottomHalf)},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return 0!==delta&&(0<delta?"down":"up")},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return 0!==delta&&(0<delta?"right":"left")},refresh:function(event){return this._refreshItems(event),this.refreshPositions(),this},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith},_getItemsAsjQuery:function(connected){var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected)for(i=connectWith.length-1;0<=i;i--)for(j=(cur=$(connectWith[i])).length-1;0<=j;j--)(inst=$.data(cur[j],this.widgetFullName))&&inst!==this&&!inst.options.disabled&&queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);function addItems(){items.push(this)}for(queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=queries.length-1;0<=i;i--)queries[i][0].each(addItems);return $(items)},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++)if(list[j]===item.item[0])return!1;return!0})},_refreshItems:function(event){this.items=[],this.containers=[this];var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();if(connectWith&&this.ready)for(i=connectWith.length-1;0<=i;i--)for(j=(cur=$(connectWith[i])).length-1;0<=j;j--)(inst=$.data(cur[j],this.widgetFullName))&&inst!==this&&!inst.options.disabled&&(queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]),this.containers.push(inst));for(i=queries.length-1;0<=i;i--)for(targetData=queries[i][1],j=0,queriesLength=(_queries=queries[i][0]).length;j<queriesLength;j++)(item=$(_queries[j])).data(this.widgetName+"-item",targetData),items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0})},refreshPositions:function(fast){var i,item,t,p;for(this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),i=this.items.length-1;0<=i;i--)(item=this.items[i]).instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]||(t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item,fast||(item.width=t.outerWidth(),item.height=t.outerHeight()),p=t.offset(),item.left=p.left,item.top=p.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;0<=i;i--)p=this.containers[i].element.offset(),this.containers[i].containerCache.left=p.left,this.containers[i].containerCache.top=p.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(that){var className,o=(that=that||this).options;o.placeholder&&o.placeholder.constructor!==String||(className=o.placeholder,o.placeholder={element:function(){var nodeName=that.currentItem[0].nodeName.toLowerCase(),element=$("<"+nodeName+">",that.document[0]).addClass(className||that.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===nodeName?that.currentItem.children().each(function(){$("<td>&#160;</td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(element)}):"img"===nodeName&&element.attr("src",that.currentItem.attr("src")),className||element.css("visibility","hidden"),element},update:function(container,p){className&&!o.forcePlaceholderSize||(p.height()||p.height(that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(that.currentItem.css("paddingBottom")||0,10)),p.width()||p.width(that.currentItem.innerWidth()-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight")||0,10)))}}),that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem)),that.currentItem.after(that.placeholder),o.placeholder.update(that,that.placeholder)},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,base,cur,nearBottom,floating,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;0<=i;i--)if(!$.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0]))continue;innermostContainer=this.containers[i],innermostIndex=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",event,this._uiHash(this)),this.containers[i].containerCache.over=0);if(innermostContainer)if(1===this.containers.length)this.containers[innermostIndex].containerCache.over||(this.containers[innermostIndex]._trigger("over",event,this._uiHash(this)),this.containers[innermostIndex].containerCache.over=1);else{for(dist=1e4,itemWithLeastDistance=null,posProperty=(floating=innermostContainer.floating||isFloating(this.currentItem))?"left":"top",sizeProperty=floating?"width":"height",base=this.positionAbs[posProperty]+this.offset.click[posProperty],j=this.items.length-1;0<=j;j--)$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])&&this.items[j].item[0]!==this.currentItem[0]&&(floating&&!isOverAxis(this.positionAbs.top+this.offset.click.top,this.items[j].top,this.items[j].height)||(cur=this.items[j].item.offset()[posProperty],nearBottom=!1,Math.abs(cur-base)>Math.abs(cur+this.items[j][sizeProperty]-base)&&(nearBottom=!0,cur+=this.items[j][sizeProperty]),Math.abs(cur-base)<dist&&(dist=Math.abs(cur-base),itemWithLeastDistance=this.items[j],this.direction=nearBottom?"up":"down")));if(!itemWithLeastDistance&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[innermostIndex])return;itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,!0):this._rearrange(event,null,this.containers[innermostIndex].element,!0),this._trigger("change",event,this._uiHash()),this.containers[innermostIndex]._trigger("change",event,this._uiHash(this)),this.currentContainer=this.containers[innermostIndex],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[innermostIndex]._trigger("over",event,this._uiHash(this)),this.containers[innermostIndex].containerCache.over=1}},_createHelper:function(event){var o=this.options,helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):"clone"===o.helper?this.currentItem.clone():this.currentItem;return helper.parents("body").length||$("parent"!==o.appendTo?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]),helper[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),helper[0].style.width&&!o.forceHelperSize||helper.width(this.currentItem.width()),helper[0].style.height&&!o.forceHelperSize||helper.height(this.currentItem.height()),helper},_adjustOffsetFromHelper:function(obj){"string"==typeof obj&&(obj=obj.split(" ")),$.isArray(obj)&&(obj={left:+obj[0],top:+obj[1]||0}),"left"in obj&&(this.offset.click.left=obj.left+this.margins.left),"right"in obj&&(this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left),"top"in obj&&(this.offset.click.top=obj.top+this.margins.top),"bottom"in obj&&(this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])&&(po.left+=this.scrollParent.scrollLeft(),po.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&$.ui.ie)&&(po={top:0,left:0}),{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var ce,co,over,o=this.options;"parent"===o.containment&&(o.containment=this.helper[0].parentNode),"document"!==o.containment&&"window"!==o.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$("document"===o.containment?document:window).width()-this.helperProportions.width-this.margins.left,($("document"===o.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(o.containment)||(ce=$(o.containment)[0],co=$(o.containment).offset(),over="hidden"!==$(ce).css("overflow"),this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(d,pos){pos||(pos=this.position);var mod="absolute"===d?1:-1,scroll="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,scrollIsRootNode=/(html|body)/i.test(scroll[0].tagName);return{top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():scrollIsRootNode?0:scroll.scrollTop())*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod}},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,pageY=event.pageY,scroll="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,scrollIsRootNode=/(html|body)/i.test(scroll[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(event.pageX-this.offset.click.left<this.containment[0]&&(pageX=this.containment[0]+this.offset.click.left),event.pageY-this.offset.click.top<this.containment[1]&&(pageY=this.containment[1]+this.offset.click.top),event.pageX-this.offset.click.left>this.containment[2]&&(pageX=this.containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>this.containment[3]&&(pageY=this.containment[3]+this.offset.click.top)),o.grid&&(top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1],pageY=this.containment?top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3]?top:top-this.offset.click.top>=this.containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0],pageX=this.containment?left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2]?left:left-this.offset.click.left>=this.containment[0]?left-o.grid[0]:left+o.grid[0]:left)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():scrollIsRootNode?0:scroll.scrollTop()),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())}},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?i.item[0]:i.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){counter===this.counter&&this.refreshPositions(!hardRefresh)})},_clear:function(event,noPropagation){this.reverting=!1;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance))}}for(this.fromOutside&&!noPropagation&&delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||noPropagation||delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash())}),this!==this.currentContainer&&(noPropagation||(delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash())}),delayedTriggers.push(function(c){return function(event){c._trigger("receive",event,this._uiHash(this))}}.call(this,this.currentContainer)),delayedTriggers.push(function(c){return function(event){c._trigger("update",event,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)noPropagation||delayedTriggers.push(delayEvent("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(delayedTriggers.push(delayEvent("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!noPropagation){for(this._trigger("beforeStop",event,this._uiHash()),i=0;i<delayedTriggers.length;i++)delayedTriggers[i].call(this,event);this._trigger("stop",event,this._uiHash())}return this.fromOutside=!1}if(noPropagation||this._trigger("beforeStop",event,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!noPropagation){for(i=0;i<delayedTriggers.length;i++)delayedTriggers[i].call(this,event);this._trigger("stop",event,this._uiHash())}return!(this.fromOutside=!1)},_trigger:function(){!1===$.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(_inst){var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,item:inst.currentItem,sender:_inst?_inst.element:null}}})}(jQuery),window.php||(!function(){if(void 0===this.PHP_JS)var PHP_JS=function(cfgObj){if(!(this instanceof PHP_JS))return new PHP_JS(cfgObj);if(this.window=cfgObj&&cfgObj.window?cfgObj.window:window,this.php_js={},this.php_js.ini={},cfgObj)for(var ini in cfgObj.ini)this.php_js.ini[ini]={},this.php_js.ini[ini].local_value=cfgObj.ini[ini],this.php_js.ini[ini].global_value=cfgObj.ini[ini]};var php_js_shared={};PHP_JS.prototype={constructor:PHP_JS,array_diff:function(arr1){var retArr={},argl=arguments.length,k1="",i=1,k="",arr={};arr1keys:for(k1 in arr1)for(i=1;i<argl;i++){for(k in arr=arguments[i])if(arr[k]===arr1[k1])continue arr1keys;retArr[k1]=arr1[k1]}return retArr},array_intersect:function(arr1){var retArr={},argl=arguments.length,arglm1=argl-1,k1="",arr={},i=0,k="";arr1keys:for(k1 in arr1)arrs:for(i=1;i<argl;i++){for(k in arr=arguments[i])if(arr[k]===arr1[k1]){i===arglm1&&(retArr[k1]=arr1[k1]);continue arrs}continue arr1keys}return retArr},array_keys:function(input,search_value,argStrict){var search=void 0!==search_value,tmp_arr=[],strict=!!argStrict,include=!0,key="";if(input&&"object"==typeof input&&input.change_key_case)return input.keys(search_value,argStrict);for(key in input)input.hasOwnProperty(key)&&(include=!0,search&&(strict&&input[key]!==search_value?include=!1:input[key]!=search_value&&(include=!1)),include&&(tmp_arr[tmp_arr.length]=key));return tmp_arr},array_merge:function(){var arg,args=Array.prototype.slice.call(arguments),argl=args.length,retObj={},k="",argil=0,j=0,i=0,ct=0,toStr=Object.prototype.toString,retArr=!0;for(i=0;i<argl;i++)if("[object Array]"!==toStr.call(args[i])){retArr=!1;break}if(retArr){for(retArr=[],i=0;i<argl;i++)retArr=retArr.concat(args[i]);return retArr}for(ct=i=0;i<argl;i++)if(arg=args[i],"[object Array]"===toStr.call(arg))for(j=0,argil=arg.length;j<argil;j++)retObj[ct++]=arg[j];else for(k in arg)arg.hasOwnProperty(k)&&(parseInt(k,10)+""===k?retObj[ct++]=arg[k]:retObj[k]=arg[k]);return retObj},array_search:function(needle,haystack,argStrict){var strict=!!argStrict,key="";if(haystack&&"object"==typeof haystack&&haystack.change_key_case)return haystack.search(needle,argStrict);if("object"==typeof needle&&needle.exec){if(!strict){var flags="i"+(needle.global?"g":"")+(needle.multiline?"m":"")+(needle.sticky?"y":"");needle=new RegExp(needle.source,flags)}for(key in haystack)if(haystack.hasOwnProperty(key)&&needle.test(haystack[key]))return key;return!1}for(key in haystack)if(haystack.hasOwnProperty(key)&&(strict&&haystack[key]===needle||!strict&&haystack[key]==needle))return key;return!1},array_unique:function(inputArr){var key="",tmp_arr2={},val="",__array_search=function(needle,haystack){var fkey="";for(fkey in haystack)if(haystack.hasOwnProperty(fkey)&&haystack[fkey]+""==needle+"")return fkey;return!1};for(key in inputArr)inputArr.hasOwnProperty(key)&&!1===__array_search(val=inputArr[key],tmp_arr2)&&(tmp_arr2[key]=val);return tmp_arr2},array_values:function(input){var tmp_arr=[],key="";if(input&&"object"==typeof input&&input.change_key_case)return input.values();for(key in input)tmp_arr[tmp_arr.length]=input[key];return tmp_arr},sort:function(inputArr,sort_flags){var strictForIn,valArr=[],k="",i=0,sorter=!1,that=this,populateArr=[];switch(sort_flags){case"SORT_STRING":sorter=function(a,b){return that.strnatcmp(a,b)};break;case"SORT_LOCALE_STRING":var loc=this.i18n_loc_get_default();sorter=this.php_js.i18nLocales[loc].sorting;break;case"SORT_NUMERIC":sorter=function(a,b){return a-b};break;case"SORT_REGULAR":default:sorter=function(a,b){var aFloat=parseFloat(a),bFloat=parseFloat(b),aNumeric=aFloat+""===a,bNumeric=bFloat+""===b;return aNumeric&&bNumeric?bFloat<aFloat?1:aFloat<bFloat?-1:0:aNumeric&&!bNumeric?1:!aNumeric&&bNumeric?-1:b<a?1:a<b?-1:0}}try{this.php_js=this.php_js||{}}catch(e){this.php_js={}}for(k in this.php_js.ini=this.php_js.ini||{},populateArr=(strictForIn=this.php_js.ini["phpjs.strictForIn"]&&this.php_js.ini["phpjs.strictForIn"].local_value&&"off"!==this.php_js.ini["phpjs.strictForIn"].local_value)?inputArr:populateArr,inputArr)inputArr.hasOwnProperty(k)&&(valArr.push(inputArr[k]),strictForIn&&delete inputArr[k]);for(valArr.sort(sorter),i=0;i<valArr.length;i++)populateArr[i]=valArr[i];return strictForIn||populateArr},uasort:function(inputArr,sorter){var strictForIn,valArr=[],k="",i=0,populateArr={};for(k in"string"==typeof sorter?sorter=this[sorter]:"[object Array]"===Object.prototype.toString.call(sorter)&&(sorter=this[sorter[0]][sorter[1]]),this.php_js=this.php_js||{},this.php_js.ini=this.php_js.ini||{},populateArr=(strictForIn=this.php_js.ini["phpjs.strictForIn"]&&this.php_js.ini["phpjs.strictForIn"].local_value&&"off"!==this.php_js.ini["phpjs.strictForIn"].local_value)?inputArr:populateArr,inputArr)inputArr.hasOwnProperty(k)&&(valArr.push([k,inputArr[k]]),strictForIn&&delete inputArr[k]);for(valArr.sort(function(a,b){return sorter(a[1],b[1])}),i=0;i<valArr.length;i++)populateArr[valArr[i][0]]=valArr[i][1];return strictForIn||populateArr},uksort:function(inputArr,sorter){var strictForIn,tmp_arr={},keys=[],i=0,k="",populateArr={};for(k in"string"==typeof sorter&&(sorter=this.window[sorter]),inputArr)inputArr.hasOwnProperty(k)&&keys.push(k);try{sorter?keys.sort(sorter):keys.sort()}catch(e){return!1}for(this.php_js=this.php_js||{},this.php_js.ini=this.php_js.ini||{},populateArr=(strictForIn=this.php_js.ini["phpjs.strictForIn"]&&this.php_js.ini["phpjs.strictForIn"].local_value&&"off"!==this.php_js.ini["phpjs.strictForIn"].local_value)?inputArr:populateArr,i=0;i<keys.length;i++)tmp_arr[k=keys[i]]=inputArr[k],strictForIn&&delete inputArr[k];for(i in tmp_arr)tmp_arr.hasOwnProperty(i)&&(populateArr[i]=tmp_arr[i]);return strictForIn||populateArr},usort:function(inputArr,sorter){var strictForIn,valArr=[],k="",i=0,populateArr={};for(k in"string"==typeof sorter?sorter=this[sorter]:"[object Array]"===Object.prototype.toString.call(sorter)&&(sorter=this[sorter[0]][sorter[1]]),this.php_js=this.php_js||{},this.php_js.ini=this.php_js.ini||{},populateArr=(strictForIn=this.php_js.ini["phpjs.strictForIn"]&&this.php_js.ini["phpjs.strictForIn"].local_value&&"off"!==this.php_js.ini["phpjs.strictForIn"].local_value)?inputArr:populateArr,inputArr)inputArr.hasOwnProperty(k)&&(valArr.push(inputArr[k]),strictForIn&&delete inputArr[k]);try{valArr.sort(sorter)}catch(e){return!1}for(i=0;i<valArr.length;i++)populateArr[i]=valArr[i];return strictForIn||populateArr},in_array:function(needle,haystack,argStrict){var key="";if(!!argStrict){for(key in haystack)if(haystack[key]===needle)return!0}else for(key in haystack)if(haystack[key]==needle)return!0;return!1},is_numeric:function(mixed_var){return("number"==typeof mixed_var||"string"==typeof mixed_var&&-1===" \n\r\t\f\v            ​\u2028\u2029　".indexOf(mixed_var.slice(-1)))&&""!==mixed_var&&!isNaN(mixed_var)},base64_decode:function(data){var o1,o2,o3,h3,h4,bits,b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=0,ac=0,dec="",tmp_arr=[];if(!data)return data;for(data+="";o1=(bits=b64.indexOf(data.charAt(i++))<<18|b64.indexOf(data.charAt(i++))<<12|(h3=b64.indexOf(data.charAt(i++)))<<6|(h4=b64.indexOf(data.charAt(i++))))>>16&255,o2=bits>>8&255,o3=255&bits,tmp_arr[ac++]=64==h3?String.fromCharCode(o1):64==h4?String.fromCharCode(o1,o2):String.fromCharCode(o1,o2,o3),i<data.length;);return dec=tmp_arr.join(""),decodeURIComponent(escape(dec.replace(/\0+$/,"")))},base64_encode:function(data){var h1,h2,h3,h4,bits,b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=0,ac=0,enc="",tmp_arr=[];if(!data)return data;for(data=unescape(encodeURIComponent(data));h1=(bits=data.charCodeAt(i++)<<16|data.charCodeAt(i++)<<8|data.charCodeAt(i++))>>18&63,h2=bits>>12&63,h3=bits>>6&63,h4=63&bits,tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4),i<data.length;);enc=tmp_arr.join("");var r=data.length%3;return(r?enc.slice(0,r-3):enc)+"===".slice(r||3)},date:function(format,timestamp){var jsdate,f,txt_words=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],formatChr=/\\?(.?)/gi,formatChrCb=function(t,s){return f[t]?f[t]():s},_pad=function(n,c){for(n=String(n);n.length<c;)n="0"+n;return n};return f={d:function(){return _pad(f.j(),2)},D:function(){return f.l().slice(0,3)},j:function(){return jsdate.getDate()},l:function(){return txt_words[f.w()]+"day"},N:function(){return f.w()||7},S:function(){var j=f.j(),i=j%10;return i<=3&&1==parseInt(j%100/10,10)&&(i=0),["st","nd","rd"][i-1]||"th"},w:function(){return jsdate.getDay()},z:function(){var a=new Date(f.Y(),f.n()-1,f.j()),b=new Date(f.Y(),0,1);return Math.round((a-b)/864e5)},W:function(){var a=new Date(f.Y(),f.n()-1,f.j()-f.N()+3),b=new Date(a.getFullYear(),0,4);return _pad(1+Math.round((a-b)/864e5/7),2)},F:function(){return txt_words[6+f.n()]},m:function(){return _pad(f.n(),2)},M:function(){return f.F().slice(0,3)},n:function(){return jsdate.getMonth()+1},t:function(){return new Date(f.Y(),f.n(),0).getDate()},L:function(){var j=f.Y();return j%4==0&j%100!=0|j%400==0},o:function(){var n=f.n(),W=f.W();return f.Y()+(12===n&&W<9?1:1===n&&9<W?-1:0)},Y:function(){return jsdate.getFullYear()},y:function(){return f.Y().toString().slice(-2)},a:function(){return 11<jsdate.getHours()?"pm":"am"},A:function(){return f.a().toUpperCase()},B:function(){var H=3600*jsdate.getUTCHours(),i=60*jsdate.getUTCMinutes(),s=jsdate.getUTCSeconds();return _pad(Math.floor((H+i+s+3600)/86.4)%1e3,3)},g:function(){return f.G()%12||12},G:function(){return jsdate.getHours()},h:function(){return _pad(f.g(),2)},H:function(){return _pad(f.G(),2)},i:function(){return _pad(jsdate.getMinutes(),2)},s:function(){return _pad(jsdate.getSeconds(),2)},u:function(){return _pad(1e3*jsdate.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){return new Date(f.Y(),0)-Date.UTC(f.Y(),0)!=new Date(f.Y(),6)-Date.UTC(f.Y(),6)?1:0},O:function(){var tzo=jsdate.getTimezoneOffset(),a=Math.abs(tzo);return(0<tzo?"-":"+")+_pad(100*Math.floor(a/60)+a%60,4)},P:function(){var O=f.O();return O.substr(0,3)+":"+O.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-jsdate.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(formatChr,formatChrCb)},r:function(){return"D, d M Y H:i:s O".replace(formatChr,formatChrCb)},U:function(){return jsdate/1e3|0}},this.date=function(format,timestamp){return this,jsdate=timestamp===undefined?new Date:timestamp instanceof Date?new Date(timestamp):new Date(1e3*timestamp),format.replace(formatChr,formatChrCb)},this.date(format,timestamp)},date_parse:function(date){this.php_js=this.php_js||{};var ts,warningsOffset=this.php_js.warnings?this.php_js.warnings.length:null,errorsOffset=this.php_js.errors?this.php_js.errors.length:null;try{this.php_js.date_parse_state=!0,ts=this.strtotime(date),this.php_js.date_parse_state=!1}finally{if(!ts)return!1}var dt=new Date(1e3*ts),retObj={warning_count:null!==warningsOffset?this.php_js.warnings.slice(warningsOffset).length:0,warnings:null!==warningsOffset?this.php_js.warnings.slice(warningsOffset):[],error_count:null!==errorsOffset?this.php_js.errors.slice(errorsOffset).length:0,errors:null!==errorsOffset?this.php_js.errors.slice(errorsOffset):[]};return retObj.year=dt.getFullYear(),retObj.month=dt.getMonth()+1,retObj.day=dt.getDate(),retObj.hour=dt.getHours(),retObj.minute=dt.getMinutes(),retObj.second=dt.getSeconds(),retObj.fraction=parseFloat("0."+dt.getMilliseconds()),retObj.is_localtime=0!==dt.getTimezoneOffset(),retObj},number_format:function(number,decimals,dec_point,thousands_sep){number=(number+"").replace(/[^0-9+\-Ee.]/g,"");var n=isFinite(+number)?+number:0,prec=isFinite(+decimals)?Math.abs(decimals):0,sep=void 0===thousands_sep?",":thousands_sep,dec=void 0===dec_point?".":dec_point,s="";return 3<(s=(prec?function(n,prec){var k=Math.pow(10,prec);return""+(Math.round(n*k)/k).toFixed(prec)}(n,prec):""+Math.round(n)).split("."))[0].length&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,sep)),(s[1]||"").length<prec&&(s[1]=s[1]||"",s[1]+=new Array(prec-s[1].length+1).join("0")),s.join(dec)},parse_str:function(str,array){var i,j,ct,p,lastObj,obj,chr,tmp,key,value,postLeftBracketPos,keys,keysLen,strArr=String(str).replace(/^&/,"").replace(/&$/,"").split("&"),sal=strArr.length,fixStr=function(str){return decodeURIComponent(str.replace(/\+/g,"%20"))};for(array||(array=this.window),i=0;i<sal;i++){for(key=fixStr((tmp=strArr[i].split("="))[0]),value=tmp.length<2?"":fixStr(tmp[1]);" "===key.charAt(0);)key=key.slice(1);if(-1<key.indexOf("\0")&&(key=key.slice(0,key.indexOf("\0"))),key&&"["!==key.charAt(0)){for(keys=[],j=postLeftBracketPos=0;j<key.length;j++)if("["!==key.charAt(j)||postLeftBracketPos){if("]"===key.charAt(j)&&postLeftBracketPos&&(keys.length||keys.push(key.slice(0,postLeftBracketPos-1)),keys.push(key.substr(postLeftBracketPos,j-postLeftBracketPos)),postLeftBracketPos=0,"["!==key.charAt(j+1)))break}else postLeftBracketPos=j+1;for(keys.length||(keys=[key]),j=0;j<keys[0].length&&(" "!==(chr=keys[0].charAt(j))&&"."!==chr&&"["!==chr||(keys[0]=keys[0].substr(0,j)+"_"+keys[0].substr(j+1)),"["!==chr);j++);for(obj=array,j=0,keysLen=keys.length;j<keysLen;j++)if(key=keys[j].replace(/^['"]/,"").replace(/['"]$/,""),j!==keys.length-1,lastObj=obj,""!==key&&" "!==key||0===j)void 0===obj[key]&&(obj[key]={}),obj=obj[key];else{for(p in ct=-1,obj)obj.hasOwnProperty(p)&&ct<+p&&p.match(/^\d+$/g)&&(ct=+p);key=ct+1}lastObj[key]=value}}},parse_url:function(str,component){try{this.php_js=this.php_js||{}}catch(e){this.php_js={}}for(var ini=this.php_js&&this.php_js.ini||{},mode=ini["phpjs.parse_url.mode"]&&ini["phpjs.parse_url.mode"].local_value||"php",key=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],parser={php:/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/\/?)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/},m=parser[mode].exec(str),uri={},i=14;i--;)m[i]&&(uri[key[i]]=m[i]);if(component)return uri[component.replace("PHP_URL_","").toLowerCase()];if("php"!==mode){var name=ini["phpjs.parse_url.queryKey"]&&ini["phpjs.parse_url.queryKey"].local_value||"queryKey";parser=/(?:^|&)([^&=]*)=?([^&]*)/g,uri[name]={},(uri[key[12]]||"").replace(parser,function($0,$1,$2){$1&&(uri[name][$1]=$2)})}return delete uri.source,uri},preg_grep:function(pattern,input,flags){var p="",retObj={},invert=1===flags||"PREG_GREP_INVERT"===flags;if("string"==typeof pattern&&(pattern=eval(pattern)),invert)for(p in input)-1===(input[p]+"").search(pattern)&&(retObj[p]=input[p]);else for(p in input)-1!==(input[p]+"").search(pattern)&&(retObj[p]=input[p]);return retObj},preg_quote:function(str,delimiter){return String(str).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(delimiter||"")+"-]","g"),"\\$&")},sprintf:function(){var a=arguments,i=0,format=a[i++],pad=function(str,len,chr,leftJustify){chr||(chr=" ");var padding=str.length>=len?"":new Array(1+len-str.length>>>0).join(chr);return leftJustify?str+padding:padding+str},justify=function(value,prefix,leftJustify,minWidth,zeroPad,customPadChar){var diff=minWidth-value.length;return 0<diff&&(value=leftJustify||!zeroPad?pad(value,minWidth,customPadChar,leftJustify):value.slice(0,prefix.length)+pad("",diff,"0",!0)+value.slice(prefix.length)),value},formatBaseX=function(value,base,prefix,leftJustify,minWidth,precision,zeroPad){var number=value>>>0;return value=(prefix=prefix&&number&&{2:"0b",8:"0",16:"0x"}[base]||"")+pad(number.toString(base),precision||0,"0",!1),justify(value,prefix,leftJustify,minWidth,zeroPad)},formatString=function(value,leftJustify,minWidth,precision,zeroPad,customPadChar){return null!==precision&&precision!==undefined&&(value=value.slice(0,precision)),justify(value,"",leftJustify,minWidth,zeroPad,customPadChar)};return format.replace(/%%|%(\d+\$)?([\-+\'#0 ]*)(\*\d+\$|\*|\d+)?(?:\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,function(substring,valueIndex,flags,minWidth,precision,type){var number,prefix,method,textTransform,value;if("%%"===substring)return"%";var j,leftJustify=!1,positivePrefix="",zeroPad=!1,prefixBaseX=!1,customPadChar=" ",flagsl=flags.length;for(j=0;flags&&j<flagsl;j++)switch(flags.charAt(j)){case" ":positivePrefix=" ";break;case"+":positivePrefix="+";break;case"-":leftJustify=!0;break;case"'":customPadChar=flags.charAt(j+1);break;case"0":zeroPad=!0,customPadChar="0";break;case"#":prefixBaseX=!0}if((minWidth=minWidth?"*"===minWidth?+a[i++]:"*"===minWidth.charAt(0)?+a[minWidth.slice(1,-1)]:+minWidth:0)<0&&(minWidth=-minWidth,leftJustify=!0),!isFinite(minWidth))throw new Error("sprintf: (minimum-)width must be finite");switch(precision=precision?"*"===precision?+a[i++]:"*"===precision.charAt(0)?+a[precision.slice(1,-1)]:+precision:-1<"fFeE".indexOf(type)?6:"d"===type?0:undefined,value=valueIndex?a[valueIndex.slice(0,-1)]:a[i++],type){case"s":return formatString(String(value),leftJustify,minWidth,precision,zeroPad,customPadChar);case"c":return formatString(String.fromCharCode(+value),leftJustify,minWidth,precision,zeroPad);case"b":return formatBaseX(value,2,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case"o":return formatBaseX(value,8,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case"x":return formatBaseX(value,16,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case"X":return formatBaseX(value,16,prefixBaseX,leftJustify,minWidth,precision,zeroPad).toUpperCase();case"u":return formatBaseX(value,10,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case"i":case"d":return number=+value||0,value=(prefix=(number=Math.round(number-number%1))<0?"-":positivePrefix)+pad(String(Math.abs(number)),precision,"0",!1),justify(value,prefix,leftJustify,minWidth,zeroPad);case"e":case"E":case"f":case"F":case"g":case"G":return prefix=(number=+value)<0?"-":positivePrefix,method=["toExponential","toFixed","toPrecision"]["efg".indexOf(type.toLowerCase())],textTransform=["toString","toUpperCase"]["eEfFgG".indexOf(type)%2],value=prefix+Math.abs(number)[method](precision),justify(value,prefix,leftJustify,minWidth,zeroPad)[textTransform]();default:return substring}})},strtotime:function(text,now){var parsed,match,today,year,date,days,ranges,len,times,i;if(!text)return!1;if((match=(text=text.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase()).match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/))&&match[2]===match[4])if(1901<match[1])switch(match[2]){case"-":return!(12<match[3]||31<match[5])&&new Date(match[1],parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1e3;case".":return!1;case"/":return!(12<match[3]||31<match[5])&&new Date(match[1],parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1e3}else if(1901<match[5])switch(match[2]){case"-":case".":return!(12<match[3]||31<match[1])&&new Date(match[5],parseInt(match[3],10)-1,match[1],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1e3;case"/":return!(12<match[1]||31<match[3])&&new Date(match[5],parseInt(match[1],10)-1,match[3],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1e3}else switch(match[2]){case"-":return!(12<match[3]||31<match[5]||match[1]<70&&38<match[1])&&(year=0<=match[1]&&match[1]<=38?+match[1]+2e3:match[1],new Date(year,parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1e3);case".":return 70<=match[5]?!(12<match[3]||31<match[1])&&new Date(match[5],parseInt(match[3],10)-1,match[1],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1e3:match[5]<60&&!match[6]&&(!(23<match[1]||59<match[3])&&(today=new Date,new Date(today.getFullYear(),today.getMonth(),today.getDate(),match[1]||0,match[3]||0,match[5]||0,match[9]||0)/1e3));case"/":return!(12<match[1]||31<match[3]||match[5]<70&&38<match[5])&&(year=0<=match[5]&&match[5]<=38?+match[5]+2e3:match[5],new Date(year,parseInt(match[1],10)-1,match[3],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1e3);case":":return!(23<match[1]||59<match[3]||59<match[5])&&(today=new Date,new Date(today.getFullYear(),today.getMonth(),today.getDate(),match[1]||0,match[3]||0,match[5]||0)/1e3)}if("now"===text)return null===now||isNaN(now)?(new Date).getTime()/1e3|0:0|now;if(!isNaN(parsed=Date.parse(text)))return parsed/1e3|0;if((match=text.match(/^([0-9]{4}-[0-9]{2}-[0-9]{2})[ t]([0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?)([\+-][0-9]{2}(:[0-9]{2})?|z)/))&&("z"==match[4]?match[4]="Z":match[4].match(/^([\+-][0-9]{2})$/)&&(match[4]=match[4]+":00"),!isNaN(parsed=Date.parse(match[1]+"T"+match[2]+match[4]))))return parsed/1e3|0;function process(val){var splt=val.split(" "),type=splt[0],range=splt[1].substring(0,3),typeIsNumber=/\d+/.test(type),num=("last"===type?-1:1)*("ago"===splt[2]?-1:1);if(typeIsNumber&&(num*=parseInt(type,10)),ranges.hasOwnProperty(range)&&!splt[1].match(/^mon(day|\.)?$/i))return date["set"+ranges[range]](date["get"+ranges[range]]()+num);if("wee"===range)return date.setDate(date.getDate()+7*num);if("next"===type||"last"===type)!function(type,range,modifier){var diff,day=days[range];void 0!==day&&(0==(diff=day-date.getDay())?diff=7*modifier:0<diff&&"last"===type?diff-=7:diff<0&&"next"===type&&(diff+=7),date.setDate(date.getDate()+diff))}(type,range,num);else if(!typeIsNumber)return!1;return!0}if(date=now?new Date(1e3*now):new Date,days={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},ranges={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},"([+-]?\\d+\\s"+(times="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)")+"|(last|next)\\s"+times+")(\\sago)?",!(match=text.match(new RegExp("([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)|(last|next)\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?))(\\sago)?","gi"))))return!1;for(i=0,len=match.length;i<len;i++)if(!process(match[i]))return!1;return date.getTime()/1e3},trim:function(str,charlist){var whitespace,l=0,i=0;for(str+="",whitespace=charlist?(charlist+="").replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,"$1"):" \n\r\t\f\v            ​\u2028\u2029　",l=str.length,i=0;i<l;i++)if(-1===whitespace.indexOf(str.charAt(i))){str=str.substring(i);break}for(i=(l=str.length)-1;0<=i;i--)if(-1===whitespace.indexOf(str.charAt(i))){str=str.substring(0,i+1);break}return-1===whitespace.indexOf(str.charAt(0))?str:""},uniqid:function(prefix,more_entropy){var retId;void 0===prefix&&(prefix="");var formatSeed=function(seed,reqWidth){return reqWidth<(seed=parseInt(seed,10).toString(16)).length?seed.slice(seed.length-reqWidth):reqWidth>seed.length?Array(reqWidth-seed.length+1).join("0")+seed:seed};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,retId=prefix,retId+=formatSeed(parseInt((new Date).getTime()/1e3,10),8),retId+=formatSeed(this.php_js.uniqidSeed,5),more_entropy&&(retId+=(10*Math.random()).toFixed(8).toString()),retId},urldecode:function(str){return decodeURIComponent((str+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))},urlencode:function(str){return str=(str+"").toString(),encodeURIComponent(str).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},utf8_decode:function(str_data){var tmp_arr=[],i=0,c1=0,seqlen=0;for(str_data+="";i<str_data.length;){seqlen=0,seqlen=(c1=255&str_data.charCodeAt(i))<=191?(c1&=127,1):c1<=223?(c1&=31,2):c1<=239?(c1&=15,3):(c1&=7,4);for(var ai=1;ai<seqlen;++ai)c1=c1<<6|63&str_data.charCodeAt(ai+i);4==seqlen?(c1-=65536,tmp_arr.push(String.fromCharCode(55296|c1>>10&1023),String.fromCharCode(56320|1023&c1))):tmp_arr.push(String.fromCharCode(c1)),i+=seqlen}return tmp_arr.join("")},utf8_encode:function(argString){if(null==argString)return"";var start,end,stringl,string=argString+"",utftext="";start=end=0,stringl=string.length;for(var n=0;n<stringl;n++){var c1=string.charCodeAt(n),enc=null;if(c1<128)end++;else if(127<c1&&c1<2048)enc=String.fromCharCode(c1>>6|192,63&c1|128);else if(55296!=(63488&c1))enc=String.fromCharCode(c1>>12|224,c1>>6&63|128,63&c1|128);else{if(55296!=(64512&c1))throw new RangeError("Unmatched trail surrogate at "+n);var c2=string.charCodeAt(++n);if(56320!=(64512&c2))throw new RangeError("Unmatched lead surrogate at "+(n-1));c1=((1023&c1)<<10)+(1023&c2)+65536,enc=String.fromCharCode(c1>>18|240,c1>>12&63|128,c1>>6&63|128,63&c1|128)}null!==enc&&(start<end&&(utftext+=string.slice(start,end)),utftext+=enc,start=end=n+1)}return start<end&&(utftext+=string.slice(start,stringl)),utftext},min:function(){var ar,retVal,n,i=0,argv=arguments,argc=argv.length,_obj2Array=function(obj){if("[object Array]"===Object.prototype.toString.call(obj))return obj;var ar=[];for(var i in obj)obj.hasOwnProperty(i)&&ar.push(obj[i]);return ar},_compare=function(current,next){var i=0,n=0,tmp=0,nl=0,cl=0;if(current===next)return 0;if("object"!=typeof current)return"object"==typeof next?1:isNaN(next)&&!isNaN(current)?0==current?0:current<0?1:-1:isNaN(current)&&!isNaN(next)?0==next?0:0<next?1:-1:next==current?0:current<next?1:-1;if("object"!=typeof next)return-1;if(current=_obj2Array(current),next=_obj2Array(next),(cl=current.length)<(nl=next.length))return 1;if(nl<cl)return-1;for(i=0,n=cl;i<n;++i){if(1==(tmp=_compare(current[i],next[i])))return 1;if(-1==tmp)return-1}return 0};if(0===argc)throw new Error("At least one value should be passed to min()");if(1===argc){if("object"!=typeof argv[0])throw new Error("Wrong parameter count for min()");if(0===(ar=_obj2Array(argv[0])).length)throw new Error("Array must contain at least one element for min()")}else ar=argv;for(retVal=ar[0],i=1,n=ar.length;i<n;++i)-1==_compare(retVal,ar[i])&&(retVal=ar[i]);return retVal},max:function(){var ar,retVal,n,i=0,argv=arguments,argc=argv.length,_obj2Array=function(obj){if("[object Array]"===Object.prototype.toString.call(obj))return obj;var ar=[];for(var i in obj)obj.hasOwnProperty(i)&&ar.push(obj[i]);return ar},_compare=function(current,next){var i=0,n=0,tmp=0,nl=0,cl=0;if(current===next)return 0;if("object"!=typeof current)return"object"==typeof next?1:isNaN(next)&&!isNaN(current)?0==current?0:current<0?1:-1:isNaN(current)&&!isNaN(next)?0==next?0:0<next?1:-1:next==current?0:current<next?1:-1;if("object"!=typeof next)return-1;if(current=_obj2Array(current),next=_obj2Array(next),(cl=current.length)<(nl=next.length))return 1;if(nl<cl)return-1;for(i=0,n=cl;i<n;++i){if(1==(tmp=_compare(current[i],next[i])))return 1;if(-1==tmp)return-1}return 0};if(0===argc)throw new Error("At least one value should be passed to max()");if(1===argc){if("object"!=typeof argv[0])throw new Error("Wrong parameter count for max()");if(0===(ar=_obj2Array(argv[0])).length)throw new Error("Array must contain at least one element for max()")}else ar=argv;for(retVal=ar[0],i=1,n=ar.length;i<n;++i)1==_compare(retVal,ar[i])&&(retVal=ar[i]);return retVal},log10:function(arg){return Math.log(arg)/2.302585092994046},htmlspecialchars:function(string,quote_style,charset,double_encode){var optTemp=0,i=0,noquotes=!1;null==quote_style&&(quote_style=2),string=(string=string||"").toString(),!1!==double_encode&&(string=string.replace(/&/g,"&amp;")),string=string.replace(/</g,"&lt;").replace(/>/g,"&gt;");var OPTS={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===quote_style&&(noquotes=!0),"number"!=typeof quote_style){for(quote_style=[].concat(quote_style),i=0;i<quote_style.length;i++)0===OPTS[quote_style[i]]?noquotes=!0:OPTS[quote_style[i]]&&(optTemp|=OPTS[quote_style[i]]);quote_style=optTemp}return quote_style&OPTS.ENT_HTML_QUOTE_SINGLE&&(string=string.replace(/'/g,"&#039;")),noquotes||(string=string.replace(/"/g,"&quot;")),string},htmlspecialchars_decode:function(string,quote_style){var optTemp=0,i=0,noquotes=!1;void 0===quote_style&&(quote_style=2),string=string.toString().replace(/&lt;/g,"<").replace(/&gt;/g,">");var OPTS={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===quote_style&&(noquotes=!0),"number"!=typeof quote_style){for(quote_style=[].concat(quote_style),i=0;i<quote_style.length;i++)0===OPTS[quote_style[i]]?noquotes=!0:OPTS[quote_style[i]]&&(optTemp|=OPTS[quote_style[i]]);quote_style=optTemp}return quote_style&OPTS.ENT_HTML_QUOTE_SINGLE&&(string=string.replace(/&#0*39;/g,"'")),noquotes||(string=string.replace(/&quot;/g,'"')),string=string.replace(/&amp;/g,"&")}},this.PHP_JS=PHP_JS}(),window.php=new PHP_JS),function($){var counter,_={isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(obj){return"string"==typeof obj},isNumber:function(obj){return"number"==typeof obj},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return void 0===obj},bind:$.proxy,each:function(collection,cb){$.each(collection,function(index,value){return cb(value,index)})},map:$.map,filter:$.grep,every:function(obj,test){var result=!0;return obj?($.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj)))return!1}),!!result):result},some:function(obj,test){var result=!1;return obj?($.each(obj,function(key,val){if(result=test.call(null,val,key,obj))return!1}),!!result):result},mixin:$.extend,getUniqueId:(counter=0,function(){return counter++}),templatify:function(obj){return $.isFunction(obj)?obj:function(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},debounce:function(func,wait,immediate){var timeout,result;return function(){var later,callNow,context=this,args=arguments;return later=function(){timeout=null,immediate||(result=func.apply(context,args))},callNow=immediate&&!timeout,clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&(result=func.apply(context,args)),result}},throttle:function(func,wait){var context,args,timeout,result,previous,later;return previous=0,later=function(){previous=new Date,timeout=null,result=func.apply(context,args)},function(){var now=new Date,remaining=wait-(now-previous);return context=this,args=arguments,remaining<=0?(clearTimeout(timeout),timeout=null,previous=now,result=func.apply(context,args)):timeout||(timeout=setTimeout(later,remaining)),result}},noop:function(){}},tokenizers=function(root){return{nonword:nonword,whitespace:whitespace,obj:{nonword:getObjTokenizer(nonword),whitespace:getObjTokenizer(whitespace)}};function whitespace(s){return s.split(/\s+/)}function nonword(s){return s.split(/\W+/)}function getObjTokenizer(tokenizer){return function(key){return function(o){return tokenizer(o[key])}}}}(),LruCache=function(){function LruCache(maxSize){this.maxSize=maxSize||100,this.size=0,this.hash={},this.list=new List}function List(){this.head=this.tail=null}function Node(key,val){this.key=key,this.val=val,this.prev=this.next=null}return _.mixin(LruCache.prototype,{set:function(key,val){var node,tailItem=this.list.tail;this.size>=this.maxSize&&(this.list.remove(tailItem),delete this.hash[tailItem.key]),(node=this.hash[key])?(node.val=val,this.list.moveToFront(node)):(node=new Node(key,val),this.list.add(node),this.hash[key]=node,this.size++)},get:function(key){var node=this.hash[key];if(node)return this.list.moveToFront(node),node.val}}),_.mixin(List.prototype,{add:function(node){this.head&&(node.next=this.head,this.head.prev=node),this.head=node,this.tail=this.tail||node},remove:function(node){node.prev?node.prev.next=node.next:this.head=node.next,node.next?node.next.prev=node.prev:this.tail=node.prev},moveToFront:function(node){this.remove(node),this.add(node)}}),LruCache}(),PersistentStorage=function(){var ls,methods;try{(ls=window.localStorage).setItem("~~~","!"),ls.removeItem("~~~")}catch(err){ls=null}function PersistentStorage(namespace){this.prefix=["__",namespace,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+this.prefix)}return methods=ls&&window.JSON?{_prefix:function(key){return this.prefix+key},_ttlKey:function(key){return this._prefix(key)+this.ttlKey},get:function(key){return this.isExpired(key)&&this.remove(key),decode(ls.getItem(this._prefix(key)))},set:function(key,val,ttl){return _.isNumber(ttl)?ls.setItem(this._ttlKey(key),encode(now()+ttl)):ls.removeItem(this._ttlKey(key)),ls.setItem(this._prefix(key),encode(val))},remove:function(key){return ls.removeItem(this._ttlKey(key)),ls.removeItem(this._prefix(key)),this},clear:function(){var i,key,keys=[],len=ls.length;for(i=0;i<len;i++)(key=ls.key(i)).match(this.keyMatcher)&&keys.push(key.replace(this.keyMatcher,""));for(i=keys.length;i--;)this.remove(keys[i]);return this},isExpired:function(key){var ttl=decode(ls.getItem(this._ttlKey(key)));return!!(_.isNumber(ttl)&&now()>ttl)}}:{get:_.noop,set:_.noop,remove:_.noop,clear:_.noop,isExpired:_.noop},_.mixin(PersistentStorage.prototype,methods),PersistentStorage;function now(){return(new Date).getTime()}function encode(val){return JSON.stringify(_.isUndefined(val)?null:val)}function decode(val){return JSON.parse(val)}}(),Transport=function(){var pendingRequestsCount=0,pendingRequests={},maxPendingRequests=6,requestCache=new LruCache(10);function Transport(o){var fn;o=o||{},this._send=o.transport?(fn=o.transport,function(url,o){var deferred=$.Deferred();return fn(url,o,function(resp){_.defer(function(){deferred.resolve(resp)})},function(err){_.defer(function(){deferred.reject(err)})}),deferred}):$.ajax,this._get=o.rateLimiter?o.rateLimiter(this._get):this._get}return Transport.setMaxPendingRequests=function(num){maxPendingRequests=num},Transport.resetCache=function(){requestCache=new LruCache(10)},_.mixin(Transport.prototype,{_get:function(url,o,cb){var jqXhr,that=this;function done(resp){cb&&cb(null,resp),requestCache.set(url,resp)}function fail(){cb&&cb(!0)}(jqXhr=pendingRequests[url])?jqXhr.done(done).fail(fail):pendingRequestsCount<maxPendingRequests?(pendingRequestsCount++,pendingRequests[url]=this._send(url,o).done(done).fail(fail).always(function(){pendingRequestsCount--,delete pendingRequests[url],that.onDeckRequestArgs&&(that._get.apply(that,that.onDeckRequestArgs),that.onDeckRequestArgs=null)})):this.onDeckRequestArgs=[].slice.call(arguments,0)},get:function(url,o,cb){var resp;return _.isFunction(o)&&(cb=o,o={}),(resp=requestCache.get(url))?_.defer(function(){cb&&cb(null,resp)}):this._get(url,o,cb),!!resp}}),Transport}(),SearchIndex=function(){function SearchIndex(o){(o=o||{}).datumTokenizer&&o.queryTokenizer||$.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=o.datumTokenizer,this.queryTokenizer=o.queryTokenizer,this.reset()}return _.mixin(SearchIndex.prototype,{bootstrap:function(o){this.datums=o.datums,this.trie=o.trie},add:function(data){var that=this;data=_.isArray(data)?data:[data],_.each(data,function(datum){var id,tokens;id=that.datums.push(datum)-1,tokens=normalizeTokens(that.datumTokenizer(datum)),_.each(tokens,function(token){var node,chars,ch;for(node=that.trie,chars=token.split("");ch=chars.shift();)(node=node.children[ch]||(node.children[ch]={ids:[],children:{}})).ids.push(id)})})},get:function(query){var tokens,matches,that=this;return tokens=normalizeTokens(this.queryTokenizer(query)),_.each(tokens,function(token){var node,chars,ch,ids;if(matches&&0===matches.length)return!1;for(node=that.trie,chars=token.split("");node&&(ch=chars.shift());)node=node.children[ch];if(!node||0!==chars.length)return!(matches=[]);ids=node.ids.slice(0),matches=matches?function(arrayA,arrayB){var ai=0,bi=0,intersection=[];arrayA=arrayA.sort(compare),arrayB=arrayB.sort(compare);for(;ai<arrayA.length&&bi<arrayB.length;)arrayA[ai]<arrayB[bi]?ai++:(arrayA[ai]>arrayB[bi]||(intersection.push(arrayA[ai]),ai++),bi++);return intersection;function compare(a,b){return a-b}}(matches,ids):ids}),matches?_.map(function(array){for(var seen={},uniques=[],i=0;i<array.length;i++)seen[array[i]]||(seen[array[i]]=!0,uniques.push(array[i]));return uniques}(matches),function(id){return that.datums[id]}):[]},reset:function(){this.datums=[],this.trie={ids:[],children:{}}},serialize:function(){return{datums:this.datums,trie:this.trie}}}),SearchIndex;function normalizeTokens(tokens){return tokens=_.filter(tokens,function(token){return!!token}),tokens=_.map(tokens,function(token){return token.toLowerCase()})}}(),oParser={local:function(o){return o.local||null},prefetch:function(o){var prefetch,defaults;return defaults={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(prefetch=o.prefetch||null)&&(prefetch=_.isString(prefetch)?{url:prefetch}:prefetch,(prefetch=_.mixin(defaults,prefetch)).thumbprint="0.10.2"+prefetch.thumbprint,prefetch.ajax.type=prefetch.ajax.type||"GET",prefetch.ajax.dataType=prefetch.ajax.dataType||"json",!prefetch.url&&$.error("prefetch requires url to be set")),prefetch},remote:function(o){var remote,defaults,wait;return defaults={url:null,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(remote=o.remote||null)&&(remote=_.isString(remote)?{url:remote}:remote,(remote=_.mixin(defaults,remote)).rateLimiter=/^throttle$/i.test(remote.rateLimitBy)?(wait=remote.rateLimitWait,function(fn){return _.throttle(fn,wait)}):function(wait){return function(fn){return _.debounce(fn,wait)}}(remote.rateLimitWait),remote.ajax.type=remote.ajax.type||"GET",remote.ajax.dataType=remote.ajax.dataType||"json",delete remote.rateLimitBy,delete remote.rateLimitWait,!remote.url&&$.error("remote requires url to be set")),remote}};!function(root){var old,keys;function Bloodhound(o){var sortFn;o&&(o.local||o.prefetch||o.remote)||$.error("one of local, prefetch, or remote is required"),this.limit=o.limit||5,this.sorter=(sortFn=o.sorter,_.isFunction(sortFn)?function(array){return array.sort(sortFn)}:function(array){return array}),this.dupDetector=o.dupDetector||ignoreDuplicates,this.local=oParser.local(o),this.prefetch=oParser.prefetch(o),this.remote=oParser.remote(o),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new SearchIndex({datumTokenizer:o.datumTokenizer,queryTokenizer:o.queryTokenizer}),this.storage=this.cacheKey?new PersistentStorage(this.cacheKey):null}return old=root.Bloodhound,keys={data:"data",protocol:"protocol",thumbprint:"thumbprint"},(root.Bloodhound=Bloodhound).noConflict=function(){return root.Bloodhound=old,Bloodhound},Bloodhound.tokenizers=tokenizers,_.mixin(Bloodhound.prototype,{_loadPrefetch:function(o){var serialized,that=this;return(serialized=this._readFromStorage(o.thumbprint))?(this.index.bootstrap(serialized),$.Deferred().resolve()):$.ajax(o.url,o.ajax).done(function(resp){that.clear(),that.add(o.filter?o.filter(resp):resp),that._saveToStorage(that.index.serialize(),o.thumbprint,o.ttl)})},_getFromRemote:function(query,cb){var url,uriEncodedQuery,that=this;return query=query||"",uriEncodedQuery=encodeURIComponent(query),url=this.remote.replace?this.remote.replace(this.remote.url,query):this.remote.url.replace(this.remote.wildcard,uriEncodedQuery),this.transport.get(url,this.remote.ajax,function(err,resp){cb(err?[]:that.remote.filter?that.remote.filter(resp):resp)})},_saveToStorage:function(data,thumbprint,ttl){this.storage&&(this.storage.set(keys.data,data,ttl),this.storage.set(keys.protocol,location.protocol,ttl),this.storage.set(keys.thumbprint,thumbprint,ttl))},_readFromStorage:function(thumbprint){var isExpired,stored={};return this.storage&&(stored.data=this.storage.get(keys.data),stored.protocol=this.storage.get(keys.protocol),stored.thumbprint=this.storage.get(keys.thumbprint)),isExpired=stored.thumbprint!==thumbprint||stored.protocol!==location.protocol,stored.data&&!isExpired?stored.data:null},_initialize:function(){var deferred,that=this,local=this.local;return deferred=this.prefetch?this._loadPrefetch(this.prefetch):$.Deferred().resolve(),local&&deferred.done(function(){that.add(_.isFunction(local)?local():local)}),this.transport=this.remote?new Transport(this.remote):null,this.initPromise=deferred.promise()},initialize:function(force){return!this.initPromise||force?this._initialize():this.initPromise},add:function(data){this.index.add(data)},get:function(query,cb){var that=this,matches=[],cacheHit=!1;matches=this.index.get(query),(matches=this.sorter(matches).slice(0,this.limit)).length<this.limit&&this.transport&&(cacheHit=this._getFromRemote(query,function(remoteMatches){var matchesWithBackfill=matches.slice(0);_.each(remoteMatches,function(remoteMatch){return!_.some(matchesWithBackfill,function(match){return that.dupDetector(remoteMatch,match)})&&matchesWithBackfill.push(remoteMatch),matchesWithBackfill.length<that.limit}),cb&&cb(that.sorter(matchesWithBackfill))})),cacheHit||(0<matches.length||!this.transport)&&cb&&cb(matches)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&Transport.resetCache()},ttAdapter:function(){return _.bind(this.get,this)}});function ignoreDuplicates(){return!1}}(this);var html={wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'},css={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};_.isMsie()&&_.mixin(css.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),_.isMsie()&&_.isMsie()<=7&&_.mixin(css.input,{marginTop:"-1px"});var doc,defaults,old,methods,EventBus=function(){function EventBus(o){o&&o.el||$.error("EventBus initialized without el"),this.$el=$(o.el)}return _.mixin(EventBus.prototype,{trigger:function(type){var args=[].slice.call(arguments,1);this.$el.trigger("typeahead:"+type,args)}}),EventBus}(),EventEmitter=function(){var splitter=/\s+/,nextTick=function(){var nextTickFn;nextTickFn=window.setImmediate?function(fn){setImmediate(function(){fn()})}:function(fn){setTimeout(function(){fn()},0)};return nextTickFn}();return{onSync:function(types,cb,context){return on.call(this,"sync",types,cb,context)},onAsync:function(types,cb,context){return on.call(this,"async",types,cb,context)},off:function(types){var type;if(!this._callbacks)return this;types=types.split(splitter);for(;type=types.shift();)delete this._callbacks[type];return this},trigger:function(types){var type,callbacks,args,syncFlush,asyncFlush;if(!this._callbacks)return this;types=types.split(splitter),args=[].slice.call(arguments,1);for(;(type=types.shift())&&(callbacks=this._callbacks[type]);)syncFlush=getFlush(callbacks.sync,this,[type].concat(args)),asyncFlush=getFlush(callbacks.async,this,[type].concat(args)),syncFlush()&&nextTick(asyncFlush);return this}};function on(method,types,cb,context){var type;if(!cb)return this;for(types=types.split(splitter),cb=context?function(fn,context){return fn.bind?fn.bind(context):function(){fn.apply(context,[].slice.call(arguments,0))}}(cb,context):cb,this._callbacks=this._callbacks||{};type=types.shift();)this._callbacks[type]=this._callbacks[type]||{sync:[],async:[]},this._callbacks[type][method].push(cb);return this}function getFlush(callbacks,context,args){return function(){for(var cancelled,i=0;!cancelled&&i<callbacks.length;i+=1)cancelled=!1===callbacks[i].apply(context,args);return!cancelled}}}(),highlight=(doc=window.document,defaults={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1},function(o){var regex;(o=_.mixin({},defaults,o)).node&&o.pattern&&(o.pattern=_.isArray(o.pattern)?o.pattern:[o.pattern],regex=function(patterns,caseSensitive,wordsOnly){for(var regexStr,escapedPatterns=[],i=0;i<patterns.length;i++)escapedPatterns.push(_.escapeRegExChars(patterns[i]));return regexStr=wordsOnly?"\\b("+escapedPatterns.join("|")+")\\b":"("+escapedPatterns.join("|")+")",caseSensitive?new RegExp(regexStr):new RegExp(regexStr,"i")}(o.pattern,o.caseSensitive,o.wordsOnly),function traverse(el,hightlightTextNode){for(var childNode,i=0;i<el.childNodes.length;i++)3===(childNode=el.childNodes[i]).nodeType?i+=hightlightTextNode(childNode)?1:0:traverse(childNode,hightlightTextNode)}(o.node,function(textNode){var match,patternNode;return(match=regex.exec(textNode.data))&&(wrapperNode=doc.createElement(o.tagName),o.className&&(wrapperNode.className=o.className),(patternNode=textNode.splitText(match.index)).splitText(match[0].length),wrapperNode.appendChild(patternNode.cloneNode(!0)),textNode.parentNode.replaceChild(wrapperNode,patternNode)),!!match}))}),Input=function(){var specialKeyCodeMap;function Input(o){var onBlur,onFocus,onKeydown,onInput,$input,that=this;(o=o||{}).input||$.error("input is missing"),onBlur=_.bind(this._onBlur,this),onFocus=_.bind(this._onFocus,this),onKeydown=_.bind(this._onKeydown,this),onInput=_.bind(this._onInput,this),this.$hint=$(o.hint),this.$input=$(o.input).on("blur.tt",onBlur).on("focus.tt",onFocus).on("keydown.tt",onKeydown),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=_.noop),_.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function($e){specialKeyCodeMap[$e.which||$e.keyCode]||_.defer(_.bind(that._onInput,that,$e))}):this.$input.on("input.tt",onInput),this.query=this.$input.val(),this.$overflowHelper=($input=this.$input,$('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:$input.css("font-family"),fontSize:$input.css("font-size"),fontStyle:$input.css("font-style"),fontVariant:$input.css("font-variant"),fontWeight:$input.css("font-weight"),wordSpacing:$input.css("word-spacing"),letterSpacing:$input.css("letter-spacing"),textIndent:$input.css("text-indent"),textRendering:$input.css("text-rendering"),textTransform:$input.css("text-transform")}).insertAfter($input))}return specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},Input.normalizeQuery=function(str){return(str||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},_.mixin(Input.prototype,EventEmitter,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function($e){var keyName=specialKeyCodeMap[$e.which||$e.keyCode];this._managePreventDefault(keyName,$e),keyName&&this._shouldTrigger(keyName,$e)&&this.trigger(keyName+"Keyed",$e)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(keyName,$e){var preventDefault,hintValue,inputValue;switch(keyName){case"tab":hintValue=this.getHint(),inputValue=this.getInputValue(),preventDefault=hintValue&&hintValue!==inputValue&&!withModifier($e);break;case"up":case"down":preventDefault=!withModifier($e);break;default:preventDefault=!1}preventDefault&&$e.preventDefault()},_shouldTrigger:function(keyName,$e){var trigger;switch(keyName){case"tab":trigger=!withModifier($e);break;default:trigger=!0}return trigger},_checkInputValue:function(){var inputValue,areEquivalent,hasDifferentWhitespace,a,b;inputValue=this.getInputValue(),a=inputValue,b=this.query,hasDifferentWhitespace=!!(areEquivalent=Input.normalizeQuery(a)===Input.normalizeQuery(b))&&this.query.length!==inputValue.length,areEquivalent?hasDifferentWhitespace&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query=inputValue)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(query){this.query=query},getInputValue:function(){return this.$input.val()},setInputValue:function(value,silent){this.$input.val(value),silent?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(value){this.$hint.val(value)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var val,hint,valIsPrefixOfHint;valIsPrefixOfHint=(val=this.getInputValue())!==(hint=this.getHint())&&0===hint.indexOf(val),!(""!==val&&valIsPrefixOfHint&&!this.hasOverflow())&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var constraint=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=constraint},isCursorAtEnd:function(){var valueLength,selectionStart,range;return valueLength=this.$input.val().length,selectionStart=this.$input[0].selectionStart,_.isNumber(selectionStart)?selectionStart===valueLength:!document.selection||((range=document.selection.createRange()).moveStart("character",-valueLength),valueLength===range.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),Input;function withModifier($e){return $e.altKey||$e.ctrlKey||$e.metaKey||$e.shiftKey}}(),Dataset=function(){function Dataset(o){var str,display,templates,displayFn;(o=o||{}).templates=o.templates||{},o.source||$.error("missing source"),o.name&&(str=o.name,!/^[_a-zA-Z0-9-]+$/.test(str))&&$.error("invalid dataset name: "+o.name),this.query=null,this.highlight=!!o.highlight,this.name=o.name||_.getUniqueId(),this.source=o.source,this.displayFn=(display=(display=o.display||o.displayKey)||"value",_.isFunction(display)?display:function(obj){return obj[display]}),this.templates=(templates=o.templates,displayFn=this.displayFn,{empty:templates.empty&&_.templatify(templates.empty),header:templates.header&&_.templatify(templates.header),footer:templates.footer&&_.templatify(templates.footer),suggestion:templates.suggestion||function(context){return"<p>"+displayFn(context)+"</p>"}}),this.$el=$(html.dataset.replace("%CLASS%",this.name))}return Dataset.extractDatasetName=function(el){return $(el).data("ttDataset")},Dataset.extractValue=function(el){return $(el).data("ttValue")},Dataset.extractDatum=function(el){return $(el).data("ttDatum")},_.mixin(Dataset.prototype,EventEmitter,{_render:function(query,suggestions){if(this.$el){var hasSuggestions,$suggestions,nodes,that=this;this.$el.empty(),!(hasSuggestions=suggestions&&suggestions.length)&&this.templates.empty?this.$el.html(that.templates.empty({query:query,isEmpty:!0})).prepend(that.templates.header?getHeaderHtml():null).append(that.templates.footer?getFooterHtml():null):hasSuggestions&&this.$el.html(($suggestions=$(html.suggestions).css(css.suggestions),nodes=_.map(suggestions,function(suggestion){var $el;return($el=$(html.suggestion).append(that.templates.suggestion(suggestion)).data("ttDataset",that.name).data("ttValue",that.displayFn(suggestion)).data("ttDatum",suggestion)).children().each(function(){$(this).css(css.suggestionChild)}),$el}),$suggestions.append.apply($suggestions,nodes),that.highlight&&highlight({node:$suggestions[0],pattern:query}),$suggestions)).prepend(that.templates.header?getHeaderHtml():null).append(that.templates.footer?getFooterHtml():null),this.trigger("rendered")}function getHeaderHtml(){return that.templates.header({query:query,isEmpty:!hasSuggestions})}function getFooterHtml(){return that.templates.footer({query:query,isEmpty:!hasSuggestions})}},getRoot:function(){return this.$el},update:function(query){var that=this;this.query=query,this.canceled=!1,this.source(query,function(suggestions){that.canceled||query!==that.query||that._render(query,suggestions)})},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),Dataset}(),Dropdown=function(){function Dropdown(o){var onSuggestionClick,onSuggestionMouseEnter,onSuggestionMouseLeave,that=this;(o=o||{}).menu||$.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=_.map(o.datasets,initializeDataset),onSuggestionClick=_.bind(this._onSuggestionClick,this),onSuggestionMouseEnter=_.bind(this._onSuggestionMouseEnter,this),onSuggestionMouseLeave=_.bind(this._onSuggestionMouseLeave,this),this.$menu=$(o.menu).on("click.tt",".tt-suggestion",onSuggestionClick).on("mouseenter.tt",".tt-suggestion",onSuggestionMouseEnter).on("mouseleave.tt",".tt-suggestion",onSuggestionMouseLeave),_.each(this.datasets,function(dataset){that.$menu.append(dataset.getRoot()),dataset.onSync("rendered",that._onRendered,that)})}return _.mixin(Dropdown.prototype,EventEmitter,{_onSuggestionClick:function($e){this.trigger("suggestionClicked",$($e.currentTarget))},_onSuggestionMouseEnter:function($e){this._removeCursor(),this._setCursor($($e.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){this.isEmpty=_.every(this.datasets,function(dataset){return dataset.isEmpty()}),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function($el,silent){$el.first().addClass("tt-cursor"),!silent&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(increment){var $suggestions,$oldCursor,newCursorIndex,$newCursor;this.isOpen&&($oldCursor=this._getCursor(),$suggestions=this._getSuggestions(),this._removeCursor(),-1!==(newCursorIndex=((newCursorIndex=$suggestions.index($oldCursor)+increment)+1)%($suggestions.length+1)-1)?(newCursorIndex<-1&&(newCursorIndex=$suggestions.length-1),this._setCursor($newCursor=$suggestions.eq(newCursorIndex)),this._ensureVisible($newCursor)):this.trigger("cursorRemoved"))},_ensureVisible:function($el){var elTop,elBottom,menuScrollTop,menuHeight;elBottom=(elTop=$el.position().top)+$el.outerHeight(!0),menuScrollTop=this.$menu.scrollTop(),menuHeight=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),elTop<0?this.$menu.scrollTop(menuScrollTop+elTop):menuHeight<elBottom&&this.$menu.scrollTop(menuScrollTop+(elBottom-menuHeight))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(dir){this.$menu.css("ltr"===dir?css.ltr:css.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function($el){var datum=null;return $el.length&&(datum={raw:Dataset.extractDatum($el),value:Dataset.extractValue($el),datasetName:Dataset.extractDatasetName($el)}),datum},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(query){_.each(this.datasets,function(dataset){dataset.update(query)})},empty:function(){_.each(this.datasets,function(dataset){dataset.clear()}),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){this.$menu.off(".tt"),this.$menu=null,_.each(this.datasets,function(dataset){dataset.destroy()})}}),Dropdown;function initializeDataset(oDataset){return new Dataset(oDataset)}}(),Typeahead=function(){var attrsKey="ttAttrs";function Typeahead(o){var $menu,$input,$hint;(o=o||{}).input||$.error("missing input"),this.isActivated=!1,this.autoselect=!!o.autoselect,this.minLength=_.isNumber(o.minLength)?o.minLength:1,this.$node=function(input,withHint){var $input,$wrapper,$dropdown,$hint;$input=$(input),$wrapper=$(html.wrapper).css(css.wrapper),$dropdown=$(html.dropdown).css(css.dropdown),($hint=$input.clone().css(css.hint).css(($el=$input,{backgroundAttachment:$el.css("background-attachment"),backgroundClip:$el.css("background-clip"),backgroundColor:$el.css("background-color"),backgroundImage:$el.css("background-image"),backgroundOrigin:$el.css("background-origin"),backgroundPosition:$el.css("background-position"),backgroundRepeat:$el.css("background-repeat"),backgroundSize:$el.css("background-size")}))).val("").removeData().addClass("tt-hint").removeAttr("id name placeholder").prop("disabled",!0).attr({autocomplete:"off",spellcheck:"false"}),$input.data(attrsKey,{dir:$input.attr("dir"),autocomplete:$input.attr("autocomplete"),spellcheck:$input.attr("spellcheck"),style:$input.attr("style")}),$input.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(withHint?css.input:css.inputWithNoHint);var $el;try{!$input.attr("dir")&&$input.attr("dir","auto")}catch(e){}return $input.wrap($wrapper).parent().prepend(withHint?$hint:null).append($dropdown)}(o.input,o.withHint),$menu=this.$node.find(".tt-dropdown-menu"),$input=this.$node.find(".tt-input"),$hint=this.$node.find(".tt-hint"),$input.on("blur.tt",function($e){var active,isActive,hasActive;active=document.activeElement,isActive=$menu.is(active),hasActive=0<$menu.has(active).length,_.isMsie()&&(isActive||hasActive)&&($e.preventDefault(),$e.stopImmediatePropagation(),_.defer(function(){$input.focus()}))}),$menu.on("mousedown.tt",function($e){$e.preventDefault()}),this.eventBus=o.eventBus||new EventBus({el:$input}),this.dropdown=new Dropdown({menu:$menu,datasets:o.datasets}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new Input({input:$input,hint:$hint}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}return _.mixin(Typeahead.prototype,{_onSuggestionClicked:function(type,$el){var datum;(datum=this.dropdown.getDatumForSuggestion($el))&&this._select(datum)},_onCursorMoved:function(){var datum=this.dropdown.getDatumForCursor();this.input.setInputValue(datum.value,!0),this.eventBus.trigger("cursorchanged",datum.raw,datum.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(type,$e){var cursorDatum,topSuggestionDatum;cursorDatum=this.dropdown.getDatumForCursor(),topSuggestionDatum=this.dropdown.getDatumForTopSuggestion(),cursorDatum?(this._select(cursorDatum),$e.preventDefault()):this.autoselect&&topSuggestionDatum&&(this._select(topSuggestionDatum),$e.preventDefault())},_onTabKeyed:function(type,$e){var datum;(datum=this.dropdown.getDatumForCursor())?(this._select(datum),$e.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var query=this.input.getQuery();this.dropdown.isEmpty&&query.length>=this.minLength?this.dropdown.update(query):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var query=this.input.getQuery();this.dropdown.isEmpty&&query.length>=this.minLength?this.dropdown.update(query):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(e,query){this.input.clearHintIfInvalid(),query.length>=this.minLength?this.dropdown.update(query):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var dir;this.dir!==(dir=this.input.getLanguageDirection())&&(this.dir=dir,this.$node.css("direction",dir),this.dropdown.setLanguageDirection(dir))},_updateHint:function(){var datum,val,query,escapedQuery,match;(datum=this.dropdown.getDatumForTopSuggestion())&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(val=this.input.getInputValue(),query=Input.normalizeQuery(val),escapedQuery=_.escapeRegExChars(query),(match=new RegExp("^(?:"+escapedQuery+")(.+$)","i").exec(datum.value))?this.input.setHint(val+match[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(laxCursor){var hint,query,isCursorAtEnd,datum;hint=this.input.getHint(),query=this.input.getQuery(),isCursorAtEnd=laxCursor||this.input.isCursorAtEnd(),hint&&query!==hint&&isCursorAtEnd&&((datum=this.dropdown.getDatumForTopSuggestion())&&this.input.setInputValue(datum.value),this.eventBus.trigger("autocompleted",datum.raw,datum.datasetName))},_select:function(datum){this.input.setQuery(datum.value),this.input.setInputValue(datum.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",datum.raw,datum.datasetName),this.dropdown.close(),_.defer(_.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(val){this.isActivated?this.input.setInputValue(val):(this.input.setQuery(val),this.input.setInputValue(val,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){var $node,$input;this.input.destroy(),this.dropdown.destroy(),$node=this.$node,$input=$node.find(".tt-input"),_.each($input.data(attrsKey),function(val,key){_.isUndefined(val)?$input.removeAttr(key):$input.attr(key,val)}),$input.detach().removeData(attrsKey).removeClass("tt-input").insertAfter($node),$node.remove(),this.$node=null}}),Typeahead}();old=$.fn.typeahead,methods={initialize:function(o,datasets){return datasets=_.isArray(datasets)?datasets:[].slice.call(arguments,1),o=o||{},this.each(function(){var typeahead,$input=$(this);_.each(datasets,function(d){d.highlight=!!o.highlight}),typeahead=new Typeahead({input:$input,eventBus:new EventBus({el:$input}),withHint:!!_.isUndefined(o.hint)||!!o.hint,minLength:o.minLength,autoselect:o.autoselect,datasets:datasets}),$input.data("ttTypeahead",typeahead)})},open:function(){return this.each(function(){var typeahead,$input=$(this);(typeahead=$input.data("ttTypeahead"))&&typeahead.open()})},close:function(){return this.each(function(){var typeahead,$input=$(this);(typeahead=$input.data("ttTypeahead"))&&typeahead.close()})},val:function(newVal){return arguments.length?this.each(function(){var typeahead,$input=$(this);(typeahead=$input.data("ttTypeahead"))&&typeahead.setVal(newVal)}):($input=this.first(),(typeahead=$input.data("ttTypeahead"))&&(query=typeahead.getVal()),query);var $input,typeahead,query},destroy:function(){return this.each(function(){var typeahead,$input=$(this);(typeahead=$input.data("ttTypeahead"))&&(typeahead.destroy(),$input.removeData("ttTypeahead"))})}},$.fn.typeahead=function(method){return methods[method]?methods[method].apply(this,[].slice.call(arguments,1)):methods.initialize.apply(this,arguments)},$.fn.typeahead.noConflict=function(){return $.fn.typeahead=old,this}}(jQuery),function($){"use strict";var defaultOptions={tagClass:function(item){return"label label-info"},itemValue:function(item){return item?item.toString():item},itemText:function(item){return this.itemValue(item)},freeInput:!0,maxTags:undefined,confirmKeys:[13],onTagExists:function(item,$tag){$tag.hide().fadeIn()}};function TagsInput(element,options){this.itemsArray=[],this.$element=$(element),this.$element.hide(),this.isSelect="SELECT"===element.tagName,this.multiple=this.isSelect&&element.hasAttribute("multiple"),this.objectItems=options&&options.itemValue,this.placeholderText=element.hasAttribute("placeholder")?this.$element.attr("placeholder"):"",this.inputSize=Math.max(1,this.placeholderText.length),this.$container=$('<div class="bootstrap-tagsinput"></div>'),this.$input=$('<input size="'+this.inputSize+'" type="text" placeholder="'+this.placeholderText+'"/>').appendTo(this.$container),this.$element.after(this.$container),this.build(options)}function makeOptionItemFunction(options,key){if("function"!=typeof options[key]){var propertyName=options[key];options[key]=function(item){return item[propertyName]}}}TagsInput.prototype={constructor:TagsInput,add:function(item,dontPushVal){var self=this;if(!(self.options.maxTags&&self.itemsArray.length>=self.options.maxTags)&&(!1===item||item)){if("object"==typeof item&&!self.objectItems)throw"Can't add objects when itemValue option is not set";if(!item.toString().match(/^\s*$/)){if(self.isSelect&&!self.multiple&&0<self.itemsArray.length&&self.remove(self.itemsArray[0]),"string"==typeof item&&"INPUT"===this.$element[0].tagName){var items=item.split(",");if(1<items.length){for(var i=0;i<items.length;i++)this.add(items[i],!0);return void(dontPushVal||self.pushVal())}}var itemValue=self.options.itemValue(item),itemText=self.options.itemText(item),tagClass=self.options.tagClass(item),existing=$.grep(self.itemsArray,function(item){return self.options.itemValue(item)===itemValue})[0];if(existing){if(self.options.onTagExists){var $existingTag=$(".tag",self.$container).filter(function(){return $(this).data("item")===existing});self.options.onTagExists(item,$existingTag)}}else{self.itemsArray.push(item);var $tag=$('<span class="tag '+htmlEncode(tagClass)+'">'+htmlEncode(itemText)+'<span data-role="remove"></span></span>');if($tag.data("item",item),self.findInputWrapper().before($tag),$tag.after(" "),self.isSelect&&!$('option[value="'+escape(itemValue)+'"]',self.$element)[0]){var $option=$("<option selected>"+htmlEncode(itemText)+"</option>");$option.data("item",item),$option.attr("value",itemValue),self.$element.append($option)}dontPushVal||self.pushVal(),self.options.maxTags===self.itemsArray.length&&self.$container.addClass("bootstrap-tagsinput-max"),self.$element.trigger($.Event("itemAdded",{item:item}))}}}},remove:function(item,dontPushVal){var self=this;self.objectItems&&(item=self.options.itemValue(item)?$.grep(self.itemsArray,function(other){return self.options.itemValue(other)==self.options.itemValue(item)})[0]:$.grep(self.itemsArray,function(other){return self.options.itemValue(other)==item})[0]),item&&($(".tag",self.$container).filter(function(){return $(this).data("item")===item}).remove(),$("option",self.$element).filter(function(){return $(this).data("item")===item}).remove(),self.itemsArray.splice($.inArray(item,self.itemsArray),1)),dontPushVal||self.pushVal(),self.options.maxTags>self.itemsArray.length&&self.$container.removeClass("bootstrap-tagsinput-max"),self.$element.trigger($.Event("itemRemoved",{item:item}))},removeAll:function(){for($(".tag",this.$container).remove(),$("option",this.$element).remove();0<this.itemsArray.length;)this.itemsArray.pop();this.pushVal(),this.options.maxTags&&!this.isEnabled()&&this.enable()},refresh:function(){var self=this;$(".tag",self.$container).each(function(){var $tag=$(this),item=$tag.data("item"),itemValue=self.options.itemValue(item),itemText=self.options.itemText(item),tagClass=self.options.tagClass(item);($tag.attr("class",null),$tag.addClass("tag "+htmlEncode(tagClass)),$tag.contents().filter(function(){return 3==this.nodeType})[0].nodeValue=htmlEncode(itemText),self.isSelect)&&$("option",self.$element).filter(function(){return $(this).data("item")===item}).attr("value",itemValue)})},items:function(){return this.itemsArray},pushVal:function(){var self=this,val=$.map(self.items(),function(item){return self.options.itemValue(item).toString()});self.$element.val(val,!0).trigger("change")},build:function(options){var self=this;self.options=$.extend({},defaultOptions,options);var typeahead=self.options.typeahead||{};self.objectItems&&(self.options.freeInput=!1),makeOptionItemFunction(self.options,"itemValue"),makeOptionItemFunction(self.options,"itemText"),makeOptionItemFunction(self.options,"tagClass"),self.options.source&&(typeahead.source=self.options.source),typeahead.source&&$.fn.typeahead&&(!function(options,key){if("function"!=typeof options[key]){var value=options[key];options[key]=function(){return value}}}(typeahead,"source"),self.$input.typeahead({source:function(query,process){function processItems(items){for(var texts=[],i=0;i<items.length;i++){var text=self.options.itemText(items[i]);map[text]=items[i],texts.push(text)}process(texts)}this.map={};var map=this.map,data=typeahead.source(query);$.isFunction(data.success)?data.success(processItems):$.when(data).then(processItems)},updater:function(text){self.add(this.map[text])},matcher:function(text){return-1!==text.toLowerCase().indexOf(this.query.trim().toLowerCase())},sorter:function(texts){return texts.sort()},highlighter:function(text){var regex=new RegExp("("+this.query+")","gi");return text.replace(regex,"<strong>$1</strong>")}})),self.$container.on("click",$.proxy(function(event){self.$input.focus()},self)),self.$container.on("keydown","input",$.proxy(function(event){var $input=$(event.target),$inputWrapper=self.findInputWrapper();switch(event.which){case 8:if(0===doGetCaretPosition($input[0])){var prev=$inputWrapper.prev();prev&&self.remove(prev.data("item"))}break;case 46:if(0===doGetCaretPosition($input[0])){var next=$inputWrapper.next();next&&self.remove(next.data("item"))}break;case 37:var $prevTag=$inputWrapper.prev();0===$input.val().length&&$prevTag[0]&&($prevTag.before($inputWrapper),$input.focus());break;case 39:var $nextTag=$inputWrapper.next();0===$input.val().length&&$nextTag[0]&&($nextTag.after($inputWrapper),$input.focus());break;default:self.options.freeInput&&0<=$.inArray(event.which,self.options.confirmKeys)&&(self.add($input.val()),$input.val(""),event.preventDefault())}$input.attr("size",Math.max(this.inputSize,$input.val().length))},self)),self.$container.on("click","[data-role=remove]",$.proxy(function(event){self.remove($(event.target).closest(".tag").data("item"))},self)),self.options.itemValue===defaultOptions.itemValue&&("INPUT"===self.$element[0].tagName?self.add(self.$element.val()):$("option",self.$element).each(function(){self.add($(this).attr("value"),!0)}))},destroy:function(){this.$container.off("keypress","input"),this.$container.off("click","[role=remove]"),this.$container.remove(),this.$element.removeData("tagsinput"),this.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var elt=this.$input[0],container=this.$container[0];elt&&elt.parentNode!==container;)elt=elt.parentNode;return $(elt)}},$.fn.tagsinput=function(arg1,arg2){var results=[];return this.each(function(){var tagsinput=$(this).data("tagsinput");if(tagsinput){var retVal=tagsinput[arg1](arg2);retVal!==undefined&&results.push(retVal)}else tagsinput=new TagsInput(this,arg1),$(this).data("tagsinput",tagsinput),results.push(tagsinput),"SELECT"===this.tagName&&$("option",$(this)).attr("selected","selected"),$(this).val($(this).val())}),"string"==typeof arg1?1<results.length?results:results[0]:results},$.fn.tagsinput.Constructor=TagsInput;var htmlEncodeContainer=$("<div />");function htmlEncode(value){return value?htmlEncodeContainer.text(value).html():""}function doGetCaretPosition(oField){var iCaretPos=0;if(document.selection){oField.focus();var oSel=document.selection.createRange();oSel.moveStart("character",-oField.value.length),iCaretPos=oSel.text.length}else(oField.selectionStart||"0"==oField.selectionStart)&&(iCaretPos=oField.selectionStart);return iCaretPos}$(function(){$("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})}(jQuery),angular.module("xeditable",[]).value("editableOptions",{theme:"default",buttons:"right",blurElem:"cancel",blurForm:"ignore",activate:"focus"}),angular.module("xeditable").directive("editableBsdate",["editableDirectiveFactory",function(editableDirectiveFactory){return editableDirectiveFactory({directiveName:"editableBsdate",inputTpl:'<input type="text">'})}]),angular.module("xeditable").directive("editableBstime",["editableDirectiveFactory",function(editableDirectiveFactory){return editableDirectiveFactory({directiveName:"editableBstime",inputTpl:"<timepicker></timepicker>",render:function(){this.parent.render.call(this);var div=angular.element('<div class="well well-small" style="display:inline-block;"></div>');div.attr("ng-model",this.inputEl.attr("ng-model")),this.inputEl.removeAttr("ng-model"),this.attrs.eNgChange&&(div.attr("ng-change",this.inputEl.attr("ng-change")),this.inputEl.removeAttr("ng-change")),this.inputEl.wrap(div)}})}]),angular.module("xeditable").directive("editableCheckbox",["editableDirectiveFactory",function(editableDirectiveFactory){return editableDirectiveFactory({directiveName:"editableCheckbox",inputTpl:'<input type="checkbox">',render:function(){this.parent.render.call(this),this.attrs.eTitle&&(this.inputEl.wrap("<label></label>"),this.inputEl.after(angular.element("<span></span>").text(this.attrs.eTitle)))},autosubmit:function(){var self=this;self.inputEl.bind("change",function(){setTimeout(function(){self.scope.$apply(function(){self.scope.$form.$submit()})},500)})}})}]),angular.module("xeditable").directive("editableChecklist",["editableDirectiveFactory","editableNgOptionsParser",function(editableDirectiveFactory,editableNgOptionsParser){return editableDirectiveFactory({directiveName:"editableChecklist",inputTpl:"<span></span>",useCopy:!0,render:function(){this.parent.render.call(this);var parsed=editableNgOptionsParser(this.attrs.eNgOptions),html='<label ng-repeat="'+parsed.ngRepeat+'"><input type="checkbox" checklist-model="$parent.$data" checklist-value="'+parsed.locals.valueFn+'"><span ng-bind="'+parsed.locals.displayFn+'"></span></label>';this.inputEl.removeAttr("ng-model"),this.inputEl.removeAttr("ng-options"),this.inputEl.html(html)}})}]),types="text|email|tel|number|url|search|color|date|datetime|time|month|week".split("|"),angular.forEach(types,function(type){var directiveName="editable"+type.charAt(0).toUpperCase()+type.slice(1);angular.module("xeditable").directive(directiveName,["editableDirectiveFactory",function(editableDirectiveFactory){return editableDirectiveFactory({directiveName:directiveName,inputTpl:'<input type="'+type+'">'})}])}),angular.module("xeditable").directive("editableRange",["editableDirectiveFactory",function(editableDirectiveFactory){return editableDirectiveFactory({directiveName:"editableRange",inputTpl:'<input type="range" id="range" name="range">',render:function(){this.parent.render.call(this),this.inputEl.after("<output>{{$data}}</output>")}})}]),angular.module("xeditable").directive("editableRadiolist",["editableDirectiveFactory","editableNgOptionsParser",function(editableDirectiveFactory,editableNgOptionsParser){return editableDirectiveFactory({directiveName:"editableRadiolist",inputTpl:"<span></span>",render:function(){this.parent.render.call(this);var parsed=editableNgOptionsParser(this.attrs.eNgOptions),html='<label ng-repeat="'+parsed.ngRepeat+'"><input type="radio" ng-model="$parent.$data" value="{{'+parsed.locals.valueFn+'}}"><span ng-bind="'+parsed.locals.displayFn+'"></span></label>';this.inputEl.removeAttr("ng-model"),this.inputEl.removeAttr("ng-options"),this.inputEl.html(html)},autosubmit:function(){var self=this;self.inputEl.bind("change",function(){setTimeout(function(){self.scope.$apply(function(){self.scope.$form.$submit()})},500)})}})}]),angular.module("xeditable").directive("editableSelect",["editableDirectiveFactory",function(editableDirectiveFactory){return editableDirectiveFactory({directiveName:"editableSelect",inputTpl:"<select></select>",autosubmit:function(){var self=this;self.inputEl.bind("change",function(){self.scope.$apply(function(){self.scope.$form.$submit()})})}})}]),angular.module("xeditable").directive("editableTextarea",["editableDirectiveFactory",function(editableDirectiveFactory){return editableDirectiveFactory({directiveName:"editableTextarea",inputTpl:"<textarea></textarea>",addListeners:function(){this.parent.addListeners.call(this),this.single&&"no"!==this.buttons&&this.autosubmit()},autosubmit:function(){var self=this;self.inputEl.bind("keydown",function(e){(e.ctrlKey||e.metaKey)&&13===e.keyCode&&self.scope.$apply(function(){self.scope.$form.$submit()})})}})}]),angular.module("xeditable").factory("editableController",["$q","editableUtils",function($q,editableUtils){function EditableController($scope,$attrs,$element,$parse,editableThemes,editableOptions,$rootScope,$compile,$q){var valueGetter,inWaiting,self=this;self.scope=$scope,self.elem=$element,self.attrs=$attrs,self.inputEl=null,self.editorEl=null,self.single=!0,self.error="",self.theme=editableThemes[editableOptions.theme]||editableThemes.default,self.parent={},self.inputTpl="",self.directiveName="",self.useCopy=!1,self.single=null,self.buttons="right",self.init=function(single){if(self.single=single,self.name=$attrs.eName||$attrs[self.directiveName],!$attrs[self.directiveName])throw"You should provide value for `"+self.directiveName+"` in editable element!";valueGetter=$parse($attrs[self.directiveName]),self.single?self.buttons=self.attrs.buttons||editableOptions.buttons:self.buttons="no",$attrs.eName&&self.scope.$watch("$data",function(newVal){self.scope.$form.$data[$attrs.eName]=newVal}),$attrs.onshow&&(self.onshow=function(){return self.catchError($parse($attrs.onshow)($scope))}),$attrs.onhide&&(self.onhide=function(){return $parse($attrs.onhide)($scope)}),$attrs.oncancel&&(self.oncancel=function(){return $parse($attrs.oncancel)($scope)}),$attrs.onbeforesave&&(self.onbeforesave=function(){return self.catchError($parse($attrs.onbeforesave)($scope))}),$attrs.onaftersave&&(self.onaftersave=function(){return self.catchError($parse($attrs.onaftersave)($scope))}),$scope.$parent.$watch($attrs[self.directiveName],function(newVal,oldVal){self.handleEmpty()})},self.render=function(){var theme=self.theme;for(var k in self.inputEl=angular.element(self.inputTpl),self.controlsEl=angular.element(theme.controlsTpl),self.controlsEl.append(self.inputEl),"no"!==self.buttons&&(self.buttonsEl=angular.element(theme.buttonsTpl),self.submitEl=angular.element(theme.submitTpl),self.cancelEl=angular.element(theme.cancelTpl),self.buttonsEl.append(self.submitEl).append(self.cancelEl),self.controlsEl.append(self.buttonsEl),self.inputEl.addClass("editable-has-buttons")),self.errorEl=angular.element(theme.errorTpl),self.controlsEl.append(self.errorEl),self.editorEl=angular.element(self.single?theme.formTpl:theme.noformTpl),self.editorEl.append(self.controlsEl),$attrs.$attr)if(!(k.length<=1)){var transferAttr=!1,nextLetter=k.substring(1,2);if("e"===k.substring(0,1)&&nextLetter===nextLetter.toUpperCase()&&"Form"!==(transferAttr=k.substring(1))&&"NgSubmit"!==transferAttr){transferAttr=transferAttr.substring(0,1).toLowerCase()+editableUtils.camelToDash(transferAttr.substring(1));var attrValue=""===$attrs[k]?transferAttr:$attrs[k];self.inputEl.attr(transferAttr,attrValue)}}self.inputEl.addClass("editable-input"),self.inputEl.attr("ng-model","$data"),self.editorEl.addClass(editableUtils.camelToDash(self.directiveName)),self.single&&(self.editorEl.attr("editable-form","$form"),self.editorEl.attr("blur",self.attrs.blur||("no"===self.buttons?"cancel":editableOptions.blurElem))),angular.isFunction(theme.postrender)&&theme.postrender.call(self)},self.setLocalValue=function(){self.scope.$data=self.useCopy?angular.copy(valueGetter($scope.$parent)):valueGetter($scope.$parent)},self.show=function(){return self.setLocalValue(),self.render(),$element.after(self.editorEl),$compile(self.editorEl)($scope),self.addListeners(),$element.addClass("editable-hide"),self.onshow()},self.hide=function(){return self.editorEl.remove(),$element.removeClass("editable-hide"),self.onhide()},self.cancel=function(){self.oncancel()},self.addListeners=function(){self.inputEl.bind("keyup",function(e){if(self.single)switch(e.keyCode){case 27:self.scope.$apply(function(){self.scope.$form.$cancel()})}}),self.single&&"no"===self.buttons&&self.autosubmit(),self.editorEl.bind("click",function(e){1===e.which&&self.scope.$form.$visible&&(self.scope.$form._clicked=!0)})},self.setWaiting=function(value){value?(inWaiting=!self.inputEl.attr("disabled")&&!self.inputEl.attr("ng-disabled")&&!self.inputEl.attr("ng-enabled"))&&(self.inputEl.attr("disabled","disabled"),self.buttonsEl&&self.buttonsEl.find("button").attr("disabled","disabled")):inWaiting&&(self.inputEl.removeAttr("disabled"),self.buttonsEl&&self.buttonsEl.find("button").removeAttr("disabled"))},self.activate=function(){setTimeout(function(){var el=self.inputEl[0];"focus"===editableOptions.activate&&el.focus&&el.focus(),"select"===editableOptions.activate&&el.select&&el.select()},0)},self.setError=function(msg){angular.isObject(msg)||($scope.$error=msg,self.error=msg)},self.catchError=function(result,noPromise){return angular.isObject(result)&&!0!==noPromise?$q.when(result).then(angular.bind(this,function(r){this.catchError(r,!0)}),angular.bind(this,function(r){this.catchError(r,!0)})):noPromise&&angular.isObject(result)&&result.status&&200!==result.status&&result.data&&angular.isString(result.data)?(this.setError(result.data),result=result.data):angular.isString(result)&&this.setError(result),result},self.save=function(){valueGetter.assign($scope.$parent,angular.copy(self.scope.$data))},self.handleEmpty=function(){var val=valueGetter($scope.$parent),isEmpty=null===val||val===undefined||""===val||angular.isArray(val)&&0===val.length;$element.toggleClass("editable-empty",isEmpty)},self.autosubmit=angular.noop,self.onshow=angular.noop,self.onhide=angular.noop,self.oncancel=angular.noop,self.onbeforesave=angular.noop,self.onaftersave=angular.noop}return EditableController.$inject=["$scope","$attrs","$element","$parse","editableThemes","editableOptions","$rootScope","$compile","$q"],EditableController}]),angular.module("xeditable").factory("editableDirectiveFactory",["$parse","$compile","editableThemes","$rootScope","$document","editableController","editableFormController",function($parse,$compile,editableThemes,$rootScope,$document,editableController,editableFormController){return function(overwrites){return{restrict:"A",scope:!0,require:[overwrites.directiveName,"?^form"],controller:editableController,link:function(scope,elem,attrs,ctrl){var eFormCtrl,eCtrl=ctrl[0],hasForm=!1;if(ctrl[1])eFormCtrl=ctrl[1],hasForm=!0;else if(attrs.eForm){var getter=$parse(attrs.eForm)(scope);if(getter)eFormCtrl=getter,hasForm=!0;else for(var i=0;i<$document[0].forms.length;i++)if($document[0].forms[i].name===attrs.eForm){hasForm=!(eFormCtrl=null);break}}if(angular.forEach(overwrites,function(v,k){eCtrl[k]!==undefined&&(eCtrl.parent[k]=eCtrl[k])}),angular.extend(eCtrl,overwrites),eCtrl.init(!hasForm),scope.$editable=eCtrl,elem.addClass("editable"),hasForm)if(eFormCtrl){if(scope.$form=eFormCtrl,!scope.$form.$addEditable)throw"Form with editable elements should have `editable-form` attribute.";scope.$form.$addEditable(eCtrl)}else $rootScope.$$editableBuffer=$rootScope.$$editableBuffer||{},$rootScope.$$editableBuffer[attrs.eForm]=$rootScope.$$editableBuffer[attrs.eForm]||[],$rootScope.$$editableBuffer[attrs.eForm].push(eCtrl),scope.$form=null;else scope.$form=editableFormController(),scope.$form.$addEditable(eCtrl),attrs.eForm&&(scope.$parent[attrs.eForm]=scope.$form),attrs.eForm||(elem.addClass("editable-click"),elem.bind("click",function(e){e.preventDefault(),e.editable=eCtrl,scope.$apply(function(){scope.$form.$show()})}))}}}}]),angular.module("xeditable").factory("editableFormController",["$parse","$document","$rootScope","editablePromiseCollection","editableUtils",function($parse,$document,$rootScope,editablePromiseCollection,editableUtils){var shown=[];$document.bind("click",function(e){if(1===e.which){for(var toCancel=[],toSubmit=[],i=0;i<shown.length;i++)shown[i]._clicked?shown[i]._clicked=!1:shown[i].$waiting||("cancel"===shown[i]._blur&&toCancel.push(shown[i]),"submit"===shown[i]._blur&&toSubmit.push(shown[i]));(toCancel.length||toSubmit.length)&&$rootScope.$apply(function(){angular.forEach(toCancel,function(v){v.$cancel()}),angular.forEach(toSubmit,function(v){v.$submit()})})}});var base={$addEditable:function(editable){this.$editables.push(editable),editable.elem.bind("$destroy",angular.bind(this,this.$removeEditable,editable)),editable.scope.$form||(editable.scope.$form=this),this.$visible&&editable.catchError(editable.show())},$removeEditable:function(editable){for(var i=0;i<this.$editables.length;i++)if(this.$editables[i]===editable)return void this.$editables.splice(i,1)},$show:function(){if(!this.$visible){this.$visible=!0;var pc=editablePromiseCollection();pc.when(this.$onshow()),this.$setError(null,""),angular.forEach(this.$editables,function(editable){pc.when(editable.show())}),pc.then({onWait:angular.bind(this,this.$setWaiting),onTrue:angular.bind(this,this.$activate),onFalse:angular.bind(this,this.$activate),onString:angular.bind(this,this.$activate)}),setTimeout(angular.bind(this,function(){this._clicked=!1,-1===editableUtils.indexOf(shown,this)&&shown.push(this)}),0)}},$activate:function(name){var i;if(this.$editables.length){if(angular.isString(name))for(i=0;i<this.$editables.length;i++)if(this.$editables[i].name===name)return void this.$editables[i].activate();for(i=0;i<this.$editables.length;i++)if(this.$editables[i].error)return void this.$editables[i].activate();this.$editables[0].activate()}},$hide:function(){this.$visible&&(this.$visible=!1,this.$onhide(),angular.forEach(this.$editables,function(editable){editable.hide()}),editableUtils.arrayRemove(shown,this))},$cancel:function(){this.$visible&&(this.$oncancel(),angular.forEach(this.$editables,function(editable){editable.cancel()}),this.$hide())},$setWaiting:function(value){this.$waiting=!!value,angular.forEach(this.$editables,function(editable){editable.setWaiting(!!value)})},$setError:function(name,msg){angular.forEach(this.$editables,function(editable){name&&editable.name!==name||editable.setError(msg)})},$submit:function(){if(!this.$waiting){this.$setError(null,"");var pc=editablePromiseCollection();angular.forEach(this.$editables,function(editable){pc.when(editable.onbeforesave())}),pc.then({onWait:angular.bind(this,this.$setWaiting),onTrue:angular.bind(this,checkSelf,!0),onFalse:angular.bind(this,checkSelf,!1),onString:angular.bind(this,this.$activate)})}function checkSelf(childrenTrue){var pc=editablePromiseCollection();pc.when(this.$onbeforesave()),pc.then({onWait:angular.bind(this,this.$setWaiting),onTrue:childrenTrue?angular.bind(this,this.$save):angular.bind(this,this.$hide),onFalse:angular.bind(this,this.$hide),onString:angular.bind(this,this.$activate)})}},$save:function(){angular.forEach(this.$editables,function(editable){editable.save()});var pc=editablePromiseCollection();pc.when(this.$onaftersave()),angular.forEach(this.$editables,function(editable){pc.when(editable.onaftersave())}),pc.then({onWait:angular.bind(this,this.$setWaiting),onTrue:angular.bind(this,this.$hide),onFalse:angular.bind(this,this.$hide),onString:angular.bind(this,this.$activate)})},$onshow:angular.noop,$oncancel:angular.noop,$onhide:angular.noop,$onbeforesave:angular.noop,$onaftersave:angular.noop};return function(){return angular.extend({$editables:[],$visible:!1,$waiting:!1,$data:{},_clicked:!1,_blur:null},base)}}]),angular.module("xeditable").directive("editableForm",["$rootScope","$parse","editableFormController","editableOptions",function($rootScope,$parse,editableFormController,editableOptions){return{restrict:"A",require:["form"],compile:function(){return{pre:function(scope,elem,attrs,ctrl){var eForm,form=ctrl[0];attrs.editableForm?scope[attrs.editableForm]&&scope[attrs.editableForm].$show?(eForm=scope[attrs.editableForm],angular.extend(form,eForm)):(eForm=editableFormController(),scope[attrs.editableForm]=eForm,angular.extend(eForm,form)):(eForm=editableFormController(),angular.extend(form,eForm));var buf=$rootScope.$$editableBuffer,name=form.$name;name&&buf&&buf[name]&&(angular.forEach(buf[name],function(editable){eForm.$addEditable(editable)}),delete buf[name])},post:function(scope,elem,attrs,ctrl){var eForm;eForm=attrs.editableForm&&scope[attrs.editableForm]&&scope[attrs.editableForm].$show?scope[attrs.editableForm]:ctrl[0],attrs.onshow&&(eForm.$onshow=angular.bind(eForm,$parse(attrs.onshow),scope)),attrs.onhide&&(eForm.$onhide=angular.bind(eForm,$parse(attrs.onhide),scope)),attrs.oncancel&&(eForm.$oncancel=angular.bind(eForm,$parse(attrs.oncancel),scope)),attrs.shown&&$parse(attrs.shown)(scope)&&eForm.$show(),eForm._blur=attrs.blur||editableOptions.blurForm,attrs.ngSubmit||attrs.submit||(attrs.onbeforesave&&(eForm.$onbeforesave=function(){return $parse(attrs.onbeforesave)(scope,{$data:eForm.$data})}),attrs.onaftersave&&(eForm.$onaftersave=function(){return $parse(attrs.onaftersave)(scope,{$data:eForm.$data})}),elem.bind("submit",function(event){event.preventDefault(),scope.$apply(function(){eForm.$submit()})})),elem.bind("click",function(e){1===e.which&&eForm.$visible&&(eForm._clicked=!0)})}}}}}]),angular.module("xeditable").factory("editablePromiseCollection",["$q",function($q){return function(){return{promises:[],hasFalse:!1,hasString:!1,when:function(result,noPromise){if(!1===result)this.hasFalse=!0;else if(!noPromise&&angular.isObject(result))this.promises.push($q.when(result));else{if(!angular.isString(result))return;this.hasString=!0}},then:function(callbacks){var onTrue=(callbacks=callbacks||{}).onTrue||angular.noop,onFalse=callbacks.onFalse||angular.noop,onString=callbacks.onString||angular.noop,onWait=callbacks.onWait||angular.noop,self=this;function applyCallback(){self.hasString||self.hasFalse?!self.hasString&&self.hasFalse?onFalse():onString():onTrue()}this.promises.length?(onWait(!0),$q.all(this.promises).then(function(results){onWait(!1),angular.forEach(results,function(result){self.when(result,!0)}),applyCallback()},function(error){onWait(!1),onString()})):applyCallback()}}}}]),angular.module("xeditable").factory("editableUtils",[function(){return{indexOf:function(array,obj){if(array.indexOf)return array.indexOf(obj);for(var i=0;i<array.length;i++)if(obj===array[i])return i;return-1},arrayRemove:function(array,value){var index=this.indexOf(array,value);return 0<=index&&array.splice(index,1),value},camelToDash:function(str){return str.replace(/[A-Z]/g,function(letter,pos){return(pos?"-":"")+letter.toLowerCase()})},dashToCamel:function(str){return str.replace(/([\:\-\_]+(.))/g,function(_,separator,letter,offset){return offset?letter.toUpperCase():letter}).replace(/^moz([A-Z])/,"Moz$1")}}}]),angular.module("xeditable").factory("editableNgOptionsParser",[function(){var NG_OPTIONS_REGEXP=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/;return function(optionsExp){var match;if(!(match=optionsExp.match(NG_OPTIONS_REGEXP)))throw"ng-options parse error";var ngRepeat,displayFn=match[2]||match[1],valueName=match[4]||match[6],keyName=match[5],valueFn=(match[3],match[2]?match[1]:valueName),valuesFn=match[7],track=match[8],trackFn=track?match[8]:null;return keyName===undefined?(ngRepeat=valueName+" in "+valuesFn,track!==undefined&&(ngRepeat+=" track by "+trackFn)):ngRepeat="("+keyName+", "+valueName+") in "+valuesFn,{ngRepeat:ngRepeat,locals:{valueName:valueName,keyName:keyName,valueFn:valueFn,displayFn:displayFn}}}}]),angular.module("xeditable").factory("editableThemes",function(){return{default:{formTpl:'<form class="editable-wrap"></form>',noformTpl:'<span class="editable-wrap"></span>',controlsTpl:'<span class="editable-controls"></span>',inputTpl:"",errorTpl:'<div class="editable-error" ng-show="$error" ng-bind="$error"></div>',buttonsTpl:'<span class="editable-buttons"></span>',submitTpl:'<button type="submit">save</button>',cancelTpl:'<button type="button" ng-click="$form.$cancel()">cancel</button>'},bs2:{formTpl:'<form class="form-inline editable-wrap" role="form"></form>',noformTpl:'<span class="editable-wrap"></span>',controlsTpl:'<div class="editable-controls controls control-group" ng-class="{\'error\': $error}"></div>',inputTpl:"",errorTpl:'<div class="editable-error help-block" ng-show="$error" ng-bind="$error"></div>',buttonsTpl:'<span class="editable-buttons"></span>',submitTpl:'<button type="submit" class="btn btn-primary"><span class="icon-ok icon-white"></span></button>',cancelTpl:'<button type="button" class="btn" ng-click="$form.$cancel()"><span class="icon-remove"></span></button>'},bs3:{formTpl:'<form class="form-inline editable-wrap" role="form"></form>',noformTpl:'<span class="editable-wrap"></span>',controlsTpl:'<div class="editable-controls form-group" ng-class="{\'has-error\': $error}"></div>',inputTpl:"",errorTpl:'<div class="editable-error help-block" ng-show="$error" ng-bind="$error"></div>',buttonsTpl:'<span class="editable-buttons"></span>',submitTpl:'<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span></button>',cancelTpl:'<button type="button" class="btn btn-default" ng-click="$form.$cancel()"><span class="glyphicon glyphicon-remove"></span></button>',buttonsClass:"",inputClass:"",postrender:function(){switch(this.directiveName){case"editableText":case"editableSelect":case"editableTextarea":case"editableEmail":case"editableTel":case"editableNumber":case"editableUrl":case"editableSearch":case"editableDate":case"editableDatetime":case"editableTime":case"editableMonth":case"editableWeek":if(this.inputEl.addClass("form-control"),this.theme.inputClass){if(this.inputEl.attr("multiple")&&("input-sm"===this.theme.inputClass||"input-lg"===this.theme.inputClass))break;this.inputEl.addClass(this.theme.inputClass)}}this.buttonsEl&&this.theme.buttonsClass&&this.buttonsEl.find("button").addClass(this.theme.buttonsClass)}}}}),function(window,angular,undefined){"use strict";angular.module("ui.sortable",[]).value("uiSortableConfig",{}).directive("uiSortable",["uiSortableConfig","$timeout","$log",function(uiSortableConfig,$timeout,$log){return{require:"?ngModel",scope:{ngModel:"=",uiSortable:"="},link:function(scope,element,attrs,ngModel){var savedNodes;function combineCallbacks(first,second){return second&&"function"==typeof second?function(){first.apply(this,arguments),second.apply(this,arguments)}:first}function getSortableWidgetInstance(element){var data=element.data("ui-sortable");return data&&"object"==typeof data&&"ui-sortable"===data.widgetFullName?data:null}function hasSortingHelper(element,ui){var helperOption=element.sortable("option","helper");return"clone"===helperOption||"function"==typeof helperOption&&ui.item.sortable.isCustomHelperUsed()}function afterStop(e,ui){ui.item.sortable._destroy()}var opts={},directiveOpts={"ui-floating":void 0},callbacks={receive:null,remove:null,start:null,stop:null,update:null},wrappers={helper:null};angular.extend(opts,directiveOpts,uiSortableConfig,scope.uiSortable),angular.element.fn&&angular.element.fn.jquery?(ngModel?(scope.$watch("ngModel.length",function(){$timeout(function(){getSortableWidgetInstance(element)&&element.sortable("refresh")},0,!1)}),callbacks.start=function(e,ui){if("auto"===opts["ui-floating"]){var siblings=ui.item.siblings();getSortableWidgetInstance(angular.element(e.target)).floating=/left|right/.test((item=siblings).css("float"))||/inline|table-cell/.test(item.css("display"))}var item;ui.item.sortable={model:ngModel.$modelValue[ui.item.index()],index:ui.item.index(),source:ui.item.parent(),sourceModel:ngModel.$modelValue,cancel:function(){ui.item.sortable._isCanceled=!0},isCanceled:function(){return ui.item.sortable._isCanceled},isCustomHelperUsed:function(){return!!ui.item.sortable._isCustomHelperUsed},_isCanceled:!1,_isCustomHelperUsed:ui.item.sortable._isCustomHelperUsed,_destroy:function(){angular.forEach(ui.item.sortable,function(value,key){ui.item.sortable[key]=void 0})}}},callbacks.activate=function(e,ui){savedNodes=element.contents();var placeholder=element.sortable("option","placeholder");if(placeholder&&placeholder.element&&"function"==typeof placeholder.element){var phElement=placeholder.element();phElement=angular.element(phElement);var excludes=element.find('[class="'+phElement.attr("class")+'"]:not([ng-repeat], [data-ng-repeat])');savedNodes=savedNodes.not(excludes)}var connectedSortables=ui.item.sortable._connectedSortables||[];connectedSortables.push({element:element,scope:scope}),ui.item.sortable._connectedSortables=connectedSortables},callbacks.update=function(e,ui){if(!ui.item.sortable.received){ui.item.sortable.dropindex=ui.item.index();var droptarget=ui.item.parent();ui.item.sortable.droptarget=droptarget;var droptargetScope=function(elementScopes,element){for(var result=null,i=0;i<elementScopes.length;i++){var x=elementScopes[i];if(x.element[0]===element[0]){result=x.scope;break}}return result}(ui.item.sortable._connectedSortables,droptarget);ui.item.sortable.droptargetModel=droptargetScope.ngModel,element.sortable("cancel")}hasSortingHelper(element,ui)&&!ui.item.sortable.received&&"parent"===element.sortable("option","appendTo")&&(savedNodes=savedNodes.not(savedNodes.last())),savedNodes.appendTo(element),ui.item.sortable.received&&(savedNodes=null),ui.item.sortable.received&&!ui.item.sortable.isCanceled()&&scope.$apply(function(){ngModel.$modelValue.splice(ui.item.sortable.dropindex,0,ui.item.sortable.moved)})},callbacks.stop=function(e,ui){!ui.item.sortable.received&&"dropindex"in ui.item.sortable&&!ui.item.sortable.isCanceled()?scope.$apply(function(){ngModel.$modelValue.splice(ui.item.sortable.dropindex,0,ngModel.$modelValue.splice(ui.item.sortable.index,1)[0])}):"dropindex"in ui.item.sortable&&!ui.item.sortable.isCanceled()||hasSortingHelper(element,ui)||savedNodes.appendTo(element),savedNodes=null},callbacks.receive=function(e,ui){ui.item.sortable.received=!0},callbacks.remove=function(e,ui){"dropindex"in ui.item.sortable||(element.sortable("cancel"),ui.item.sortable.cancel()),ui.item.sortable.isCanceled()||scope.$apply(function(){ui.item.sortable.moved=ngModel.$modelValue.splice(ui.item.sortable.index,1)[0]})},wrappers.helper=function(inner){return inner&&"function"==typeof inner?function(e,item){var innerResult=inner.apply(this,arguments);return item.sortable._isCustomHelperUsed=item!==innerResult,innerResult}:inner},scope.$watch("uiSortable",function(newVal){var sortableWidgetInstance=getSortableWidgetInstance(element);sortableWidgetInstance&&angular.forEach(newVal,function(value,key){if(key in directiveOpts)return"ui-floating"!==key||!1!==value&&!0!==value||(sortableWidgetInstance.floating=value),void(opts[key]=value);callbacks[key]?("stop"===key&&(value=combineCallbacks(value=combineCallbacks(value,function(){scope.$apply()}),afterStop)),value=combineCallbacks(callbacks[key],value)):wrappers[key]&&(value=wrappers[key](value)),opts[key]=value,element.sortable("option",key,value)})},!0),angular.forEach(callbacks,function(value,key){opts[key]=combineCallbacks(value,opts[key]),"stop"===key&&(opts[key]=combineCallbacks(opts[key],afterStop))})):$log.info("ui.sortable: ngModel not provided!",element),element.sortable(opts)):$log.error("ui.sortable: jQuery should be included before AngularJS!")}}}])}(0,svi.angular),function(factory,root){"function"==typeof define&&define.amd?define(factory):"undefined"!=typeof module&&"object"==typeof exports?module.exports=factory():root.log4javascript=factory()}(function(){function isUndefined(obj){return void 0===obj}function EventSupport(){}Array.prototype.push||(Array.prototype.push=function(){for(var i=0,len=arguments.length;i<len;i++)this[this.length]=arguments[i];return this.length}),Array.prototype.shift||(Array.prototype.shift=function(){if(0<this.length){for(var firstItem=this[0],i=0,len=this.length-1;i<len;i++)this[i]=this[i+1];return this.length=this.length-1,firstItem}}),Array.prototype.splice||(Array.prototype.splice=function(startIndex,deleteCount){var itemsAfterDeleted=this.slice(startIndex+deleteCount),itemsDeleted=this.slice(startIndex,startIndex+deleteCount);this.length=startIndex;for(var argumentsArray=[],i=0,len=arguments.length;i<len;i++)argumentsArray[i]=arguments[i];var itemsToAppend=2<argumentsArray.length?itemsAfterDeleted=argumentsArray.slice(2).concat(itemsAfterDeleted):itemsAfterDeleted;for(i=0,len=itemsToAppend.length;i<len;i++)this.push(itemsToAppend[i]);return itemsDeleted}),EventSupport.prototype={eventTypes:[],eventListeners:{},setEventTypes:function(eventTypesParam){if(eventTypesParam instanceof Array){this.eventTypes=eventTypesParam,this.eventListeners={};for(var i=0,len=this.eventTypes.length;i<len;i++)this.eventListeners[this.eventTypes[i]]=[]}else handleError("log4javascript.EventSupport ["+this+"]: setEventTypes: eventTypes parameter must be an Array")},addEventListener:function(eventType,listener){"function"==typeof listener?(array_contains(this.eventTypes,eventType)||handleError("log4javascript.EventSupport ["+this+"]: addEventListener: no event called '"+eventType+"'"),this.eventListeners[eventType].push(listener)):handleError("log4javascript.EventSupport ["+this+"]: addEventListener: listener must be a function")},removeEventListener:function(eventType,listener){"function"==typeof listener?(array_contains(this.eventTypes,eventType)||handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: no event called '"+eventType+"'"),array_remove(this.eventListeners[eventType],listener)):handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: listener must be a function")},dispatchEvent:function(eventType,eventArgs){if(array_contains(this.eventTypes,eventType))for(var listeners=this.eventListeners[eventType],i=0,len=listeners.length;i<len;i++)listeners[i](this,eventType,eventArgs);else handleError("log4javascript.EventSupport ["+this+"]: dispatchEvent: no event called '"+eventType+"'")}};var applicationStartDate=new Date,uniqueId="log4javascript_"+applicationStartDate.getTime()+"_"+Math.floor(1e8*Math.random()),emptyFunction=function(){},newLine="\r\n",pageLoaded=!1;function Log4JavaScript(){}Log4JavaScript.prototype=new EventSupport;var log4javascript=new Log4JavaScript;function toStr(obj){return obj&&obj.toString?obj.toString():String(obj)}function getExceptionMessage(ex){return ex.message?ex.message:ex.description?ex.description:toStr(ex)}function getUrlFileName(url){var lastSlashIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));return url.substr(lastSlashIndex+1)}function getExceptionStringRep(ex){if(ex){var exStr="Exception: "+getExceptionMessage(ex);try{ex.lineNumber&&(exStr+=" on line number "+ex.lineNumber),ex.fileName&&(exStr+=" in file "+getUrlFileName(ex.fileName))}catch(localEx){logLog.warn("Unable to obtain file and line information for error")}return showStackTraces&&ex.stack&&(exStr+=newLine+"Stack trace:"+newLine+ex.stack),exStr}return null}function bool(obj){return Boolean(obj)}function trim(str){return str.replace(/^\s+/,"").replace(/\s+$/,"")}function splitIntoLines(text){return text.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n")}log4javascript.version="1.4.13",log4javascript.edition="log4javascript_production";var urlEncode=void 0!==window.encodeURIComponent?function(str){return encodeURIComponent(str)}:function(str){return escape(str).replace(/\+/g,"%2B").replace(/"/g,"%22").replace(/'/g,"%27").replace(/\//g,"%2F").replace(/=/g,"%3D")};function array_remove(arr,val){for(var index=-1,i=0,len=arr.length;i<len;i++)if(arr[i]===val){index=i;break}return 0<=index&&(arr.splice(index,1),!0)}function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++)if(arr[i]==val)return!0;return!1}function extractBooleanFromParam(param,defaultValue){return isUndefined(param)?defaultValue:bool(param)}function extractStringFromParam(param,defaultValue){return isUndefined(param)?defaultValue:String(param)}function extractIntFromParam(param,defaultValue){if(isUndefined(param))return defaultValue;try{var value=parseInt(param,10);return isNaN(value)?defaultValue:value}catch(ex){return logLog.warn("Invalid int param "+param,ex),defaultValue}}function extractFunctionFromParam(param,defaultValue){return"function"==typeof param?param:defaultValue}function isError(err){return err instanceof Error}Function.prototype.apply||(Function.prototype.apply=function(obj,args){var methodName="__apply__";void 0!==obj[methodName]&&(methodName+=String(Math.random()).substr(2)),obj[methodName]=this;for(var argsStrings=[],i=0,len=args.length;i<len;i++)argsStrings[i]="args["+i+"]";var script="obj."+methodName+"("+argsStrings.join(",")+")",returnValue=eval(script);return delete obj[methodName],returnValue}),Function.prototype.call||(Function.prototype.call=function(obj){for(var args=[],i=1,len=arguments.length;i<len;i++)args[i-1]=arguments[i];return this.apply(obj,args)});var logLog={quietMode:!1,debugMessages:[],setQuietMode:function(quietMode){this.quietMode=bool(quietMode)},numberOfErrors:0,alertAllErrors:!1,setAlertAllErrors:function(alertAllErrors){this.alertAllErrors=alertAllErrors},debug:function(message){this.debugMessages.push(message)},displayDebug:function(){alert(this.debugMessages.join(newLine))},warn:function(message,exception){},error:function(message,exception){if((1==++this.numberOfErrors||this.alertAllErrors)&&!this.quietMode){var alertMessage="log4javascript error: "+message;exception&&(alertMessage+=newLine+newLine+"Original error: "+getExceptionStringRep(exception)),alert(alertMessage)}}};function handleError(message,exception){logLog.error(message,exception),log4javascript.dispatchEvent("error",{message:message,exception:exception})}log4javascript.logLog=logLog,log4javascript.setEventTypes(["load","error"]),log4javascript.handleError=handleError;var enabled=!("undefined"!=typeof log4javascript_disabled&&log4javascript_disabled);log4javascript.setEnabled=function(enable){enabled=bool(enable)},log4javascript.isEnabled=function(){return enabled};var useTimeStampsInMilliseconds=!0;log4javascript.setTimeStampsInMilliseconds=function(timeStampsInMilliseconds){useTimeStampsInMilliseconds=bool(timeStampsInMilliseconds)},log4javascript.isTimeStampsInMilliseconds=function(){return useTimeStampsInMilliseconds},log4javascript.evalInScope=function(expr){return eval(expr)};var showStackTraces=!1;log4javascript.setShowStackTraces=function(show){showStackTraces=bool(show)};var Level=function(level,name){this.level=level,this.name=name};function Timer(name,level){this.name=name,this.level=isUndefined(level)?Level.INFO:level,this.start=new Date}Level.prototype={toString:function(){return this.name},equals:function(level){return this.level==level.level},isGreaterOrEqual:function(level){return this.level>=level.level}},Level.ALL=new Level(Number.MIN_VALUE,"ALL"),Level.TRACE=new Level(1e4,"TRACE"),Level.DEBUG=new Level(2e4,"DEBUG"),Level.INFO=new Level(3e4,"INFO"),Level.WARN=new Level(4e4,"WARN"),Level.ERROR=new Level(5e4,"ERROR"),Level.FATAL=new Level(6e4,"FATAL"),Level.OFF=new Level(Number.MAX_VALUE,"OFF"),log4javascript.Level=Level,Timer.prototype.getElapsedTime=function(){return(new Date).getTime()-this.start.getTime()};var anonymousLoggerName="[anonymous]",defaultLoggerName="[default]",nullLoggerName="[null]",rootLoggerName="root";function Logger(name){this.name=name,this.parent=null,this.children=[];var appenders=[],loggerLevel=null,isRoot=this.name===rootLoggerName,isNull=this.name===nullLoggerName,appenderCache=null,appenderCacheInvalidated=!1;this.addChild=function(childLogger){this.children.push(childLogger),childLogger.parent=this,childLogger.invalidateAppenderCache()};var additive=!0;this.getAdditivity=function(){return additive},this.setAdditivity=function(additivity){var valueChanged=additive!=additivity;additive=additivity,valueChanged&&this.invalidateAppenderCache()},this.addAppender=function(appender){isNull?handleError("Logger.addAppender: you may not add an appender to the null logger"):appender instanceof log4javascript.Appender?array_contains(appenders,appender)||(appenders.push(appender),appender.setAddedToLogger(this),this.invalidateAppenderCache()):handleError("Logger.addAppender: appender supplied ('"+toStr(appender)+"') is not a subclass of Appender")},this.removeAppender=function(appender){array_remove(appenders,appender),appender.setRemovedFromLogger(this),this.invalidateAppenderCache()},this.removeAllAppenders=function(){var appenderCount=appenders.length;if(0<appenderCount){for(var i=0;i<appenderCount;i++)appenders[i].setRemovedFromLogger(this);appenders.length=0,this.invalidateAppenderCache()}},this.getEffectiveAppenders=function(){if(null===appenderCache||appenderCacheInvalidated){var parentEffectiveAppenders=isRoot||!this.getAdditivity()?[]:this.parent.getEffectiveAppenders();appenderCache=parentEffectiveAppenders.concat(appenders),appenderCacheInvalidated=!1}return appenderCache},this.invalidateAppenderCache=function(){appenderCacheInvalidated=!0;for(var i=0,len=this.children.length;i<len;i++)this.children[i].invalidateAppenderCache()},this.log=function(level,params){if(enabled&&level.isGreaterOrEqual(this.getEffectiveLevel())){var exception,finalParamIndex=params.length-1,lastParam=params[finalParamIndex];1<params.length&&isError(lastParam)&&(exception=lastParam,finalParamIndex--);for(var messages=[],i=0;i<=finalParamIndex;i++)messages[i]=params[i];var loggingEvent=new LoggingEvent(this,new Date,level,messages,exception);this.callAppenders(loggingEvent)}},this.callAppenders=function(loggingEvent){for(var effectiveAppenders=this.getEffectiveAppenders(),i=0,len=effectiveAppenders.length;i<len;i++)effectiveAppenders[i].doAppend(loggingEvent)},this.setLevel=function(level){isRoot&&null===level?handleError("Logger.setLevel: you cannot set the level of the root logger to null"):level instanceof Level?loggerLevel=level:handleError("Logger.setLevel: level supplied to logger "+this.name+" is not an instance of log4javascript.Level")},this.getLevel=function(){return loggerLevel},this.getEffectiveLevel=function(){for(var logger=this;null!==logger;logger=logger.parent){var level=logger.getLevel();if(null!==level)return level}},this.group=function(name,initiallyExpanded){if(enabled)for(var effectiveAppenders=this.getEffectiveAppenders(),i=0,len=effectiveAppenders.length;i<len;i++)effectiveAppenders[i].group(name,initiallyExpanded)},this.groupEnd=function(){if(enabled)for(var effectiveAppenders=this.getEffectiveAppenders(),i=0,len=effectiveAppenders.length;i<len;i++)effectiveAppenders[i].groupEnd()};var timers={};this.time=function(name,level){enabled&&(isUndefined(name)?handleError("Logger.time: a name for the timer must be supplied"):!level||level instanceof Level?timers[name]=new Timer(name,level):handleError("Logger.time: level supplied to timer "+name+" is not an instance of log4javascript.Level"))},this.timeEnd=function(name){if(enabled)if(isUndefined(name))handleError("Logger.timeEnd: a name for the timer must be supplied");else if(timers[name]){var timer=timers[name],milliseconds=timer.getElapsedTime();this.log(timer.level,["Timer "+toStr(name)+" completed in "+milliseconds+"ms"]),delete timers[name]}else logLog.warn("Logger.timeEnd: no timer found with name "+name)},this.assert=function(expr){if(enabled&&!expr){for(var args=[],i=1,len=arguments.length;i<len;i++)args.push(arguments[i]);(args=0<args.length?args:["Assertion Failure"]).push(newLine),args.push(expr),this.log(Level.ERROR,args)}},this.toString=function(){return"Logger["+this.name+"]"}}Logger.prototype={trace:function(){this.log(Level.TRACE,arguments)},debug:function(){this.log(Level.DEBUG,arguments)},info:function(){this.log(Level.INFO,arguments)},warn:function(){this.log(Level.WARN,arguments)},error:function(){this.log(Level.ERROR,arguments)},fatal:function(){this.log(Level.FATAL,arguments)},isEnabledFor:function(level){return level.isGreaterOrEqual(this.getEffectiveLevel())},isTraceEnabled:function(){return this.isEnabledFor(Level.TRACE)},isDebugEnabled:function(){return this.isEnabledFor(Level.DEBUG)},isInfoEnabled:function(){return this.isEnabledFor(Level.INFO)},isWarnEnabled:function(){return this.isEnabledFor(Level.WARN)},isErrorEnabled:function(){return this.isEnabledFor(Level.ERROR)},isFatalEnabled:function(){return this.isEnabledFor(Level.FATAL)}},Logger.prototype.trace.isEntryPoint=!0,Logger.prototype.debug.isEntryPoint=!0,Logger.prototype.info.isEntryPoint=!0,Logger.prototype.warn.isEntryPoint=!0,Logger.prototype.error.isEntryPoint=!0,Logger.prototype.fatal.isEntryPoint=!0;var loggers={},loggerNames=[],ROOT_LOGGER_DEFAULT_LEVEL=Level.DEBUG,rootLogger=new Logger(rootLoggerName);rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL),log4javascript.getRootLogger=function(){return rootLogger},log4javascript.getLogger=function(loggerName){if("string"!=typeof loggerName&&(loggerName=anonymousLoggerName,logLog.warn("log4javascript.getLogger: non-string logger name "+toStr(loggerName)+" supplied, returning anonymous logger")),loggerName==rootLoggerName&&handleError("log4javascript.getLogger: root logger may not be obtained by name"),!loggers[loggerName]){var logger=new Logger(loggerName);loggers[loggerName]=logger,loggerNames.push(loggerName);var parentLogger,lastDotIndex=loggerName.lastIndexOf(".");if(-1<lastDotIndex){var parentLoggerName=loggerName.substring(0,lastDotIndex);parentLogger=log4javascript.getLogger(parentLoggerName)}else parentLogger=rootLogger;parentLogger.addChild(logger)}return loggers[loggerName]};var defaultLogger=null;log4javascript.getDefaultLogger=function(){return defaultLogger||(defaultLogger=createDefaultLogger()),defaultLogger};var nullLogger=null;log4javascript.getNullLogger=function(){return nullLogger||(nullLogger=new Logger(nullLoggerName)).setLevel(Level.OFF),nullLogger},log4javascript.resetConfiguration=function(){rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL),loggers={}};var LoggingEvent=function(logger,timeStamp,level,messages,exception){this.logger=logger,this.timeStamp=timeStamp,this.timeStampInMilliseconds=timeStamp.getTime(),this.timeStampInSeconds=Math.floor(this.timeStampInMilliseconds/1e3),this.milliseconds=this.timeStamp.getMilliseconds(),this.level=level,this.messages=messages,this.exception=exception};LoggingEvent.prototype={getThrowableStrRep:function(){return this.exception?getExceptionStringRep(this.exception):""},getCombinedMessages:function(){return 1==this.messages.length?this.messages[0]:this.messages.join(newLine)},toString:function(){return"LoggingEvent["+this.level+"]"}},log4javascript.LoggingEvent=LoggingEvent;var Layout=function(){};Layout.prototype={defaults:{loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url"},loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url",batchHeader:"",batchFooter:"",batchSeparator:"",returnsPostData:!1,overrideTimeStampsSetting:!1,useTimeStampsInMilliseconds:null,format:function(){handleError("Layout.format: layout supplied has no format() method")},ignoresThrowable:function(){handleError("Layout.ignoresThrowable: layout supplied has no ignoresThrowable() method")},getContentType:function(){return"text/plain"},allowBatching:function(){return!0},setTimeStampsInMilliseconds:function(timeStampsInMilliseconds){this.overrideTimeStampsSetting=!0,this.useTimeStampsInMilliseconds=bool(timeStampsInMilliseconds)},isTimeStampsInMilliseconds:function(){return this.overrideTimeStampsSetting?this.useTimeStampsInMilliseconds:useTimeStampsInMilliseconds},getTimeStampValue:function(loggingEvent){return this.isTimeStampsInMilliseconds()?loggingEvent.timeStampInMilliseconds:loggingEvent.timeStampInSeconds},getDataValues:function(loggingEvent,combineMessages){var dataValues=[[this.loggerKey,loggingEvent.logger.name],[this.timeStampKey,this.getTimeStampValue(loggingEvent)],[this.levelKey,loggingEvent.level.name],[this.urlKey,window.location.href],[this.messageKey,combineMessages?loggingEvent.getCombinedMessages():loggingEvent.messages]];if(this.isTimeStampsInMilliseconds()||dataValues.push([this.millisecondsKey,loggingEvent.milliseconds]),loggingEvent.exception&&dataValues.push([this.exceptionKey,getExceptionStringRep(loggingEvent.exception)]),this.hasCustomFields())for(var i=0,len=this.customFields.length;i<len;i++){var val=this.customFields[i].value;"function"==typeof val&&(val=val(this,loggingEvent)),dataValues.push([this.customFields[i].name,val])}return dataValues},setKeys:function(loggerKey,timeStampKey,levelKey,messageKey,exceptionKey,urlKey,millisecondsKey){this.loggerKey=extractStringFromParam(loggerKey,this.defaults.loggerKey),this.timeStampKey=extractStringFromParam(timeStampKey,this.defaults.timeStampKey),this.levelKey=extractStringFromParam(levelKey,this.defaults.levelKey),this.messageKey=extractStringFromParam(messageKey,this.defaults.messageKey),this.exceptionKey=extractStringFromParam(exceptionKey,this.defaults.exceptionKey),this.urlKey=extractStringFromParam(urlKey,this.defaults.urlKey),this.millisecondsKey=extractStringFromParam(millisecondsKey,this.defaults.millisecondsKey)},setCustomField:function(name,value){for(var fieldUpdated=!1,i=0,len=this.customFields.length;i<len;i++)this.customFields[i].name===name&&(this.customFields[i].value=value,fieldUpdated=!0);fieldUpdated||this.customFields.push({name:name,value:value})},hasCustomFields:function(){return 0<this.customFields.length},formatWithException:function(loggingEvent){var formatted=this.format(loggingEvent);return loggingEvent.exception&&this.ignoresThrowable()&&(formatted+=loggingEvent.getThrowableStrRep()),formatted},toString:function(){handleError("Layout.toString: all layouts must override this method")}},log4javascript.Layout=Layout;var Appender=function(){},SimpleDateFormat;function SimpleLayout(){this.customFields=[]}function NullLayout(){this.customFields=[]}function XmlLayout(combineMessages){this.combineMessages=extractBooleanFromParam(combineMessages,!0),this.customFields=[]}function escapeNewLines(str){return str.replace(/\r\n|\r|\n/g,"\\r\\n")}function JsonLayout(readable,combineMessages){this.readable=extractBooleanFromParam(readable,!1),this.combineMessages=extractBooleanFromParam(combineMessages,!0),this.batchHeader=this.readable?"["+newLine:"[",this.batchFooter=this.readable?"]"+newLine:"]",this.batchSeparator=this.readable?","+newLine:",",this.setKeys(),this.colon=this.readable?": ":":",this.tab=this.readable?"\t":"",this.lineBreak=this.readable?newLine:"",this.customFields=[]}function HttpPostDataLayout(){this.setKeys(),this.customFields=[],this.returnsPostData=!0}function formatObjectExpansion(obj,depth,indentation){var objectsExpanded=[];return function doFormat(obj,depth,indentation){var i,len,childDepth,childIndentation,childLines,expansion,childExpansion;function formatString(text){for(var lines=splitIntoLines(text),j=1,jLen=lines.length;j<jLen;j++)lines[j]=indentation+lines[j];return lines.join(newLine)}if(indentation||(indentation=""),null===obj)return"null";if(void 0===obj)return"undefined";if("string"==typeof obj)return formatString(obj);if("object"==typeof obj&&array_contains(objectsExpanded,obj)){try{expansion=toStr(obj)}catch(ex){expansion="Error formatting property. Details: "+getExceptionStringRep(ex)}return expansion+" [already expanded]"}if(obj instanceof Array&&0<depth){for(objectsExpanded.push(obj),expansion="["+newLine,childDepth=depth-1,childIndentation=indentation+"  ",childLines=[],i=0,len=obj.length;i<len;i++)try{childExpansion=doFormat(obj[i],childDepth,childIndentation),childLines.push(childIndentation+childExpansion)}catch(ex){childLines.push(childIndentation+"Error formatting array member. Details: "+getExceptionStringRep(ex))}return expansion+=childLines.join(","+newLine)+newLine+indentation+"]"}if("[object Date]"==Object.prototype.toString.call(obj))return obj.toString();if("object"==typeof obj&&0<depth){for(i in objectsExpanded.push(obj),expansion="{"+newLine,childDepth=depth-1,childIndentation=indentation+"  ",childLines=[],obj)try{childExpansion=doFormat(obj[i],childDepth,childIndentation),childLines.push(childIndentation+i+": "+childExpansion)}catch(ex){childLines.push(childIndentation+i+": Error formatting property. Details: "+getExceptionStringRep(ex))}return expansion+=childLines.join(","+newLine)+newLine+indentation+"}"}return formatString(toStr(obj))}(obj,depth,indentation)}function PatternLayout(pattern){this.pattern=pattern||PatternLayout.DEFAULT_CONVERSION_PATTERN,this.customFields=[]}Appender.prototype=new EventSupport,Appender.prototype.layout=new PatternLayout,Appender.prototype.threshold=Level.ALL,Appender.prototype.loggers=[],Appender.prototype.doAppend=function(loggingEvent){enabled&&loggingEvent.level.level>=this.threshold.level&&this.append(loggingEvent)},Appender.prototype.append=function(loggingEvent){},Appender.prototype.setLayout=function(layout){layout instanceof Layout?this.layout=layout:handleError("Appender.setLayout: layout supplied to "+this.toString()+" is not a subclass of Layout")},Appender.prototype.getLayout=function(){return this.layout},Appender.prototype.setThreshold=function(threshold){threshold instanceof Level?this.threshold=threshold:handleError("Appender.setThreshold: threshold supplied to "+this.toString()+" is not a subclass of Level")},Appender.prototype.getThreshold=function(){return this.threshold},Appender.prototype.setAddedToLogger=function(logger){this.loggers.push(logger)},Appender.prototype.setRemovedFromLogger=function(logger){array_remove(this.loggers,logger)},Appender.prototype.group=emptyFunction,Appender.prototype.groupEnd=emptyFunction,Appender.prototype.toString=function(){handleError("Appender.toString: all appenders must override this method")},log4javascript.Appender=Appender,SimpleLayout.prototype=new Layout,SimpleLayout.prototype.format=function(loggingEvent){return loggingEvent.level.name+" - "+loggingEvent.getCombinedMessages()},SimpleLayout.prototype.ignoresThrowable=function(){return!0},SimpleLayout.prototype.toString=function(){return"SimpleLayout"},log4javascript.SimpleLayout=SimpleLayout,NullLayout.prototype=new Layout,NullLayout.prototype.format=function(loggingEvent){return loggingEvent.messages},NullLayout.prototype.ignoresThrowable=function(){return!0},NullLayout.prototype.formatWithException=function(loggingEvent){var messages=loggingEvent.messages,ex=loggingEvent.exception;return ex?messages.concat([ex]):messages},NullLayout.prototype.toString=function(){return"NullLayout"},log4javascript.NullLayout=NullLayout,XmlLayout.prototype=new Layout,XmlLayout.prototype.isCombinedMessages=function(){return this.combineMessages},XmlLayout.prototype.getContentType=function(){return"text/xml"},XmlLayout.prototype.escapeCdata=function(str){return str.replace(/\]\]>/,"]]>]]&gt;<![CDATA[")},XmlLayout.prototype.format=function(loggingEvent){var i,len,layout=this;function formatMessage(message){return message="string"==typeof message?message:toStr(message),"<log4javascript:message><![CDATA["+layout.escapeCdata(message)+"]]></log4javascript:message>"}var str='<log4javascript:event logger="'+loggingEvent.logger.name+'" timestamp="'+this.getTimeStampValue(loggingEvent)+'"';if(this.isTimeStampsInMilliseconds()||(str+=' milliseconds="'+loggingEvent.milliseconds+'"'),str+=' level="'+loggingEvent.level.name+'">'+newLine,this.combineMessages)str+=formatMessage(loggingEvent.getCombinedMessages());else{for(str+="<log4javascript:messages>"+newLine,i=0,len=loggingEvent.messages.length;i<len;i++)str+=formatMessage(loggingEvent.messages[i])+newLine;str+="</log4javascript:messages>"+newLine}if(this.hasCustomFields())for(i=0,len=this.customFields.length;i<len;i++)str+='<log4javascript:customfield name="'+this.customFields[i].name+'"><![CDATA['+this.customFields[i].value.toString()+"]]></log4javascript:customfield>"+newLine;return loggingEvent.exception&&(str+="<log4javascript:exception><![CDATA["+getExceptionStringRep(loggingEvent.exception)+"]]></log4javascript:exception>"+newLine),str+="</log4javascript:event>"+newLine+newLine},XmlLayout.prototype.ignoresThrowable=function(){return!1},XmlLayout.prototype.toString=function(){return"XmlLayout"},log4javascript.XmlLayout=XmlLayout,JsonLayout.prototype=new Layout,JsonLayout.prototype.isReadable=function(){return this.readable},JsonLayout.prototype.isCombinedMessages=function(){return this.combineMessages},JsonLayout.prototype.format=function(loggingEvent){var i,len,layout=this,dataValues=this.getDataValues(loggingEvent,this.combineMessages),str="{"+this.lineBreak;function formatValue(val,prefix,expand){var formattedValue,valType=typeof val;if(val instanceof Date)formattedValue=String(val.getTime());else if(expand&&val instanceof Array){formattedValue="["+layout.lineBreak;for(var i=0,len=val.length;i<len;i++){var childPrefix=prefix+layout.tab;formattedValue+=childPrefix+formatValue(val[i],childPrefix,!1),i<val.length-1&&(formattedValue+=","),formattedValue+=layout.lineBreak}formattedValue+=prefix+"]"}else formattedValue="number"!==valType&&"boolean"!==valType?'"'+escapeNewLines(toStr(val).replace(/\"/g,'\\"'))+'"':val;return formattedValue}for(i=0,len=dataValues.length-1;i<=len;i++)str+=this.tab+'"'+dataValues[i][0]+'"'+this.colon+formatValue(dataValues[i][1],this.tab,!0),i<len&&(str+=","),str+=this.lineBreak;return str+="}"+this.lineBreak},JsonLayout.prototype.ignoresThrowable=function(){return!1},JsonLayout.prototype.toString=function(){return"JsonLayout"},JsonLayout.prototype.getContentType=function(){return"application/json"},log4javascript.JsonLayout=JsonLayout,HttpPostDataLayout.prototype=new Layout,HttpPostDataLayout.prototype.allowBatching=function(){return!1},HttpPostDataLayout.prototype.format=function(loggingEvent){for(var dataValues=this.getDataValues(loggingEvent),queryBits=[],i=0,len=dataValues.length;i<len;i++){var val=dataValues[i][1]instanceof Date?String(dataValues[i][1].getTime()):dataValues[i][1];queryBits.push(urlEncode(dataValues[i][0])+"="+urlEncode(val))}return queryBits.join("&")},HttpPostDataLayout.prototype.ignoresThrowable=function(loggingEvent){return!1},HttpPostDataLayout.prototype.toString=function(){return"HttpPostDataLayout"},log4javascript.HttpPostDataLayout=HttpPostDataLayout,function(){var regex=/('[^']*')|(G+|y+|M+|w+|W+|D+|d+|F+|E+|a+|H+|k+|K+|h+|m+|s+|S+|Z+)|([a-zA-Z]+)|([^a-zA-Z']+)/,monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],types={G:0,y:3,M:4,w:2,W:2,D:2,d:2,F:2,E:1,a:0,H:2,k:2,K:2,h:2,m:2,s:2,S:2,Z:5},newDateAtMidnight=function(year,month,day){var d=new Date(year,month,day,0,0,0);return d.setMilliseconds(0),d};Date.prototype.getDifference=function(date){return this.getTime()-date.getTime()},Date.prototype.isBefore=function(d){return this.getTime()<d.getTime()},Date.prototype.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())},Date.prototype.getTimeSince=function(d){return this.getUTCTime()-d.getUTCTime()},Date.prototype.getPreviousSunday=function(){var midday=new Date(this.getFullYear(),this.getMonth(),this.getDate(),12,0,0),previousSunday=new Date(midday.getTime()-864e5*this.getDay());return newDateAtMidnight(previousSunday.getFullYear(),previousSunday.getMonth(),previousSunday.getDate())},Date.prototype.getWeekInYear=function(minimalDaysInFirstWeek){isUndefined(this.minimalDaysInFirstWeek)&&(minimalDaysInFirstWeek=1);var previousSunday=this.getPreviousSunday(),startOfYear=newDateAtMidnight(this.getFullYear(),0,1),weekInYear=previousSunday.isBefore(startOfYear)?0:1+Math.floor(previousSunday.getTimeSince(startOfYear)/6048e5);return 7-startOfYear.getDay()<minimalDaysInFirstWeek&&weekInYear--,weekInYear},Date.prototype.getWeekInMonth=function(minimalDaysInFirstWeek){isUndefined(this.minimalDaysInFirstWeek)&&(minimalDaysInFirstWeek=1);var previousSunday=this.getPreviousSunday(),startOfMonth=newDateAtMidnight(this.getFullYear(),this.getMonth(),1),weekInMonth=previousSunday.isBefore(startOfMonth)?0:1+Math.floor(previousSunday.getTimeSince(startOfMonth)/6048e5);return minimalDaysInFirstWeek<=7-startOfMonth.getDay()&&weekInMonth++,weekInMonth},Date.prototype.getDayInYear=function(){var startOfYear=newDateAtMidnight(this.getFullYear(),0,1);return 1+Math.floor(this.getTimeSince(startOfYear)/864e5)},(SimpleDateFormat=function(formatString){this.formatString=formatString}).prototype.setMinimalDaysInFirstWeek=function(days){this.minimalDaysInFirstWeek=days},SimpleDateFormat.prototype.getMinimalDaysInFirstWeek=function(){return isUndefined(this.minimalDaysInFirstWeek)?1:this.minimalDaysInFirstWeek};var padWithZeroes=function(str,len){for(;str.length<len;)str="0"+str;return str},formatText=function(data,numberOfLetters,minLength){return 4<=numberOfLetters?data:data.substr(0,Math.max(minLength,numberOfLetters))},formatNumber=function(data,numberOfLetters){return padWithZeroes(""+data,numberOfLetters)};SimpleDateFormat.prototype.format=function(date){for(var result,formattedString="",searchString=this.formatString;result=regex.exec(searchString);){var quotedString=result[1],patternLetters=result[2],otherLetters=result[3],otherCharacters=result[4];if(quotedString)formattedString+="''"==quotedString?"'":quotedString.substring(1,quotedString.length-1);else if(otherLetters);else if(otherCharacters)formattedString+=otherCharacters;else if(patternLetters){var patternLetter=patternLetters.charAt(0),numberOfLetters=patternLetters.length,rawData="";switch(patternLetter){case"G":rawData="AD";break;case"y":rawData=date.getFullYear();break;case"M":rawData=date.getMonth();break;case"w":rawData=date.getWeekInYear(this.getMinimalDaysInFirstWeek());break;case"W":rawData=date.getWeekInMonth(this.getMinimalDaysInFirstWeek());break;case"D":rawData=date.getDayInYear();break;case"d":rawData=date.getDate();break;case"F":rawData=1+Math.floor((date.getDate()-1)/7);break;case"E":rawData=dayNames[date.getDay()];break;case"a":rawData=12<=date.getHours()?"PM":"AM";break;case"H":rawData=date.getHours();break;case"k":rawData=date.getHours()||24;break;case"K":rawData=date.getHours()%12;break;case"h":rawData=date.getHours()%12||12;break;case"m":rawData=date.getMinutes();break;case"s":rawData=date.getSeconds();break;case"S":rawData=date.getMilliseconds();break;case"Z":rawData=date.getTimezoneOffset()}switch(types[patternLetter]){case 0:formattedString+=formatText(rawData,numberOfLetters,2);break;case 1:formattedString+=formatText(rawData,numberOfLetters,3);break;case 2:formattedString+=formatNumber(rawData,numberOfLetters);break;case 3:if(numberOfLetters<=3)formattedString+=(""+rawData).substr(2,2);else formattedString+=formatNumber(rawData,numberOfLetters);break;case 4:formattedString+=3<=numberOfLetters?formatText(monthNames[rawData],numberOfLetters,numberOfLetters):formatNumber(rawData+1,numberOfLetters);break;case 5:var prefix=0<rawData?"-":"+",absData=Math.abs(rawData),hours=""+Math.floor(absData/60),minutes=""+absData%60;formattedString+=prefix+(hours=padWithZeroes(hours,2))+(minutes=padWithZeroes(minutes,2))}}searchString=searchString.substr(result.index+result[0].length)}return formattedString}}(),log4javascript.SimpleDateFormat=SimpleDateFormat,PatternLayout.TTCC_CONVERSION_PATTERN="%r %p %c - %m%n",PatternLayout.DEFAULT_CONVERSION_PATTERN="%m%n",PatternLayout.ISO8601_DATEFORMAT="yyyy-MM-dd HH:mm:ss,SSS",PatternLayout.DATETIME_DATEFORMAT="dd MMM yyyy HH:mm:ss,SSS",PatternLayout.ABSOLUTETIME_DATEFORMAT="HH:mm:ss,SSS",PatternLayout.prototype=new Layout,PatternLayout.prototype.format=function(loggingEvent){for(var result,regex=/%(-?[0-9]+)?(\.?[0-9]+)?([acdfmMnpr%])(\{([^\}]+)\})?|([^%]+)/,formattedString="",searchString=this.pattern;result=regex.exec(searchString);){var matchedString=result[0],padding=result[1],truncation=result[2],conversionCharacter=result[3],specifier=result[5],text=result[6];if(text)formattedString+=""+text;else{var l,replacement="";switch(conversionCharacter){case"a":case"m":var depth=0;specifier&&(depth=parseInt(specifier,10),isNaN(depth)&&(handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character '"+conversionCharacter+"' - should be a number"),depth=0));for(var messages="a"===conversionCharacter?loggingEvent.messages[0]:loggingEvent.messages,i=0,len=messages.length;i<len;i++)0<i&&" "!==replacement.charAt(replacement.length-1)&&(replacement+=" "),replacement+=0===depth?messages[i]:formatObjectExpansion(messages[i],depth);break;case"c":var loggerName=loggingEvent.logger.name;if(specifier){var precision=parseInt(specifier,10),loggerNameBits=loggingEvent.logger.name.split(".");replacement=precision>=loggerNameBits.length?loggerName:loggerNameBits.slice(loggerNameBits.length-precision).join(".")}else replacement=loggerName;break;case"d":var dateFormat=PatternLayout.ISO8601_DATEFORMAT;specifier&&("ISO8601"==(dateFormat=specifier)?dateFormat=PatternLayout.ISO8601_DATEFORMAT:"ABSOLUTE"==dateFormat?dateFormat=PatternLayout.ABSOLUTETIME_DATEFORMAT:"DATE"==dateFormat&&(dateFormat=PatternLayout.DATETIME_DATEFORMAT)),replacement=new SimpleDateFormat(dateFormat).format(loggingEvent.timeStamp);break;case"f":if(this.hasCustomFields()){var fieldIndex=0;specifier&&(fieldIndex=parseInt(specifier,10),isNaN(fieldIndex)?handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - should be a number"):0===fieldIndex?handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - must be greater than zero"):fieldIndex>this.customFields.length?handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - there aren't that many custom fields"):fieldIndex-=1);var val=this.customFields[fieldIndex].value;"function"==typeof val&&(val=val(this,loggingEvent)),replacement=val}break;case"n":replacement=newLine;break;case"p":replacement=loggingEvent.level.name;break;case"r":replacement=""+loggingEvent.timeStamp.getDifference(applicationStartDate);break;case"%":replacement="%";break;default:replacement=matchedString}if(truncation){l=parseInt(truncation.substr(1),10);var strLen=replacement.length;l<strLen&&(replacement=replacement.substring(strLen-l,strLen))}if(padding)if("-"==padding.charAt(0))for(l=parseInt(padding.substr(1),10);replacement.length<l;)replacement+=" ";else for(l=parseInt(padding,10);replacement.length<l;)replacement=" "+replacement;formattedString+=replacement}searchString=searchString.substr(result.index+result[0].length)}return formattedString},PatternLayout.prototype.ignoresThrowable=function(){return!0},PatternLayout.prototype.toString=function(){return"PatternLayout"},log4javascript.PatternLayout=PatternLayout;var xhrFactory=function(){return new XMLHttpRequest},xmlHttpFactories=[xhrFactory,function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],withCredentialsSupported=!1,getXmlHttp=function(errorHandler){for(var factory,xmlHttp=null,i=0,len=xmlHttpFactories.length;i<len;i++){factory=xmlHttpFactories[i];try{return xmlHttp=factory(),withCredentialsSupported=factory==xhrFactory&&"withCredentials"in xmlHttp,getXmlHttp=factory,xmlHttp}catch(e){}}errorHandler?errorHandler():handleError("getXmlHttp: unable to obtain XMLHttpRequest object")};function isHttpRequestSuccessful(xmlHttp){return isUndefined(xmlHttp.status)||0===xmlHttp.status||200<=xmlHttp.status&&xmlHttp.status<300||1223==xmlHttp.status}function AjaxAppender(url,withCredentials){var appender=this,isSupported=!0;url||(handleError("AjaxAppender: URL must be specified in constructor"),isSupported=!1);var timed=this.defaults.timed,waitForResponse=this.defaults.waitForResponse,batchSize=this.defaults.batchSize,timerInterval=this.defaults.timerInterval,requestSuccessCallback=this.defaults.requestSuccessCallback,failCallback=this.defaults.failCallback,postVarName=this.defaults.postVarName,sendAllOnUnload=this.defaults.sendAllOnUnload,contentType=this.defaults.contentType,sessionId=null,queuedLoggingEvents=[],queuedRequests=[],headers=[],sending=!1,initialized=!1;function checkCanConfigure(configOptionName){return!initialized||(handleError("AjaxAppender: configuration option '"+configOptionName+"' may not be set after the appender has been initialized"),!1)}function sendAll(){var currentRequestBatch;if(isSupported&&enabled)if(sending=!0,waitForResponse)0<queuedRequests.length?sendRequest(preparePostData(currentRequestBatch=queuedRequests.shift()),sendAll):(sending=!1,timed&&scheduleSending());else{for(;currentRequestBatch=queuedRequests.shift();)sendRequest(preparePostData(currentRequestBatch));sending=!1,timed&&scheduleSending()}}function sendAllRemaining(){var sendingAnything=!1;if(isSupported&&enabled){for(var currentLoggingEvent,actualBatchSize=appender.getLayout().allowBatching()?batchSize:1,batchedLoggingEvents=[];currentLoggingEvent=queuedLoggingEvents.shift();)batchedLoggingEvents.push(currentLoggingEvent),queuedLoggingEvents.length>=actualBatchSize&&(queuedRequests.push(batchedLoggingEvents),batchedLoggingEvents=[]);0<batchedLoggingEvents.length&&queuedRequests.push(batchedLoggingEvents),sendingAnything=0<queuedRequests.length,timed=waitForResponse=!1,sendAll()}return sendingAnything}function preparePostData(batchedLoggingEvents){for(var currentLoggingEvent,formattedMessages=[],postData="";currentLoggingEvent=batchedLoggingEvents.shift();)formattedMessages.push(appender.getLayout().formatWithException(currentLoggingEvent));return postData=1==batchedLoggingEvents.length?formattedMessages.join(""):appender.getLayout().batchHeader+formattedMessages.join(appender.getLayout().batchSeparator)+appender.getLayout().batchFooter,contentType==appender.defaults.contentType&&(0<(postData=appender.getLayout().returnsPostData?postData:urlEncode(postVarName)+"="+urlEncode(postData)).length&&(postData+="&"),postData+="layout="+urlEncode(appender.getLayout().toString())),postData}function scheduleSending(){window.setTimeout(sendAll,timerInterval)}function xmlHttpErrorHandler(){var msg="AjaxAppender: could not create XMLHttpRequest object. AjaxAppender disabled";handleError(msg),isSupported=!1,failCallback&&failCallback(msg)}function sendRequest(postData,successCallback){try{var xmlHttp=getXmlHttp(xmlHttpErrorHandler);if(isSupported){xmlHttp.onreadystatechange=function(){if(4==xmlHttp.readyState){if(isHttpRequestSuccessful(xmlHttp))requestSuccessCallback&&requestSuccessCallback(xmlHttp),successCallback&&successCallback(xmlHttp);else{var msg="AjaxAppender.append: XMLHttpRequest request to URL "+url+" returned status code "+xmlHttp.status;handleError(msg),failCallback&&failCallback(msg)}xmlHttp.onreadystatechange=emptyFunction,xmlHttp=null}},xmlHttp.open("POST",url,!0),withCredentials&&withCredentialsSupported&&(xmlHttp.withCredentials=!0);try{for(var header,i=0;header=headers[i++];)xmlHttp.setRequestHeader(header.name,header.value);xmlHttp.setRequestHeader("Content-Type",contentType)}catch(headerEx){var msg="AjaxAppender.append: your browser's XMLHttpRequest implementation does not support setRequestHeader, therefore cannot post data. AjaxAppender disabled";return handleError(msg),isSupported=!1,void(failCallback&&failCallback(msg))}xmlHttp.send(postData)}}catch(ex){var errMsg="AjaxAppender.append: error sending log message to "+url;handleError(errMsg,ex),isSupported=!1,failCallback&&failCallback(errMsg+". Details: "+getExceptionStringRep(ex))}}this.getSessionId=function(){return sessionId},this.setSessionId=function(sessionIdParam){sessionId=extractStringFromParam(sessionIdParam,null),this.layout.setCustomField("sessionid",sessionId)},this.setLayout=function(layoutParam){checkCanConfigure("layout")&&(this.layout=layoutParam,null!==sessionId&&this.setSessionId(sessionId))},this.isTimed=function(){return timed},this.setTimed=function(timedParam){checkCanConfigure("timed")&&(timed=bool(timedParam))},this.getTimerInterval=function(){return timerInterval},this.setTimerInterval=function(timerIntervalParam){checkCanConfigure("timerInterval")&&(timerInterval=extractIntFromParam(timerIntervalParam,timerInterval))},this.isWaitForResponse=function(){return waitForResponse},this.setWaitForResponse=function(waitForResponseParam){checkCanConfigure("waitForResponse")&&(waitForResponse=bool(waitForResponseParam))},this.getBatchSize=function(){return batchSize},this.setBatchSize=function(batchSizeParam){checkCanConfigure("batchSize")&&(batchSize=extractIntFromParam(batchSizeParam,batchSize))},this.isSendAllOnUnload=function(){return sendAllOnUnload},this.setSendAllOnUnload=function(sendAllOnUnloadParam){checkCanConfigure("sendAllOnUnload")&&(sendAllOnUnload=extractBooleanFromParam(sendAllOnUnloadParam,sendAllOnUnload))},this.setRequestSuccessCallback=function(requestSuccessCallbackParam){requestSuccessCallback=extractFunctionFromParam(requestSuccessCallbackParam,requestSuccessCallback)},this.setFailCallback=function(failCallbackParam){failCallback=extractFunctionFromParam(failCallbackParam,failCallback)},this.getPostVarName=function(){return postVarName},this.setPostVarName=function(postVarNameParam){checkCanConfigure("postVarName")&&(postVarName=extractStringFromParam(postVarNameParam,postVarName))},this.getHeaders=function(){return headers},this.addHeader=function(name,value){"content-type"==name.toLowerCase()?contentType=value:headers.push({name:name,value:value})},this.sendAll=sendAll,this.sendAllRemaining=sendAllRemaining,this.append=function(loggingEvent){if(isSupported){initialized||function(){if(initialized=!0,sendAllOnUnload){var oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){oldBeforeUnload&&oldBeforeUnload(),sendAllRemaining()}}timed&&scheduleSending()}(),queuedLoggingEvents.push(loggingEvent);var actualBatchSize=this.getLayout().allowBatching()?batchSize:1;if(queuedLoggingEvents.length>=actualBatchSize){for(var currentLoggingEvent,batchedLoggingEvents=[];currentLoggingEvent=queuedLoggingEvents.shift();)batchedLoggingEvents.push(currentLoggingEvent);queuedRequests.push(batchedLoggingEvents),timed||waitForResponse&&(!waitForResponse||sending)||sendAll()}}}}function createDefaultLogger(){return log4javascript.getLogger(defaultLoggerName)}if(AjaxAppender.prototype=new Appender,AjaxAppender.prototype.defaults={waitForResponse:!1,timed:!1,timerInterval:1e3,batchSize:1,sendAllOnUnload:!1,requestSuccessCallback:null,failCallback:null,postVarName:"data",contentType:"application/x-www-form-urlencoded"},AjaxAppender.prototype.layout=new HttpPostDataLayout,AjaxAppender.prototype.toString=function(){return"AjaxAppender"},log4javascript.AjaxAppender=AjaxAppender,log4javascript.setDocumentReady=function(){pageLoaded=!0,log4javascript.dispatchEvent("load",{})},window.addEventListener)window.addEventListener("load",log4javascript.setDocumentReady,!1);else if(window.attachEvent)window.attachEvent("onload",log4javascript.setDocumentReady);else{var oldOnload=window.onload;"function"!=typeof window.onload?window.onload=log4javascript.setDocumentReady:window.onload=function(evt){oldOnload&&oldOnload(evt),log4javascript.setDocumentReady()}}return log4javascript},this),function($){$.floatThead=$.floatThead||{},$.floatThead.defaults={headerCellSelector:"tr:visible:first>*:visible",zIndex:1001,position:"auto",top:0,bottom:0,scrollContainer:function($table){return $([])},responsiveContainer:function($table){return $([])},getSizingRow:function($table,$cols,$fthCells){return $table.find("tbody tr:visible:first>*:visible")},ariaLabel:function($table,$headerCell,columnIndex){return $headerCell.text()},floatTableClass:"floatThead-table",floatWrapperClass:"floatThead-wrapper",floatContainerClass:"floatThead-container",copyTableClass:!0,autoReflow:!1,debug:!1,support:{bootstrap:!0,datatables:!0,jqueryUI:!0,perfectScrollbar:!0},floatContainerCss:{"overflow-x":"hidden"}};var util=function(){var that={},hasOwnProperty=Object.prototype.hasOwnProperty;that.has=function(obj,key){return hasOwnProperty.call(obj,key)},that.keys=Object.keys||function(obj){if(obj!==Object(obj))throw new TypeError("Invalid object");var keys=[];for(var key in obj)that.has(obj,key)&&keys.push(key);return keys};var idCounter=0;return that.uniqueId=function(prefix){var id=++idCounter+"";return prefix?prefix+id:id},$.each(["Arguments","Function","String","Number","Date","RegExp"],function(){var name=this;that["is"+name]=function(obj){return Object.prototype.toString.call(obj)==="[object "+name+"]"}}),that.debounce=function(func,wait,immediate){var timeout,args,context,timestamp,result;return function(){context=this,args=arguments,timestamp=new Date;var later=function(){var last=new Date-timestamp;last<wait?timeout=setTimeout(later,wait-last):(timeout=null,immediate||(result=func.apply(context,args)))},callNow=immediate&&!timeout;return timeout||(timeout=setTimeout(later,wait)),callNow&&(result=func.apply(context,args)),result}},that}(),globalCanObserveMutations="undefined"!=typeof MutationObserver,ieVersion=function(){for(var a=3,b=document.createElement("b"),c=b.all||[];a=1+a,b.innerHTML="\x3c!--[if gt IE "+a+"]><i><![endif]--\x3e",c[0];);return 4<a?a:document.documentMode}(),isFF=/Gecko\//.test(navigator.userAgent),isWebkit=/WebKit\//.test(navigator.userAgent),isRTL=/rtl/i.test(document.documentElement.dir||"");ieVersion||isFF||isWebkit||(ieVersion=11);var isTableWidthBug=function(){if(isWebkit){var $test=$("<div>").css("width",0).append($("<table>").css("max-width","100%").append($("<tr>").append($("<th>").append($("<div>").css("min-width",100).text("X")))));$("body").append($test);var ret=0===$test.find("table").width();return $test.remove(),ret}return!1},createElements=!isFF&&!ieVersion,$window=$(window),buggyMatchMedia=isFF&&window.matchMedia;if(!window.matchMedia||buggyMatchMedia){var _beforePrint=window.onbeforeprint,_afterPrint=window.onafterprint;window.onbeforeprint=function(){_beforePrint&&_beforePrint(),$window.triggerHandler("fth-beforeprint")},window.onafterprint=function(){_afterPrint&&_afterPrint(),$window.triggerHandler("fth-afterprint")}}function getClosestScrollContainer($elem){var parent=$elem[0].parentElement;do{if("visible"!==window.getComputedStyle(parent).getPropertyValue("overflow"))break}while(parent=parent.parentElement);return parent===document.body?$([]):$(parent)}function debug(str){window&&window.console&&window.console.error&&window.console.error("jQuery.floatThead: "+str)}function getOffsetWidth(el){var rect=el.getBoundingClientRect();return rect.width||rect.right-rect.left}function scrollbarWidth(){var d=document.createElement("scrolltester");d.style.cssText="width:100px;height:100px;overflow:scroll!important;position:absolute;top:-9999px;display:block",document.body.appendChild(d);var result=d.offsetWidth-d.clientWidth;return document.body.removeChild(d),result}function tableWidth($table,$fthCells,isOuter){var fn=isOuter?"outerWidth":"width";if(isTableWidthBug&&$table.css("max-width")){var w=0;isOuter&&(w+=parseInt($table.css("borderLeft"),10),w+=parseInt($table.css("borderRight"),10));for(var i=0;i<$fthCells.length;i++)w+=getOffsetWidth($fthCells.get(i));return w}return $table[fn]()}$.fn.floatThead=function(map){if(map=map||{},ieVersion<8)return this;if(util.isFunction(isTableWidthBug)&&(isTableWidthBug=isTableWidthBug()),util.isString(map)){var command=map,args=Array.prototype.slice.call(arguments,1),ret=this;return this.filter("table").each(function(){var $this=$(this),opts=$this.data("floatThead-lazy");opts&&$this.floatThead(opts);var obj=$this.data("floatThead-attached");if(obj&&util.isFunction(obj[command])){var r=obj[command].apply(this,args);r!==undefined&&(ret=r)}}),ret}var opts=$.extend({},$.floatThead.defaults||{},map);if($.each(map,function(key,val){key in $.floatThead.defaults||!opts.debug||debug("Used ["+key+"] key to init plugin, but that param is not an option for the plugin. Valid options are: "+util.keys($.floatThead.defaults).join(", "))}),opts.debug){var v=$.fn.jquery.split(".");1===parseInt(v[0],10)&&parseInt(v[1],10)<=7&&debug("jQuery version "+$.fn.jquery+" detected! This plugin supports 1.8 or better, or 1.7.x with jQuery UI 1.8.24 -> http://jqueryui.com/resources/download/jquery-ui-1.8.24.zip")}return this.filter(":not(."+opts.floatTableClass+")").each(function(){var floatTheadId=util.uniqueId(),$table=$(this);if($table.data("floatThead-attached"))return!0;if(!$table.is("table"))throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');var canObserveMutations=opts.autoReflow&&globalCanObserveMutations,mObs=null,$header=$table.children("thead:first"),$tbody=$table.children("tbody:first");if(0===$header.length||0===$tbody.length)return opts.debug&&(0===$header.length?debug("The thead element is missing."):debug("The tbody element is missing.")),$table.data("floatThead-lazy",opts),void $table.unbind("reflow").one("reflow",function(){$table.floatThead(opts)});$table.data("floatThead-lazy")&&$table.unbind("reflow"),$table.data("floatThead-lazy",!1);var scrollingTop,scrollingBottom,headerFloated=!0,scrollbarOffset={vertical:0,horizontal:0};util.isFunction(scrollbarWidth)&&(scrollbarWidth=scrollbarWidth());var lastColumnCount=0;!0===opts.scrollContainer&&(opts.scrollContainer=getClosestScrollContainer);var $scrollContainer=opts.scrollContainer($table)||$([]),locked=0<$scrollContainer.length,$responsiveContainer=locked?$([]):opts.responsiveContainer($table)||$([]),responsive=isResponsiveContainerActive(),useAbsolutePositioning=null;"auto"===opts.position?useAbsolutePositioning=null:"fixed"===opts.position?useAbsolutePositioning=!1:"absolute"===opts.position?useAbsolutePositioning=!0:opts.debug&&debug('Invalid value given to "position" option, valid is "fixed", "absolute" and "auto". You passed: ',opts.position),null==useAbsolutePositioning&&(useAbsolutePositioning=locked);var $caption=$table.find("caption"),haveCaption=1===$caption.length;if(haveCaption)var captionAlignTop="top"===($caption.css("caption-side")||$caption.attr("align")||"top");var $fthGrp=$("<fthfoot>").css({display:"table-footer-group","border-spacing":0,height:0,"border-collapse":"collapse",visibility:"hidden"}),wrappedContainer=!1,$wrapper=$([]),absoluteToFixedOnScroll=ieVersion<=9&&!locked&&useAbsolutePositioning,$floatTable=$("<table/>"),$floatColGroup=$("<colgroup/>"),$tableColGroup=$table.children("colgroup:first"),existingColGroup=!0;0===$tableColGroup.length&&($tableColGroup=$("<colgroup/>"),existingColGroup=!1);var colSelector=existingColGroup?"col:visible":"col",$fthRow=$("<fthtr>").css({display:"table-row","border-spacing":0,height:0,"border-collapse":"collapse"}),$floatContainer=$("<div>").css(opts.floatContainerCss).attr("aria-hidden","true"),floatTableHidden=!1,$newHeader=$("<thead/>"),$sizerRow=$('<tr class="size-row"/>'),$sizerCells=$([]),$tableCells=$([]),$headerCells=$([]),$fthCells=$([]);$newHeader.append($sizerRow),$table.prepend($tableColGroup),createElements&&($fthGrp.append($fthRow),$table.append($fthGrp)),$floatTable.append($floatColGroup),$floatContainer.append($floatTable),opts.copyTableClass&&$floatTable.attr("class",$table.attr("class")),$floatTable.attr({cellpadding:$table.attr("cellpadding"),cellspacing:$table.attr("cellspacing"),border:$table.attr("border")});var tableDisplayCss=$table.css("display");if($floatTable.css({borderCollapse:$table.css("borderCollapse"),border:$table.css("border"),display:tableDisplayCss}),locked||$floatTable.css("width","auto"),"none"===tableDisplayCss&&(floatTableHidden=!0),$floatTable.addClass(opts.floatTableClass).css({margin:0,"border-bottom-width":0}),useAbsolutePositioning){var makeRelative=function($container,alwaysWrap){var positionCss=$container.css("position"),$containerWrap=$container;if(!("relative"===positionCss||"absolute"===positionCss)||alwaysWrap){var css={paddingLeft:$container.css("paddingLeft"),paddingRight:$container.css("paddingRight")};$floatContainer.css(css),$containerWrap=$container.data("floatThead-containerWrap")||$container.wrap($("<div>").addClass(opts.floatWrapperClass).css({position:"relative",clear:"both"})).parent(),$container.data("floatThead-containerWrap",$containerWrap),wrappedContainer=!0}return $containerWrap};locked?($wrapper=makeRelative($scrollContainer,!0)).prepend($floatContainer):($wrapper=makeRelative($table),$table.before($floatContainer))}else $table.before($floatContainer);$floatContainer.css({position:useAbsolutePositioning?"absolute":"fixed",marginTop:0,top:useAbsolutePositioning?0:"auto",zIndex:opts.zIndex,willChange:"transform"}),$floatContainer.addClass(opts.floatContainerClass),updateScrollingOffsets();var layoutFixed={"table-layout":"fixed"},layoutAuto={"table-layout":$table.css("tableLayout")||"auto"},originalTableWidth=$table[0].style.width||"",originalTableMinWidth=$table.css("minWidth")||"";function eventName(name){return name+".fth-"+floatTheadId+".floatTHead"}function setHeaderHeight(){var headerHeight=0;if($header.children("tr:visible").each(function(){headerHeight+=$(this).outerHeight(!0)}),"collapse"===$table.css("border-collapse")){var tableBorderTopHeight=parseInt($table.css("border-top-width"),10);parseInt($table.find("thead tr:first").find(">*:first").css("border-top-width"),10)<tableBorderTopHeight&&(headerHeight-=tableBorderTopHeight/2)}$sizerRow.outerHeight(headerHeight),$sizerCells.outerHeight(headerHeight)}function updateScrollingOffsets(){scrollingTop=(util.isFunction(opts.top)?opts.top($table):opts.top)||0,scrollingBottom=(util.isFunction(opts.bottom)?opts.bottom($table):opts.bottom)||0}function refloat(){if(!headerFloated){if(headerFloated=!0,useAbsolutePositioning){var tw=tableWidth($table,$fthCells,!0);$wrapper.width()<tw&&$table.css("minWidth",tw)}$table.css(layoutFixed),$floatTable.css(layoutFixed),$floatTable.append($header),$tbody.before($newHeader),setHeaderHeight()}}function unfloat(){headerFloated&&(headerFloated=!1,useAbsolutePositioning&&$table.width(originalTableWidth),$newHeader.detach(),$table.prepend($header),$table.css(layoutAuto),$floatTable.css(layoutAuto),$table.css("minWidth",originalTableMinWidth),$table.css("minWidth",tableWidth($table,$fthCells)))}var isHeaderFloatingLogical=!1;function triggerFloatEvent(isFloating){isHeaderFloatingLogical!==isFloating&&(isHeaderFloatingLogical=isFloating,$table.triggerHandler("floatThead",[isFloating,$floatContainer]))}function changePositioning(isAbsolute){useAbsolutePositioning!==isAbsolute&&(useAbsolutePositioning=isAbsolute,$floatContainer.css({position:useAbsolutePositioning?"absolute":"fixed"}))}function reflow(){var i,numCols=function(){var count,$headerColumns=$header.find(opts.headerCellSelector);if(existingColGroup?count=$tableColGroup.find(colSelector).length:(count=0,$headerColumns.each(function(){count+=parseInt($(this).attr("colspan")||1,10)})),count!==lastColumnCount){lastColumnCount=count;var cols=[],psuedo=[];$sizerRow.empty();for(var x=0;x<count;x++){var cell=document.createElement("th"),span=document.createElement("span");span.setAttribute("aria-label",opts.ariaLabel($table,$headerColumns.eq(x),x)),cell.appendChild(span),cell.className="floatThead-col",$sizerRow[0].appendChild(cell),cols.push("<col/>"),psuedo.push($("<fthtd>").css({display:"table-cell",height:0,width:"auto"}))}cols=existingColGroup?$tableColGroup.html():cols.join(""),createElements&&($fthRow.empty(),$fthRow.append(psuedo),$fthCells=$fthRow.find("fthtd")),$sizerCells=$sizerRow.find("th"),existingColGroup||$tableColGroup.html(cols),$tableCells=$tableColGroup.find(colSelector),$floatColGroup.html(cols),$headerCells=$floatColGroup.find(colSelector)}return count}();return function(){var scrollLeft=$floatContainer.scrollLeft();$tableCells=$tableColGroup.find(colSelector);var $rowCells=function($table,$cols,$fthCells,ieVersion){return createElements?$fthCells:ieVersion?opts.getSizingRow($table,$cols,$fthCells):$cols}($table,$tableCells,$fthCells,ieVersion);if($rowCells.length===numCols&&0<numCols){if(!existingColGroup)for(i=0;i<numCols;i++)$tableCells.eq(i).css("width","");unfloat();var widths=[];for(i=0;i<numCols;i++)widths[i]=getOffsetWidth($rowCells.get(i));for(i=0;i<numCols;i++)$headerCells.eq(i).width(widths[i]),$tableCells.eq(i).width(widths[i]);refloat()}else $floatTable.append($header),$table.css(layoutAuto),$floatTable.css(layoutAuto),setHeaderHeight();$floatContainer.scrollLeft(scrollLeft),$table.triggerHandler("reflowed",[$floatContainer])}}function floatContainerBorderWidth(side){var border=$scrollContainer.css("border-"+side+"-width"),w=0;return border&&~border.indexOf("px")&&(w=parseInt(border,10)),w}function isResponsiveContainerActive(){return"auto"===$responsiveContainer.css("overflow-x")}function calculateFloatContainerPosFn(){var floatEnd,scrollingContainerTop=$scrollContainer.scrollTop(),tableContainerGap=0,captionHeight=haveCaption?$caption.outerHeight(!0):0,captionScrollOffset=captionAlignTop?captionHeight:-captionHeight,floatContainerHeight=$floatContainer.height(),tableOffset=$table.offset(),tableLeftGap=0,tableTopGap=0;if(locked){var containerOffset=$scrollContainer.offset();tableContainerGap=tableOffset.top-containerOffset.top+scrollingContainerTop,haveCaption&&captionAlignTop&&(tableContainerGap+=captionHeight),tableLeftGap=floatContainerBorderWidth("left"),tableTopGap=floatContainerBorderWidth("top"),tableContainerGap-=tableTopGap}else floatEnd=tableOffset.top-scrollingTop-floatContainerHeight+scrollingBottom+scrollbarOffset.horizontal;var windowTop=$window.scrollTop(),windowLeft=$window.scrollLeft(),getScrollContainerLeft=function(){return(isResponsiveContainerActive()?$responsiveContainer:$scrollContainer).scrollLeft()||0},scrollContainerLeft=getScrollContainerLeft();return function(eventType){responsive=isResponsiveContainerActive();var isTableHidden=$table[0].offsetWidth<=0&&$table[0].offsetHeight<=0;if(!isTableHidden&&floatTableHidden)return floatTableHidden=!1,setTimeout(function(){$table.triggerHandler("reflow")},1),null;if(isTableHidden&&(floatTableHidden=!0,!useAbsolutePositioning))return null;if("windowScroll"===eventType)windowTop=$window.scrollTop(),windowLeft=$window.scrollLeft();else if("containerScroll"===eventType)if($responsiveContainer.length){if(!responsive)return;scrollContainerLeft=$responsiveContainer.scrollLeft()}else scrollingContainerTop=$scrollContainer.scrollTop(),scrollContainerLeft=$scrollContainer.scrollLeft();else"init"!==eventType&&(windowTop=$window.scrollTop(),windowLeft=$window.scrollLeft(),scrollingContainerTop=$scrollContainer.scrollTop(),scrollContainerLeft=getScrollContainerLeft());if(!isWebkit||!(windowTop<0||isRTL&&0<windowLeft||!isRTL&&windowLeft<0)){if(absoluteToFixedOnScroll)changePositioning("windowScrollDone"===eventType);else if("windowScrollDone"===eventType)return null;var top,left;tableOffset=$table.offset(),haveCaption&&captionAlignTop&&(tableOffset.top+=captionHeight);var tableHeight=$table.outerHeight();if(locked&&useAbsolutePositioning){if(scrollingContainerTop<=tableContainerGap){var gap=tableContainerGap-scrollingContainerTop+tableTopGap;top=0<gap?gap:0,triggerFloatEvent(!1)}else tableHeight-floatContainerHeight<scrollingContainerTop-tableContainerGap?top=tableHeight-floatContainerHeight-scrollingContainerTop-tableContainerGap:(top=wrappedContainer?tableTopGap:scrollingContainerTop,triggerFloatEvent(!0));left=tableLeftGap}else!locked&&useAbsolutePositioning?(floatEnd+tableHeight+captionScrollOffset<windowTop?top=tableHeight-floatContainerHeight+captionScrollOffset+scrollingBottom:tableOffset.top>=windowTop+scrollingTop?(top=0,unfloat(),triggerFloatEvent(!1)):(top=scrollingTop+windowTop-tableOffset.top+tableContainerGap+(captionAlignTop?captionHeight:0),refloat(),triggerFloatEvent(!0)),left=scrollContainerLeft):locked&&!useAbsolutePositioning?(scrollingContainerTop<tableContainerGap||tableHeight<scrollingContainerTop-tableContainerGap?(top=tableOffset.top-windowTop,unfloat(),triggerFloatEvent(!1)):(top=tableOffset.top+scrollingContainerTop-windowTop-tableContainerGap,refloat(),triggerFloatEvent(!0)),left=tableOffset.left+scrollContainerLeft-windowLeft):locked||useAbsolutePositioning||(floatEnd+tableHeight+captionScrollOffset<windowTop?top=tableHeight+scrollingTop-windowTop+floatEnd+captionScrollOffset:tableOffset.top>windowTop+scrollingTop?(top=tableOffset.top-windowTop,refloat(),triggerFloatEvent(!1)):(top=scrollingTop,triggerFloatEvent(!0)),left=tableOffset.left+scrollContainerLeft-windowLeft);return{top:Math.round(top),left:Math.round(left)}}}}function repositionFloatContainerFn(){var oldTop=null,oldLeft=null,oldScrollLeft=null;return function(pos,setWidth,setHeight){if(null!=pos&&(oldTop!==pos.top||oldLeft!==pos.left)){if(8===ieVersion)$floatContainer.css({top:pos.top,left:pos.left});else{var transform="translateX("+pos.left+"px) translateY("+pos.top+"px)",cssObj={"-webkit-transform":transform,"-moz-transform":transform,"-ms-transform":transform,"-o-transform":transform,transform:transform,top:0,left:0};$floatContainer.css(cssObj)}oldTop=pos.top,oldLeft=pos.left}setWidth&&function(){var tw=tableWidth($table,$fthCells,!0),$container=responsive?$responsiveContainer:$scrollContainer,width=$container.length?getOffsetWidth($container[0]):tw,floatContainerWidth="hidden"!==$container.css("overflow-y")?width-scrollbarOffset.vertical:width;if($floatContainer.width(floatContainerWidth),locked){var percent=100*tw/floatContainerWidth;$floatTable.css("width",percent+"%")}else $floatTable.css("width",tw+"px")}(),setHeight&&setHeaderHeight();var scrollLeft=(responsive?$responsiveContainer:$scrollContainer).scrollLeft();useAbsolutePositioning&&oldScrollLeft===scrollLeft||($floatContainer.scrollLeft(scrollLeft),oldScrollLeft=scrollLeft)}}function calculateScrollBarSize(){if($scrollContainer.length)if(opts.support&&opts.support.perfectScrollbar&&$scrollContainer.data().perfectScrollbar)scrollbarOffset={horizontal:0,vertical:0};else{if("scroll"===$scrollContainer.css("overflow-x"))scrollbarOffset.horizontal=scrollbarWidth;else{var sw=$scrollContainer.width(),tw=tableWidth($table,$fthCells),offsetv=sh<th?scrollbarWidth:0;scrollbarOffset.horizontal=sw-offsetv<tw?scrollbarWidth:0}if("scroll"===$scrollContainer.css("overflow-y"))scrollbarOffset.vertical=scrollbarWidth;else{var sh=$scrollContainer.height(),th=$table.height(),offseth=sw<tw?scrollbarWidth:0;scrollbarOffset.vertical=sh-offseth<th?scrollbarWidth:0}}}calculateScrollBarSize();var ensureReflow=function(){reflow()()};ensureReflow();var calculateFloatContainerPos=calculateFloatContainerPosFn(),repositionFloatContainer=repositionFloatContainerFn();repositionFloatContainer(calculateFloatContainerPos("init"),!0);var windowScrollDoneEvent=util.debounce(function(){repositionFloatContainer(calculateFloatContainerPos("windowScrollDone"),!1)},1),windowScrollEvent=function(){repositionFloatContainer(calculateFloatContainerPos("windowScroll"),!1),absoluteToFixedOnScroll&&windowScrollDoneEvent()},containerScrollEvent=function(){repositionFloatContainer(calculateFloatContainerPos("containerScroll"),!1)},reflowEvent=util.debounce(function(){$table.is(":hidden")||(calculateScrollBarSize(),updateScrollingOffsets(),ensureReflow(),calculateFloatContainerPos=calculateFloatContainerPosFn(),repositionFloatContainer(calculateFloatContainerPos("reflow"),!0,!0))},1),beforePrint=function(){unfloat()},afterPrint=function(){refloat()},printEvent=function(mql){mql.matches?beforePrint():afterPrint()},matchMediaPrint=null;if(window.matchMedia&&window.matchMedia("print").addListener&&!buggyMatchMedia?(matchMediaPrint=window.matchMedia("print")).addListener(printEvent):($window.on("fth-beforeprint",beforePrint),$window.on("fth-afterprint",afterPrint)),locked?useAbsolutePositioning?$scrollContainer.on(eventName("scroll"),containerScrollEvent):($scrollContainer.on(eventName("scroll"),containerScrollEvent),$window.on(eventName("scroll"),windowScrollEvent)):($responsiveContainer.on(eventName("scroll"),containerScrollEvent),$window.on(eventName("scroll"),windowScrollEvent)),$window.on(eventName("load"),reflowEvent),function(eventName,cb){if(8===ieVersion){var winWidth=$window.width(),debouncedCb=util.debounce(function(){var winWidthNew=$window.width();winWidth!==winWidthNew&&(winWidth=winWidthNew,cb())},1);$window.on(eventName,debouncedCb)}else $window.on(eventName,util.debounce(cb,1))}(eventName("resize"),function(){$table.is(":hidden")||(updateScrollingOffsets(),calculateScrollBarSize(),ensureReflow(),calculateFloatContainerPos=calculateFloatContainerPosFn(),(repositionFloatContainer=repositionFloatContainerFn())(calculateFloatContainerPos("resize"),!0,!0))}),$table.on("reflow",reflowEvent),opts.support&&opts.support.datatables&&function($table){if($table.dataTableSettings)for(var i=0;i<$table.dataTableSettings.length;i++){var table=$table.dataTableSettings[i].nTable;if($table[0]===table)return!0}return!1}($table)&&$table.on("filter",reflowEvent).on("sort",reflowEvent).on("page",reflowEvent),opts.support&&opts.support.bootstrap&&$window.on(eventName("shown.bs.tab"),reflowEvent),opts.support&&opts.support.jqueryUI&&$window.on(eventName("tabsactivate"),reflowEvent),canObserveMutations){var mutationElement=null;util.isFunction(opts.autoReflow)&&(mutationElement=opts.autoReflow($table,$scrollContainer)),mutationElement||(mutationElement=$scrollContainer.length?$scrollContainer[0]:$table[0]),(mObs=new MutationObserver(function(e){for(var wasTableRelated=function(nodes){return nodes&&nodes[0]&&("THEAD"===nodes[0].nodeName||"TD"===nodes[0].nodeName||"TH"===nodes[0].nodeName)},i=0;i<e.length;i++)if(!wasTableRelated(e[i].addedNodes)&&!wasTableRelated(e[i].removedNodes)){reflowEvent();break}})).observe(mutationElement,{childList:!0,subtree:!0})}$table.data("floatThead-attached",{destroy:function(){var ns=".fth-"+floatTheadId;return unfloat(),$table.css(layoutAuto),$tableColGroup.remove(),createElements&&$fthGrp.remove(),$newHeader.parent().length&&$newHeader.replaceWith($header),triggerFloatEvent(!1),canObserveMutations&&(mObs.disconnect(),mObs=null),$table.off("reflow reflowed"),$scrollContainer.off(ns),$responsiveContainer.off(ns),wrappedContainer&&($scrollContainer.length?$scrollContainer.unwrap():$table.unwrap()),locked?$scrollContainer.data("floatThead-containerWrap",!1):$table.data("floatThead-containerWrap",!1),$table.css("minWidth",originalTableMinWidth),$floatContainer.remove(),$table.data("floatThead-attached",!1),$window.off(ns),$window.off("fth-beforeprint fth-afterprint"),matchMediaPrint&&matchMediaPrint.removeListener(printEvent),beforePrint=afterPrint=function(){},function(){return $table.floatThead(opts)}},reflow:function(){reflowEvent()},setHeaderHeight:function(){setHeaderHeight()},getFloatContainer:function(){return $floatContainer},getRowGroups:function(){return headerFloated?$floatContainer.find(">table>thead").add($table.children("tbody,tfoot")):$table.children("thead,tbody,tfoot")}})}),this}}(function(){var $=jQuery;return"undefined"!=typeof module&&module.exports&&!$&&($=require("jquery")),$}()),function(){"use strict";angular.module("floatThead",[]).directive("floatThead",["$timeout","$log",function($timeout,$log){return{require:"?ngModel",scope:{floatThead:"=?",floatTheadEnabled:"=?"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$attrs.hasOwnProperty("floatTheadEnabled")||($scope.floatTheadEnabled=$attrs.floatTheadEnabled=!0),$attrs.hasOwnProperty("floatThead")&&""!==$attrs.floatThead||($scope.floatThead=$attrs.floatThead={})}],link:function($scope,$element,$attrs,ngModel){$scope.$watch("floatTheadEnabled",function(newVal){!0===newVal?angular.isObject($scope.floatThead)&&jQuery($element).floatThead($scope.floatThead):jQuery($element).floatThead("destroy")}),$scope.$watch("floatThead",function(newVal,oldVal){newVal!==oldVal&&$scope.floatTheadEnabled&&(jQuery($element).floatThead("destroy"),angular.isObject(newVal)&&jQuery($element).floatThead(newVal))},!0),ngModel?ngModel.$formatters.push(function(){$scope.floatTheadEnabled&&angular.isObject($scope.floatThead)&&$timeout(function(){jQuery($element).floatThead("reflow")})}):$log.info("floatThead: ngModel not provided!");$element.bind("update",function(){$timeout(function(){jQuery($element).floatThead("reflow")},0)}),$element.bind("$destroy",function(){jQuery($element).floatThead("destroy")})},restrict:"A"}}])}(),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?factory(require("jquery")):factory(jQuery)}(function($,undefined){function UTCDate(){return new Date(Date.UTC.apply(Date,arguments))}function UTCToday(){var today=new Date;return UTCDate(today.getFullYear(),today.getMonth(),today.getDate())}function alias(method){return function(){return this[method].apply(this,arguments)}}var extras,DateArray=(extras={get:function(i){return this.slice(i)[0]},contains:function(d){for(var val=d&&d.valueOf(),i=0,l=this.length;i<l;i++)if(this[i].valueOf()===val)return i;return-1},remove:function(i){this.splice(i,1)},replace:function(new_array){new_array&&($.isArray(new_array)||(new_array=[new_array]),this.clear(),this.push.apply(this,new_array))},clear:function(){this.length=0},copy:function(){var a=new DateArray;return a.replace(this),a}},function(){var a=[];return a.push.apply(a,arguments),$.extend(a,extras),a}),Datepicker=function(element,options){$(element).data("datepicker",this),this._process_options(options),this.dates=new DateArray,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=$(element),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .btn"),this.hasInput=this.component&&this.inputField.length,this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=$(DPGlobal.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(i,val){return parseInt(val)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted),this.setDatesDisabled(this.o.datesDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};Datepicker.prototype={constructor:Datepicker,_resolveViewName:function(view,default_value){return 0===view||"days"===view||"month"===view?0:1===view||"months"===view||"year"===view?1:2===view||"years"===view||"decade"===view?2:3===view||"decades"===view||"century"===view?3:4===view||"centuries"===view||"millennium"===view?4:default_value!==undefined&&default_value},_check_template:function(tmp){try{return tmp!==undefined&&""!==tmp&&((tmp.match(/[<>]/g)||[]).length<=0||0<$(tmp).length)}catch(ex){return!1}},_process_options:function(opts){this._o=$.extend({},this._o,opts);var o=this.o=$.extend({},this._o),lang=o.language;dates[lang]||(lang=lang.split("-")[0],dates[lang]||(lang=defaults.language)),o.language=lang,o.startView=this._resolveViewName(o.startView,0),o.minViewMode=this._resolveViewName(o.minViewMode,0),o.maxViewMode=this._resolveViewName(o.maxViewMode,4),o.startView=Math.min(o.startView,o.maxViewMode),o.startView=Math.max(o.startView,o.minViewMode),!0!==o.multidate&&(o.multidate=Number(o.multidate)||!1,!1!==o.multidate&&(o.multidate=Math.max(0,o.multidate))),o.multidateSeparator=String(o.multidateSeparator),o.weekStart%=7,o.weekEnd=(o.weekStart+6)%7;var format=DPGlobal.parseFormat(o.format);o.startDate!==-1/0&&(o.startDate?o.startDate instanceof Date?o.startDate=this._local_to_utc(this._zero_time(o.startDate)):o.startDate=DPGlobal.parseDate(o.startDate,format,o.language,o.assumeNearbyYear):o.startDate=-1/0),o.endDate!==1/0&&(o.endDate?o.endDate instanceof Date?o.endDate=this._local_to_utc(this._zero_time(o.endDate)):o.endDate=DPGlobal.parseDate(o.endDate,format,o.language,o.assumeNearbyYear):o.endDate=1/0),o.daysOfWeekDisabled=o.daysOfWeekDisabled||[],$.isArray(o.daysOfWeekDisabled)||(o.daysOfWeekDisabled=o.daysOfWeekDisabled.split(/[,\s]*/)),o.daysOfWeekDisabled=$.map(o.daysOfWeekDisabled,function(d){return parseInt(d,10)}),o.daysOfWeekHighlighted=o.daysOfWeekHighlighted||[],$.isArray(o.daysOfWeekHighlighted)||(o.daysOfWeekHighlighted=o.daysOfWeekHighlighted.split(/[,\s]*/)),o.daysOfWeekHighlighted=$.map(o.daysOfWeekHighlighted,function(d){return parseInt(d,10)}),o.datesDisabled=o.datesDisabled||[],$.isArray(o.datesDisabled)||(o.datesDisabled=[o.datesDisabled]),o.datesDisabled=$.map(o.datesDisabled,function(d){return DPGlobal.parseDate(d,format,o.language,o.assumeNearbyYear)});var plc=String(o.orientation).toLowerCase().split(/\s+/g),_plc=o.orientation.toLowerCase();if(plc=$.grep(plc,function(word){return/^auto|left|right|top|bottom$/.test(word)}),o.orientation={x:"auto",y:"auto"},_plc&&"auto"!==_plc)if(1===plc.length)switch(plc[0]){case"top":case"bottom":o.orientation.y=plc[0];break;case"left":case"right":o.orientation.x=plc[0]}else _plc=$.grep(plc,function(word){return/^left|right$/.test(word)}),o.orientation.x=_plc[0]||"auto",_plc=$.grep(plc,function(word){return/^top|bottom$/.test(word)}),o.orientation.y=_plc[0]||"auto";else;if(o.defaultViewDate){var year=o.defaultViewDate.year||(new Date).getFullYear(),month=o.defaultViewDate.month||0,day=o.defaultViewDate.day||1;o.defaultViewDate=UTCDate(year,month,day)}else o.defaultViewDate=UTCToday()},_events:[],_secondaryEvents:[],_applyEvents:function(evs){for(var el,ch,ev,i=0;i<evs.length;i++)el=evs[i][0],2===evs[i].length?(ch=undefined,ev=evs[i][1]):3===evs[i].length&&(ch=evs[i][1],ev=evs[i][2]),el.on(ev,ch)},_unapplyEvents:function(evs){for(var el,ev,ch,i=0;i<evs.length;i++)el=evs[i][0],2===evs[i].length?(ch=undefined,ev=evs[i][1]):3===evs[i].length&&(ch=evs[i][1],ev=evs[i][2]),el.off(ev,ch)},_buildEvents:function(){var events={keyup:$.proxy(function(e){-1===$.inArray(e.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:$.proxy(this.keydown,this),paste:$.proxy(this.paste,this)};!0===this.o.showOnFocus&&(events.focus=$.proxy(this.show,this)),this.isInput?this._events=[[this.element,events]]:this.component&&this.hasInput?this._events=[[this.inputField,events],[this.component,{click:$.proxy(this.show,this)}]]:this._events=[[this.element,{click:$.proxy(this.show,this),keydown:$.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:$.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:$.proxy(function(e){this._focused_from=e.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":$.proxy(function(e){this.update(e.date)},this)}]),this._secondaryEvents=[[this.picker,{click:$.proxy(this.click,this)}],[$(window),{resize:$.proxy(this.place,this)}],[$(document),{mousedown:$.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(event,altdate){var date=altdate||this.dates.get(-1),local_date=this._utc_to_local(date);this.element.trigger({type:event,date:local_date,dates:$.map(this.dates,this._utc_to_local),format:$.proxy(function(ix,format){0===arguments.length?(ix=this.dates.length-1,format=this.o.format):"string"==typeof ix&&(format=ix,ix=this.dates.length-1),format=format||this.o.format;var date=this.dates.get(ix);return DPGlobal.formatDate(date,format,this.o.language)},this)})},show:function(){if(!(this.inputField.prop("disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&$(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")||(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide")),this},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(evt){var dateString;if(evt.originalEvent.clipboardData&&evt.originalEvent.clipboardData.types&&-1!==$.inArray("text/plain",evt.originalEvent.clipboardData.types))dateString=evt.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;dateString=window.clipboardData.getData("Text")}this.setDate(dateString),this.update(),evt.preventDefault()},_utc_to_local:function(utc){return utc&&new Date(utc.getTime()+6e4*utc.getTimezoneOffset())},_local_to_utc:function(local){return local&&new Date(local.getTime()-6e4*local.getTimezoneOffset())},_zero_time:function(local){return local&&new Date(local.getFullYear(),local.getMonth(),local.getDate())},_zero_utc_time:function(utc){return utc&&new Date(Date.UTC(utc.getUTCFullYear(),utc.getUTCMonth(),utc.getUTCDate()))},getDates:function(){return $.map(this.dates,this._utc_to_local)},getUTCDates:function(){return $.map(this.dates,function(d){return new Date(d)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var selected_date=this.dates.get(-1);return void 0!==selected_date?new Date(selected_date):null},clearDates:function(){this.inputField&&this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(){var args=$.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,args),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var args=$.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,$.map(args,this._utc_to_local)),this._trigger("changeDate"),this.setValue(),this},setDate:alias("setDates"),setUTCDate:alias("setUTCDates"),remove:alias("destroy"),setValue:function(){var formatted=this.getFormattedDate();return this.inputField.val(formatted),this},getFormattedDate:function(format){format===undefined&&(format=this.o.format);var lang=this.o.language;return $.map(this.dates,function(d){return DPGlobal.formatDate(d,format,lang)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(startDate){return this._process_options({startDate:startDate}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(endDate){return this._process_options({endDate:endDate}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(daysOfWeekDisabled){return this._process_options({daysOfWeekDisabled:daysOfWeekDisabled}),this.update(),this.updateNavArrows(),this},setDaysOfWeekHighlighted:function(daysOfWeekHighlighted){return this._process_options({daysOfWeekHighlighted:daysOfWeekHighlighted}),this.update(),this},setDatesDisabled:function(datesDisabled){this._process_options({datesDisabled:datesDisabled}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return this;var calendarWidth=this.picker.outerWidth(),calendarHeight=this.picker.outerHeight(),container=$(this.o.container),windowWidth=container.width(),scrollTop="body"===this.o.container?$(document).scrollTop():container.scrollTop(),appendOffset=container.offset(),parentsZindex=[];this.element.parents().each(function(){var itemZIndex=$(this).css("z-index");"auto"!==itemZIndex&&0!==itemZIndex&&parentsZindex.push(parseInt(itemZIndex))});var zIndex=Math.max.apply(Math,parentsZindex)+this.o.zIndexOffset,offset=this.component?this.component.parent().offset():this.element.offset(),height=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),width=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),left=offset.left-appendOffset.left,top=offset.top-appendOffset.top;"body"!==this.o.container&&(top+=scrollTop),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(left-=calendarWidth-width)):offset.left<0?(this.picker.addClass("datepicker-orient-left"),left-=offset.left-10):windowWidth<left+calendarWidth?(this.picker.addClass("datepicker-orient-right"),left+=width-calendarWidth):this.picker.addClass("datepicker-orient-left");var yorient=this.o.orientation.y;if("auto"===yorient&&(yorient=-scrollTop+top-calendarHeight<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+yorient),"top"===yorient?top-=calendarHeight+parseInt(this.picker.css("padding-top")):top+=height,this.o.rtl){var right=windowWidth-(left+width);this.picker.css({top:top,right:right,zIndex:zIndex})}else this.picker.css({top:top,left:left,zIndex:zIndex});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var oldDates=this.dates.copy(),dates=[],fromArgs=!1;return arguments.length?($.each(arguments,$.proxy(function(i,date){date instanceof Date&&(date=this._local_to_utc(date)),dates.push(date)},this)),fromArgs=!0):(dates=(dates=this.isInput?this.element.val():this.element.data("date")||this.inputField.val())&&this.o.multidate?dates.split(this.o.multidateSeparator):[dates],delete this.element.data().date),dates=$.map(dates,$.proxy(function(date){return DPGlobal.parseDate(date,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),dates=$.grep(dates,$.proxy(function(date){return!this.dateWithinRange(date)||!date},this),!0),this.dates.replace(dates),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate,fromArgs?this.setValue():dates.length&&String(oldDates)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&oldDates.length&&this._trigger("clearDate"),this.fill(),this.element.change(),this},fillDow:function(){var dowCnt=this.o.weekStart,html="<tr>";for(this.o.calendarWeeks&&(this.picker.find(".datepicker-days .datepicker-switch").attr("colspan",function(i,val){return parseInt(val)+1}),html+='<th class="cw">&#160;</th>');dowCnt<this.o.weekStart+7;)html+='<th class="dow',-1<$.inArray(dowCnt,this.o.daysOfWeekDisabled)&&(html+=" disabled"),html+='">'+dates[this.o.language].daysMin[dowCnt++%7]+"</th>";html+="</tr>",this.picker.find(".datepicker-days thead").append(html)},fillMonths:function(){for(var localDate=this._utc_to_local(this.viewDate),html="",i=0;i<12;){html+='<span class="month'+(localDate&&localDate.getMonth()===i?" focused":"")+'">'+dates[this.o.language].monthsShort[i++]+"</span>"}this.picker.find(".datepicker-months td").html(html)},setRange:function(range){range&&range.length?this.range=$.map(range,function(d){return d.valueOf()}):delete this.range,this.fill()},getClassNames:function(date){var cls=[],year=this.viewDate.getUTCFullYear(),month=this.viewDate.getUTCMonth(),today=new Date;return date.getUTCFullYear()<year||date.getUTCFullYear()===year&&date.getUTCMonth()<month?cls.push("old"):(date.getUTCFullYear()>year||date.getUTCFullYear()===year&&date.getUTCMonth()>month)&&cls.push("new"),this.focusDate&&date.valueOf()===this.focusDate.valueOf()&&cls.push("focused"),this.o.todayHighlight&&date.getUTCFullYear()===today.getFullYear()&&date.getUTCMonth()===today.getMonth()&&date.getUTCDate()===today.getDate()&&cls.push("today"),-1!==this.dates.contains(date)&&cls.push("active"),this.dateWithinRange(date)||cls.push("disabled"),this.dateIsDisabled(date)&&cls.push("disabled","disabled-date"),-1!==$.inArray(date.getUTCDay(),this.o.daysOfWeekHighlighted)&&cls.push("highlighted"),this.range&&(date>this.range[0]&&date<this.range[this.range.length-1]&&cls.push("range"),-1!==$.inArray(date.valueOf(),this.range)&&cls.push("selected"),date.valueOf()===this.range[0]&&cls.push("range-start"),date.valueOf()===this.range[this.range.length-1]&&cls.push("range-end")),cls},_fill_yearsView:function(selector,cssClass,factor,step,currentYear,startYear,endYear,callback){var html,view,year,steps,startStep,endStep,thisYear,i,classes,tooltip,before;for(html="",view=this.picker.find(selector),year=parseInt(currentYear/factor,10)*factor,startStep=parseInt(startYear/step,10)*step,endStep=parseInt(endYear/step,10)*step,steps=$.map(this.dates,function(d){return parseInt(d.getUTCFullYear()/step,10)*step}),view.find(".datepicker-switch").text(year+"-"+(year+9*step)),thisYear=year-step,i=-1;i<11;i+=1)classes=[cssClass],tooltip=null,-1===i?classes.push("old"):10===i&&classes.push("new"),-1!==$.inArray(thisYear,steps)&&classes.push("active"),(thisYear<startStep||endStep<thisYear)&&classes.push("disabled"),thisYear===this.viewDate.getFullYear()&&classes.push("focused"),callback!==$.noop&&((before=callback(new Date(thisYear,0,1)))===undefined?before={}:"boolean"==typeof before?before={enabled:before}:"string"==typeof before&&(before={classes:before}),!1===before.enabled&&classes.push("disabled"),before.classes&&(classes=classes.concat(before.classes.split(/\s+/))),before.tooltip&&(tooltip=before.tooltip)),html+='<span class="'+classes.join(" ")+'"'+(tooltip?' title="'+tooltip+'"':"")+">"+thisYear+"</span>",thisYear+=step;view.find("td").html(html)},fill:function(){var tooltip,before,d=new Date(this.viewDate),year=d.getUTCFullYear(),month=d.getUTCMonth(),startYear=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,startMonth=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,endYear=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,endMonth=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,todaytxt=dates[this.o.language].today||dates.en.today||"",cleartxt=dates[this.o.language].clear||dates.en.clear||"",titleFormat=dates[this.o.language].titleFormat||dates.en.titleFormat;if(!isNaN(year)&&!isNaN(month)){this.picker.find(".datepicker-days .datepicker-switch").text(DPGlobal.formatDate(d,titleFormat,this.o.language)),this.picker.find("tfoot .today").text(todaytxt).toggle(!1!==this.o.todayBtn),this.picker.find("tfoot .clear").text(cleartxt).toggle(!1!==this.o.clearBtn),this.picker.find("thead .datepicker-title").text(this.o.title).toggle(""!==this.o.title),this.updateNavArrows(),this.fillMonths();var prevMonth=UTCDate(year,month-1,28),day=DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(),prevMonth.getUTCMonth());prevMonth.setUTCDate(day),prevMonth.setUTCDate(day-(prevMonth.getUTCDay()-this.o.weekStart+7)%7);var nextMonth=new Date(prevMonth);prevMonth.getUTCFullYear()<100&&nextMonth.setUTCFullYear(prevMonth.getUTCFullYear()),nextMonth.setUTCDate(nextMonth.getUTCDate()+42),nextMonth=nextMonth.valueOf();for(var clsName,html=[];prevMonth.valueOf()<nextMonth;){if(prevMonth.getUTCDay()===this.o.weekStart&&(html.push("<tr>"),this.o.calendarWeeks)){var ws=new Date(+prevMonth+(this.o.weekStart-prevMonth.getUTCDay()-7)%7*864e5),th=new Date(Number(ws)+(11-ws.getUTCDay())%7*864e5),yth=new Date(Number(yth=UTCDate(th.getUTCFullYear(),0,1))+(11-yth.getUTCDay())%7*864e5),calWeek=(th-yth)/864e5/7+1;html.push('<td class="cw">'+calWeek+"</td>")}(clsName=this.getClassNames(prevMonth)).push("day"),this.o.beforeShowDay!==$.noop&&((before=this.o.beforeShowDay(this._utc_to_local(prevMonth)))===undefined?before={}:"boolean"==typeof before?before={enabled:before}:"string"==typeof before&&(before={classes:before}),!1===before.enabled&&clsName.push("disabled"),before.classes&&(clsName=clsName.concat(before.classes.split(/\s+/))),before.tooltip&&(tooltip=before.tooltip)),clsName=$.isFunction($.uniqueSort)?$.uniqueSort(clsName):$.unique(clsName),html.push('<td class="'+clsName.join(" ")+'"'+(tooltip?' title="'+tooltip+'"':"")+">"+prevMonth.getUTCDate()+"</td>"),tooltip=null,prevMonth.getUTCDay()===this.o.weekEnd&&html.push("</tr>"),prevMonth.setUTCDate(prevMonth.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(html.join(""));var monthsTitle=dates[this.o.language].monthsTitle||dates.en.monthsTitle||"Months",months=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?monthsTitle:year).end().find("span").removeClass("active");if($.each(this.dates,function(i,d){d.getUTCFullYear()===year&&months.eq(d.getUTCMonth()).addClass("active")}),(year<startYear||endYear<year)&&months.addClass("disabled"),year===startYear&&months.slice(0,startMonth).addClass("disabled"),year===endYear&&months.slice(endMonth+1).addClass("disabled"),this.o.beforeShowMonth!==$.noop){var that=this;$.each(months,function(i,month){var moDate=new Date(year,i,1),before=that.o.beforeShowMonth(moDate);before===undefined?before={}:"boolean"==typeof before?before={enabled:before}:"string"==typeof before&&(before={classes:before}),!1!==before.enabled||$(month).hasClass("disabled")||$(month).addClass("disabled"),before.classes&&$(month).addClass(before.classes),before.tooltip&&$(month).prop("title",before.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,1,year,startYear,endYear,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,10,year,startYear,endYear,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,100,year,startYear,endYear,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var d=new Date(this.viewDate),year=d.getUTCFullYear(),month=d.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-1/0&&year<=this.o.startDate.getUTCFullYear()&&month<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&year>=this.o.endDate.getUTCFullYear()&&month>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:case 3:case 4:this.o.startDate!==-1/0&&year<=this.o.startDate.getUTCFullYear()||this.o.maxViewMode<2?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&year>=this.o.endDate.getUTCFullYear()||this.o.maxViewMode<2?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(e){var target,dir,day,year,month,monthChanged,yearChanged;e.preventDefault(),e.stopPropagation(),(target=$(e.target)).hasClass("datepicker-switch")&&this.showMode(1);var navArrow=target.closest(".prev, .next");0<navArrow.length&&(dir=DPGlobal.modes[this.viewMode].navStep*(navArrow.hasClass("prev")?-1:1),0===this.viewMode?(this.viewDate=this.moveMonth(this.viewDate,dir),this._trigger("changeMonth",this.viewDate)):(this.viewDate=this.moveYear(this.viewDate,dir),1===this.viewMode&&this._trigger("changeYear",this.viewDate)),this.fill()),target.hasClass("today")&&!target.hasClass("day")&&(this.showMode(-2),this._setDate(UTCToday(),"linked"===this.o.todayBtn?null:"view")),target.hasClass("clear")&&this.clearDates(),target.hasClass("disabled")||(target.hasClass("day")&&(day=parseInt(target.text(),10)||1,year=this.viewDate.getUTCFullYear(),month=this.viewDate.getUTCMonth(),target.hasClass("old")&&(0===month?(month=11,year-=1,yearChanged=monthChanged=!0):(month-=1,monthChanged=!0)),target.hasClass("new")&&(11===month?(year+=1,yearChanged=monthChanged=!(month=0)):(month+=1,monthChanged=!0)),this._setDate(UTCDate(year,month,day)),yearChanged&&this._trigger("changeYear",this.viewDate),monthChanged&&this._trigger("changeMonth",this.viewDate)),target.hasClass("month")&&(this.viewDate.setUTCDate(1),day=1,month=target.parent().find("span").index(target),year=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(month),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode?(this._setDate(UTCDate(year,month,day)),this.showMode()):this.showMode(-1),this.fill()),(target.hasClass("year")||target.hasClass("decade")||target.hasClass("century"))&&(this.viewDate.setUTCDate(1),day=1,month=0,year=parseInt(target.text(),10)||0,this.viewDate.setUTCFullYear(year),target.hasClass("year")&&(this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(UTCDate(year,month,day))),target.hasClass("decade")&&(this._trigger("changeDecade",this.viewDate),3===this.o.minViewMode&&this._setDate(UTCDate(year,month,day))),target.hasClass("century")&&(this._trigger("changeCentury",this.viewDate),4===this.o.minViewMode&&this._setDate(UTCDate(year,month,day))),this.showMode(-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&$(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(date){var ix=this.dates.contains(date);if(date||this.dates.clear(),-1!==ix?(!0===this.o.multidate||1<this.o.multidate||this.o.toggleActive)&&this.dates.remove(ix):(!1===this.o.multidate&&this.dates.clear(),this.dates.push(date)),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(date,which){which&&"date"!==which||this._toggle_multidate(date&&new Date(date)),which&&"view"!==which||(this.viewDate=date&&new Date(date)),this.fill(),this.setValue(),which&&"view"===which||this._trigger("changeDate"),this.inputField&&this.inputField.change(),!this.o.autoclose||which&&"date"!==which||this.hide()},moveDay:function(date,dir){var newDate=new Date(date);return newDate.setUTCDate(date.getUTCDate()+dir),newDate},moveWeek:function(date,dir){return this.moveDay(date,7*dir)},moveMonth:function(date,dir){if(!(d=date)||isNaN(d.getTime()))return this.o.defaultViewDate;var d;if(!dir)return date;var new_month,test,new_date=new Date(date.valueOf()),day=new_date.getUTCDate(),month=new_date.getUTCMonth(),mag=Math.abs(dir);if(dir=0<dir?1:-1,1===mag)test=-1===dir?function(){return new_date.getUTCMonth()===month}:function(){return new_date.getUTCMonth()!==new_month},new_month=month+dir,new_date.setUTCMonth(new_month),(new_month<0||11<new_month)&&(new_month=(new_month+12)%12);else{for(var i=0;i<mag;i++)new_date=this.moveMonth(new_date,dir);new_month=new_date.getUTCMonth(),new_date.setUTCDate(day),test=function(){return new_month!==new_date.getUTCMonth()}}for(;test();)new_date.setUTCDate(--day),new_date.setUTCMonth(new_month);return new_date},moveYear:function(date,dir){return this.moveMonth(date,12*dir)},moveAvailableDate:function(date,dir,fn){do{if(date=this[fn](date,dir),!this.dateWithinRange(date))return!1;fn="moveDay"}while(this.dateIsDisabled(date));return date},weekOfDateIsDisabled:function(date){return-1!==$.inArray(date.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(date){return this.weekOfDateIsDisabled(date)||0<$.grep(this.o.datesDisabled,function(d){return date2=d,(date1=date).getUTCFullYear()===date2.getUTCFullYear()&&date1.getUTCMonth()===date2.getUTCMonth()&&date1.getUTCDate()===date2.getUTCDate();var date1,date2}).length},dateWithinRange:function(date){return date>=this.o.startDate&&date<=this.o.endDate},keydown:function(e){if(this.picker.is(":visible")){var dir,newViewDate,dateChanged=!1,focusDate=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault(),e.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;dir=37===e.keyCode||38===e.keyCode?-1:1,0===this.viewMode?e.ctrlKey?(newViewDate=this.moveAvailableDate(focusDate,dir,"moveYear"))&&this._trigger("changeYear",this.viewDate):e.shiftKey?(newViewDate=this.moveAvailableDate(focusDate,dir,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===e.keyCode||39===e.keyCode?newViewDate=this.moveAvailableDate(focusDate,dir,"moveDay"):this.weekOfDateIsDisabled(focusDate)||(newViewDate=this.moveAvailableDate(focusDate,dir,"moveWeek")):1===this.viewMode?(38!==e.keyCode&&40!==e.keyCode||(dir*=4),newViewDate=this.moveAvailableDate(focusDate,dir,"moveMonth")):2===this.viewMode&&(38!==e.keyCode&&40!==e.keyCode||(dir*=4),newViewDate=this.moveAvailableDate(focusDate,dir,"moveYear")),newViewDate&&(this.focusDate=this.viewDate=newViewDate,this.setValue(),this.fill(),e.preventDefault());break;case 13:if(!this.o.forceParse)break;focusDate=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(focusDate),dateChanged=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),e.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}dateChanged&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField&&this.inputField.change())}else 40!==e.keyCode&&27!==e.keyCode||(this.show(),e.stopPropagation())},showMode:function(dir){dir&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,this.viewMode+dir))),this.picker.children("div").hide().filter(".datepicker-"+DPGlobal.modes[this.viewMode].clsName).show(),this.updateNavArrows()}};var DateRangePicker=function(element,options){$(element).data("datepicker",this),this.element=$(element),this.inputs=$.map(options.inputs,function(i){return i.jquery?i[0]:i}),delete options.inputs,datepickerPlugin.call($(this.inputs),options).on("changeDate",$.proxy(this.dateUpdated,this)),this.pickers=$.map(this.inputs,function(i){return $(i).data("datepicker")}),this.updateDates()};DateRangePicker.prototype={updateDates:function(){this.dates=$.map(this.pickers,function(i){return i.getUTCDate()}),this.updateRanges()},updateRanges:function(){var range=$.map(this.dates,function(d){return d.valueOf()});$.each(this.pickers,function(i,p){p.setRange(range)})},dateUpdated:function(e){if(!this.updating){this.updating=!0;var dp=$(e.target).data("datepicker");if(void 0!==dp){var new_date=dp.getUTCDate(),i=$.inArray(e.target,this.inputs),j=i-1,k=i+1,l=this.inputs.length;if(-1!==i){if($.each(this.pickers,function(i,p){p.getUTCDate()||p.setUTCDate(new_date)}),new_date<this.dates[j])for(;0<=j&&new_date<this.dates[j];)this.pickers[j--].setUTCDate(new_date);else if(new_date>this.dates[k])for(;k<l&&new_date>this.dates[k];)this.pickers[k++].setUTCDate(new_date);this.updateDates(),delete this.updating}}}},remove:function(){$.map(this.pickers,function(p){p.remove()}),delete this.element.data().datepicker}};var old=$.fn.datepicker,datepickerPlugin=function(option){var internal_return,args=Array.apply(null,arguments);if(args.shift(),this.each(function(){var $this=$(this),data=$this.data("datepicker"),options="object"==typeof option&&option;if(!data){var elopts=function(el,prefix){var data=$(el).data(),out={},replace=new RegExp("^"+prefix.toLowerCase()+"([A-Z])");function re_lower(_,a){return a.toLowerCase()}for(var key in prefix=new RegExp("^"+prefix.toLowerCase()),data)prefix.test(key)&&(out[key.replace(replace,re_lower)]=data[key]);return out}(this,"date"),locopts=function(lang){var out={};if(dates[lang]||(lang=lang.split("-")[0],dates[lang])){var d=dates[lang];return $.each(locale_opts,function(i,k){k in d&&(out[k]=d[k])}),out}}($.extend({},defaults,elopts,options).language),opts=$.extend({},defaults,locopts,elopts,options);data=$this.hasClass("input-daterange")||opts.inputs?($.extend(opts,{inputs:opts.inputs||$this.find("input").toArray()}),new DateRangePicker(this,opts)):new Datepicker(this,opts),$this.data("datepicker",data)}"string"==typeof option&&"function"==typeof data[option]&&(internal_return=data[option].apply(data,args))}),internal_return===undefined||internal_return instanceof Datepicker||internal_return instanceof DateRangePicker)return this;if(1<this.length)throw new Error("Using only allowed for the collection of a single element ("+option+" function)");return internal_return};$.fn.datepicker=datepickerPlugin;var defaults=$.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:$.noop,beforeShowMonth:$.noop,beforeShowYear:$.noop,beforeShowDecade:$.noop,beforeShowCentury:$.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&laquo;",rightArrow:"&raquo;"}},locale_opts=$.fn.datepicker.locale_opts=["format","rtl","weekStart"];$.fn.datepicker.Constructor=Datepicker;var dates=$.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},DPGlobal={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10},{clsName:"decades",navFnc:"FullDecade",navStep:100},{clsName:"centuries",navFnc:"FullCentury",navStep:1e3}],isLeapYear:function(year){return year%4==0&&year%100!=0||year%400==0},getDaysInMonth:function(year,month){return[31,DPGlobal.isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31][month]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(format){if("function"==typeof format.toValue&&"function"==typeof format.toDisplay)return format;var separators=format.replace(this.validParts,"\0").split("\0"),parts=format.match(this.validParts);if(!separators||!separators.length||!parts||0===parts.length)throw new Error("Invalid date format.");return{separators:separators,parts:parts}},parseDate:function(date,format,language,assumeNearby){if(!date)return undefined;if(date instanceof Date)return date;if("string"==typeof format&&(format=DPGlobal.parseFormat(format)),format.toValue)return format.toValue(date,format,language);var part,dir,i,fn,part_re=/([\-+]\d+)([dmwy])/,parts=date.match(/([\-+]\d+)([dmwy])/g),fn_map={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},dateAliases={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){for(date=new Date,i=0;i<parts.length;i++)part=part_re.exec(parts[i]),dir=parseInt(part[1]),fn=fn_map[part[2]],date=Datepicker.prototype[fn](date,dir);return UTCDate(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate())}if(void 0!==dateAliases[date]&&(parts=(date=dateAliases[date]).match(/([\-+]\d+)([dmwy])/g),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date))){for(date=new Date,i=0;i<parts.length;i++)part=part_re.exec(parts[i]),dir=parseInt(part[1]),fn=fn_map[part[2]],date=Datepicker.prototype[fn](date,dir);return UTCDate(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate())}function applyNearbyYear(year,threshold){return!0===threshold&&(threshold=10),year<100&&(year+=2e3)>(new Date).getFullYear()+threshold&&(year-=100),year}parts=date&&date.match(this.nonpunctuation)||[],date=new Date;var val,filtered,parsed={},setters_order=["yyyy","yy","M","MM","m","mm","d","dd"],setters_map={yyyy:function(d,v){return d.setUTCFullYear(assumeNearby?applyNearbyYear(v,assumeNearby):v)},yy:function(d,v){return d.setUTCFullYear(assumeNearby?applyNearbyYear(v,assumeNearby):v)},m:function(d,v){if(isNaN(d))return d;for(v-=1;v<0;)v+=12;for(v%=12,d.setUTCMonth(v);d.getUTCMonth()!==v;)d.setUTCDate(d.getUTCDate()-1);return d},d:function(d,v){return d.setUTCDate(v)}};setters_map.M=setters_map.MM=setters_map.mm=setters_map.m,setters_map.dd=setters_map.d,date=UTCToday();var fparts=format.parts.slice();function match_part(){var m=this.slice(0,parts[i].length),p=parts[i].slice(0,m.length);return m.toLowerCase()===p.toLowerCase()}if(parts.length!==fparts.length&&(fparts=$(fparts).filter(function(i,p){return-1!==$.inArray(p,setters_order)}).toArray()),parts.length===fparts.length){var cnt,_date,s;for(i=0,cnt=fparts.length;i<cnt;i++){if(val=parseInt(parts[i],10),part=fparts[i],isNaN(val))switch(part){case"MM":filtered=$(dates[language].months).filter(match_part),val=$.inArray(filtered[0],dates[language].months)+1;break;case"M":filtered=$(dates[language].monthsShort).filter(match_part),val=$.inArray(filtered[0],dates[language].monthsShort)+1}parsed[part]=val}for(i=0;i<setters_order.length;i++)(s=setters_order[i])in parsed&&!isNaN(parsed[s])&&(_date=new Date(date),setters_map[s](_date,parsed[s]),isNaN(_date)||(date=_date))}return date},formatDate:function(date,format,language){if(!date)return"";if("string"==typeof format&&(format=DPGlobal.parseFormat(format)),format.toDisplay)return format.toDisplay(date,format,language);var val={d:date.getUTCDate(),D:dates[language].daysShort[date.getUTCDay()],DD:dates[language].days[date.getUTCDay()],m:date.getUTCMonth()+1,M:dates[language].monthsShort[date.getUTCMonth()],MM:dates[language].months[date.getUTCMonth()],yy:date.getUTCFullYear().toString().substring(2),yyyy:date.getUTCFullYear()};val.dd=(val.d<10?"0":"")+val.d,val.mm=(val.m<10?"0":"")+val.m,date=[];for(var seps=$.extend([],format.separators),i=0,cnt=format.parts.length;i<=cnt;i++)seps.length&&date.push(seps.shift()),date.push(val[format.parts[i]]);return date.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};DPGlobal.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+DPGlobal.headTemplate+"<tbody></tbody>"+DPGlobal.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+"</table></div></div>",$.fn.datepicker.DPGlobal=DPGlobal,$.fn.datepicker.noConflict=function(){return $.fn.datepicker=old,this},$.fn.datepicker.version="1.6.4",$(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var $this=$(this);$this.data("datepicker")||(e.preventDefault(),datepickerPlugin.call($this,"show"))}),$(function(){datepickerPlugin.call($('[data-provide="datepicker-inline"]'))})}),angular.module("sviInvestor.accountData",[]).controller("AccountDataCtrl",["$scope","eventDispatcher","accountList",function($scope,eventDispatcher,accountList){$scope.accountData=null,$scope.multiAccountData=null,$scope.combinedAccountData=null,$scope.mode=null,$scope.currentAccount=null,$scope.currentAccountIndex=null,$scope.currentAccountList=null,$scope.currentAccountIndexList=null,$scope.currentGroup=null,$scope.accountList=accountList.getAccountObjects(),$scope.isGroupSelected=function(){return"group"===$scope.mode},$scope.isSingleAccountSelected=function(){return"single"===$scope.mode||"multi"===$scope.mode&&$scope.currentAccountList&&$scope.accountList&&1===$scope.currentAccountList.length},$scope.isAllAccountsSelected=function(){return"multi"===$scope.mode&&$scope.currentAccountList&&$scope.accountList&&1<$scope.accountList.length&&$scope.currentAccountList.length===$scope.accountList.length},$scope.getCurrentContext=function(){var currentContext=null;return $scope.isGroupSelected()?$scope.currentGroup.nickname&&(currentContext=$scope.currentGroup.nickname):$scope.isAllAccountsSelected()?currentContext="All":$scope.isSingleAccountSelected()&&(currentContext=$scope.currentAccount,$scope.accountData&&$scope.accountData.nickname&&(currentContext+=" - "+$scope.accountData.nickname)),currentContext},eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(e,data){data.hasOwnProperty("mode")&&($scope.mode=data.mode),data.hasOwnProperty("single")&&($scope.accountData=data.single),data.hasOwnProperty("multi")&&($scope.multiAccountData=data.multi),data.hasOwnProperty("combined")&&($scope.combinedAccountData=data.combined),data.hasOwnProperty("currentAccount")&&($scope.currentAccount=data.currentAccount),data.hasOwnProperty("currentAccountIndex")&&($scope.currentAccountIndex=data.currentAccountIndex),data.hasOwnProperty("currentAccountList")&&($scope.currentAccountList=data.currentAccountList),data.hasOwnProperty("currentAccountIndexList")&&($scope.currentAccountIndexList=data.currentAccountIndexList),data.hasOwnProperty("currentGroup")&&($scope.currentGroup=data.currentGroup)})}]),"object"!=typeof svi?svi={ng:{}}:svi.hasOwnProperty("ng")&&angular.isObject(svi.ng)||(svi.ng={}),svi.ng.sviInvestor=angular.module("sviInvestor",["templates-app","templates-common","templates-accountInfo","templates-assetAllocation","templates-balances","templates-cd","templates-core","templates-dashboard","templates-docShare","templates-gainLoss","templates-grid","templates-grouping","templates-hello","templates-history","templates-holdings","templates-household","templates-idc","templates-morningstar","templates-navigation","templates-orderStatus","templates-paLoans","templates-portfolio","templates-projectedIncome","templates-research","templates-symbol","templates-trading","templates-user","templates-clientDirectives","sviInvestor.accountData","sviInvestor.balances","sviInvestor.holdingZoom","sviInvestor.gainLoss","ui.multiselect","directives","svi.core","svi.hello","svi.navigation","svi.research","svi.symbol","filters","services","services.ui","services.tracking","ngSanitize","ngAria","mgcrea.ngStrap","ui.sortable","bootstrap-tagsinput","xeditable","floatThead"]).constant("APP_CONFIG",{autoLoadDelay:150,host:"",client:null,sviUserId:"",sessionId:"",pageId:php.uniqid(window.location.pathname),naValue:"-",naValueNullOnly:!1,enableHTML5Mode:!1,currentAccount:0,defaultGroup:null,currentGroup:null,currentAccountList:null,csrfToken:"",accountList:[],boIdList:[],chartColors:{assetTypes:{equity:"#26BFBB",option:"#BCE249",fund:"#CCF2EE",fixedIncome:"#7DDFDF",cash:"#85E494",other:"#55C752"},research:["#5E50B5","#E65722","#00A4A6","#6C7A89","#B8860B","#9370DB","#9F5E73","#217791","#B552A0","#5C97BF","#007A7C","#42497C","#F37321","#3F49D0","#A18276","#DE3F8C","#606C38","#D8315B","#0466C8","#C8553D"],graphicColors:[{color:"#E65722",text:"#000"},{color:"#333761",text:"#fff"},{color:"#B8860B",text:"#000"},{color:"#134453",text:"#fff"},{color:"#00A4A6",text:"#000"},{color:"#643A4A",text:"#fff"},{color:"#A385E0",text:"#000"},{color:"#2C35B5",text:"#fff"},{color:"#F37321",text:"#000"},{color:"#414A26",text:"#fff"},{color:"#AA8E83",text:"#000"},{color:"#891A36",text:"#fff"},{color:"#619BC2",text:"#000"},{color:"#034587",text:"#fff"},{color:"#E566A4",text:"#000"},{color:"#414753",text:"#fff"},{color:"#959B22",text:"#000"},{color:"#6F2F60",text:"#fff"},{color:"#5497E3",text:"#000"},{color:"#5C420A",text:"#fff"},{color:"#D16CDA",text:"#000"},{color:"#004042",text:"#fff"}],redGreenColors:["#F38C8C","#6D9D43"],consensusColors:["#00A4A6","#5E50B5","#6C7A89","#B8860B","#E65722"],sectorColors:{largeGainColor:"#024B26",smallGainColor:"#689841",smallLossColor:"#E56B7B",largeLossColor:"#8D0622",noGainLossColor:"#СССССС"},ESGSummaryColors:[{esgScore:"#00A4A6"},{environmental:"#333761"},{social:"#E65722"},{governance:"#B8860B"},{peerAvg:"#A385E0"}],general:["#315C7A","#05090C","#7AA9C9","#555555","#71B4EB","#1868AA","#AEAEAE","#D2E7F2"],sparkline:["#616C7C","#66A878","#F05352"]},highchartsPieShadow:!1,persistStorageKeys:[],hoverQuote:"popover",log4javascriptInterval:0,widgetUnitSize:0,defaultWidgetSize:10,maxWidgetSize:100,navHeight:24,navHeightMobile:50,responsiveColsBreakpoints:{xs:3,sm:7,md:10,widget:{xs:3}},accountBoids:null,accountProductTypes:null,optionMaskSeparator:null,optionOrder:null,rtqEnabled:!1,djiaEnabled:!1,viewMode:!1,currentYear:null,defaultClasses:null,financialAdvisorClasses:null,tradesClasses:null,quickLinksClasses:null,nyseHolidays:null,nyseMarketHolidays:null,nyseShortDays:null}).config(["APP_CONFIG","$httpProvider","$datepickerProvider","$locationProvider","$provide","$injector",function(APP_CONFIG,$httpProvider,$datepickerProvider,$locationProvider,$provide,$injector){var x;if("object"==typeof sviInvestorAppConfig&&!svi.sviInvestorReady)for(x in sviInvestorAppConfig)sviInvestorAppConfig.hasOwnProperty(x)&&(APP_CONFIG[x]=sviInvestorAppConfig[x]);APP_CONFIG.currentYear||(APP_CONFIG.currentYear=(new Date).getUTCFullYear()),APP_CONFIG.enableHTML5Mode&&$locationProvider.html5Mode({enabled:!0,requireBase:!1,rewriteLinks:!1}),$httpProvider.defaults.headers.common.Accept="application/json",$httpProvider.defaults.withCredentials=!0,$httpProvider.defaults.cache=!0,$httpProvider.interceptors.push(["$cacheFactory","$q","eventDispatcher",function($cacheFactory,$q,eventDispatcher){return{request:function(config){return config.headers["X-CSRFToken"]=APP_CONFIG.csrfToken,APP_CONFIG.sessionId&&(config.headers["X-SVISessionId"]=APP_CONFIG.sessionId),config.headers["X-Page-Id"]=php.uniqid(APP_CONFIG.pageId),config.headers["X-Request-Id"]=php.uniqid(APP_CONFIG.sviUserId),"JSONP"==config.method&&(-1!=config.url.indexOf("?")?config.url+="&callback=JSON_CALLBACK":config.url+="?callback=JSON_CALLBACK"),1<config.url.length&&"/"==config.url[0]&&"/"!=config.url[1]&&(config.url=APP_CONFIG.host+config.url),config.invalidateCache&&$cacheFactory.get("$http").remove(config.url),config},responseError:function(rejection){return 403==rejection.status&&rejection.hasOwnProperty("data")&&rejection.data&&rejection.data.hasOwnProperty("redirect")&&eventDispatcher.trigger("SESSION.EXPIRED",{redirect:rejection.data.redirect}),$q.reject(rejection)}}}]),angular.extend($datepickerProvider.defaults,{autoclose:!0}),$provide.decorator("$interpolate",["$delegate",function($delegate){var interpolateWrap=function(){if("object"!=typeof arguments[0]){var interpolationFn=$delegate.apply(this,arguments);return interpolationFn?interpolationFnWrap(interpolationFn,arguments):void 0}},interpolationFnWrap=function(interpolationFn,interpolationArgs){return function(){return interpolationFn.apply(this,arguments)}};return angular.extend(interpolateWrap,$delegate),interpolateWrap}]),APP_CONFIG.hasOwnProperty("log4javascriptUrl")&&APP_CONFIG.log4javascriptUrl&&$provide.decorator("$log",["$delegate",function($delegate){var $log,logger,_$log={log:($log=$delegate).log,debug:$log.debug,info:$log.info,warn:$log.warn,error:$log.error};if(log4javascript.logLog.setQuietMode(!0),svi.hasOwnProperty("log4jsLogger"))logger=svi.log4jsLogger;else{logger=log4javascript.getDefaultLogger(),window.hasOwnProperty("sviLog4Level")?logger.setLevel(window.sviLog4Level):logger.setLevel(log4javascript.Level.INFO);var ajaxAppender=new log4javascript.AjaxAppender(APP_CONFIG.log4javascriptUrl);ajaxAppender.addHeader("Accept","application/json"),ajaxAppender.addHeader("X-CSRFToken",APP_CONFIG.csrfToken),APP_CONFIG.sessionId&&ajaxAppender.addHeader("X-SVISessionId",APP_CONFIG.sessionId);var layout=new log4javascript.JsonLayout(!1,!1);layout.setCustomField("pageId",APP_CONFIG.pageId),ajaxAppender.setLayout(layout),0<APP_CONFIG.log4javascriptInterval&&(ajaxAppender.setBatchSize(100),setInterval(ajaxAppender.sendAllRemaining,APP_CONFIG.log4javascriptInterval)),logger.addAppender(ajaxAppender),svi.log4jsLogger=logger,svi.log4jsAjaxAppender=ajaxAppender,svi.log4jsLayout=layout}var objToString=function(){return angular.toJson(this)},sviDomain=new RegExp("scivantage.(com|net)","i"),prepareLogFn=function(logFn,log4Fn){var shouldLog=!0;try{var userAgent=navigator.userAgent.toLowerCase(),ieVersion=-1!=userAgent.indexOf("msie")&&parseInt(userAgent.split("msie")[1]);ieVersion&&ieVersion<=9&&(shouldLog=!1),svi.debug.enabled||null!==location.host.match(sviDomain)||(shouldLog=!1)}catch(e){shouldLog=!1}return function(){try{shouldLog&&logFn.apply(_$log,arguments);for(var i=0,l=arguments.length;i<l;i++)"object"!=typeof arguments[i]||arguments[i].hasOwnProperty("toString")||(arguments[i].toString=objToString);log4Fn.apply(logger,arguments)}catch(e){}}};return{log:prepareLogFn(_$log.log,logger.info),trace:prepareLogFn(_$log.debug,logger.trace),debug:prepareLogFn(_$log.debug,logger.debug),info:prepareLogFn(_$log.info,logger.info),warn:prepareLogFn(_$log.warn,logger.warn),error:prepareLogFn(_$log.error,logger.error),fatal:prepareLogFn(_$log.error,logger.fatal),time:logger.time,timeEnd:logger.timeEnd}}]),$provide.decorator("$templateRequest",["$delegate",function($delegate){return function(template,config){return!angular.isUndefined(config)&&angular.isObject(config)||(config={}),$delegate("/Web/util/template?config="+encodeURIComponent(JSON.stringify(config))+"&template="+encodeURIComponent(template)+"&version="+encodeURIComponent(svi.versionNumber))}}]),(angular.isObject(Highcharts)||angular.isFunction(Highcharts))&&angular.isFunction(Highcharts.setOptions)&&Highcharts.setOptions({global:{timezoneOffset:0,useUTC:!0},lang:{thousandsSep:",",rangeSelectorZoom:APP_CONFIG.rangeSelectorZoomText},plotOptions:{pie:{shadow:APP_CONFIG.highchartsPieShadow,dataLabels:{distance:-15,color:"white",style:{fontWeight:"normal",textShadow:"0px 0px 3px black, 0px 0px 1px black"}}}},credits:{enabled:!1}})}]).run(["APP_CONFIG","editableOptions","$log","$templateCache","$templateRequest","$window","sviUrl","config","eventDispatcher","accountList","session","labels","actionMenu","preferences","calendar",function(APP_CONFIG,editableOptions,$log,$templateCache,$templateRequest,$window,sviUrl,config,eventDispatcher,accountList,session,labels,actionMenu,preferences,calendar){var tcPut=$templateCache.put;$templateCache.put=function(path,data){return angular.isString(path)?tcPut(svi.ngTemplates._normalizePath(path),data):($log.error('$templateCache.put: path is expected to be string. path is: "'+path+'" data is: '+data),!1)};var tcGet=$templateCache.get;for(var x in $templateCache.get=function(path){var id=svi.ngTemplates._normalizePath(path,!0),idExt=svi.ngTemplates._normalizePath(path),tmpl=tcGet(id);if(tmpl||(tmpl=tcGet(APP_CONFIG.client+"/"+idExt)),tmpl||(tmpl=tcGet(idExt)),!tmpl){var parts=id.split("?");tmpl=tcGet(parts[0]+".fallback.html")}return tmpl||$log.debug("Angular template not in cache, loading from server: "+path+" normalized path: "+idExt),tmpl},svi.ns("svi.ngTemplates"),svi.ngTemplates)svi.ngTemplates.hasOwnProperty(x)&&"_"!=x[0]&&$templateCache.put(x,svi.ngTemplates[x]);if(svi.ngTemplates._templatesImported=!0,editableOptions.theme="bs3",$(".svi-bs").tooltip({selector:"[title]:not(.x-date-active):not(.x-date-disabled):not(.svi-bs-tooltip-disabled)",html:!0,container:".svi-bs",trigger:"hover"}).on("hidden.bs.tooltip",function(e){$(".svi-bs > .tooltip").remove()}),$("body").addClass($.browser.name).addClass($.browser.mobile?"svi-mobiletablet":"svi-desktop"),!svi.hasOwnProperty("sviInvestorReady")||!svi.sviInvestorReady){if(void 0!==$window.sviWidgetInit&&angular.isArray($window.sviWidgetInit))for(var i=0,l=$window.sviWidgetInit.length;i<l;i++)angular.isFunction($window.sviWidgetInit[i])&&$window.sviWidgetInit[i]();svi.sviInvestorReady=!0,eventDispatcher.trigger("SESSION.STARTED")}}]).controller("SviCtrl",["$scope","$attrs",function($scope,$attrs){}]),angular.module("directives",["ngSanitize"]),angular.module("svi.core",["ngSanitize"]),angular.module("svi.hello",["ngSanitize"]),angular.module("svi.navigation",["ngSanitize"]),angular.module("svi.research",["ngSanitize"]),angular.module("svi.symbol",["ngSanitize"]),angular.module("filters",["ngSanitize"]),angular.module("services",["ngCookies"]),angular.module("services.ui",[]),angular.module("services.tracking",[]),angular.module("sviInvestor.balances",[]).controller("BalancesCtrl",["$scope","$attrs","accountList","balances","eventDispatcher","labels",function($scope,$attrs,accountList,balances,eventDispatcher,labels){$scope.accounts=[accountList.getCurrentAccountIndex()],labels.setupLabels($scope,["general","balances"],{balanceSecuritiesTitle:"Securities",fedCall:"Fed Call",houseCall:"House Call"}),$scope.data=null,$scope.currentAccount=accountList.getCurrentAccountIndex(),$scope.init=function(initParams){$scope.marginEnabled=svi.ng.strToBoolean(initParams.marginEnabled,!1),$scope.optionTradeEnabled=svi.ng.strToBoolean(initParams.optionTradeEnabled,!1),$scope.optionLevel=initParams.optionLevel,$scope.accountType=initParams.accountType,$scope.isIRA=svi.ng.strToBoolean(initParams.isIRA,!1),$scope.isMargin="margin"===$scope.accountType,$scope.hasHeldAway=svi.ng.strToBoolean(initParams.hasHeldAwayAssets,!1)},$scope.loadCallback=function(){return null===$scope.data&&($scope.data=balances.getBalances($scope.accounts[0]),$scope.data.then(onSuccess,onError)),$scope.data};var onSuccess=function(data){var response=data.data||data;response.success&&($scope.loaded=!0,$scope.balance=response.balances.accountBalances[0])},onError=function(response){};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&($scope.loaded=!1,$scope.data=null,$scope.currentAccount=$scope.accounts[0])}),eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(e,data){data.hasOwnProperty("single")&&angular.isObject(data.single)&&(data.single.hasOwnProperty("index")&&($scope.currentAccount=data.single.index),data.single.hasOwnProperty("marginEnabled")&&($scope.marginEnabled=data.single.marginEnabled),data.single.hasOwnProperty("OPTION_TRADING")&&($scope.optionTradeEnabled=data.single.OPTION_TRADING),data.single.hasOwnProperty("isIRA")&&($scope.isIRA=data.single.isIRA),data.single.hasOwnProperty("accountType")&&($scope.accountType=data.single.accountType,$scope.isMargin="margin"===$scope.accountType),data.single.hasOwnProperty("optionLevel")&&($scope.optionLevel=data.single.optionLevel),data.single.hasOwnProperty("index")&&($scope.currentAccount=data.single.index),data.single.hasOwnProperty("hasHeldAwayAssets")&&($scope.hasHeldAway=data.single.hasHeldAwayAssets))})}]),angular.module("sviInvestor").controller("BreakpointCtrl",["$scope","$attrs","bsBreakpoint",function($scope,$attrs,bsBreakpoint){$scope.bsBreakpoint=bsBreakpoint}]),angular.module("sviInvestor.gainLoss",[]).controller("GainLossCtrl",["$scope","eventDispatcher",function($scope,eventDispatcher){$scope.isMultiAccountChosen=!1,$scope.isGroupedBy=!1,$scope.canShowTabs=!1,eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(evt,data){$scope.isMultiAccountChosen=data.group||1<data.currentAccount.length,$scope.canShowTabs=!0})}]),angular.module("sviInvestor.holdingZoom",[]).controller("HoldingZoomCtrl",["$scope","$attrs","accountList","holdings","eventDispatcher","labels","bsBreakpoint",function($scope,$attrs,accountList,holdings,eventDispatcher,labels,bsBreakpoint){$scope.accounts=[accountList.getCurrentAccountIndex()],$scope.data=null,$scope.loaded=!1,$scope.loadCallback=function(){if(null===$scope.data){$scope.data=holdings.getHoldings($scope.accounts[0],{sortField:"instrument.symbol",sortDir:"asc"}),$scope.data.then(onSuccess,onError)}return $scope.data};var onSuccess=function(data){for(var response=data;response.hasOwnProperty("data");)response=response.data;if(!$scope.loaded){$scope.loaded=!0;var positions=holdings.filterPositions(response.holdings.positions,{excludeUnknownInvestmentType:!0,excludeInvalidQuote:!0,excludeCash:!0,excludeCusip:!0,excludeOther:!0,excludeFixedIncome:!0});positions.length<1&&eventDispatcher.trigger("SYMBOL.CONTEXT.CHANGED",{symbol:"",underlying:"",investmentType:""});for(var i=0;i<positions.length;i++)if("default"!==positions[i].accountType.toLowerCase()&&!bsBreakpoint.isMobile()){eventDispatcher.trigger("SYMBOL.CONTEXT.CHANGED",{symbol:positions[i].instrument.symbol,underlying:"Option"===positions[i].instrument.investmentType?positions[i].underlying.symbol:"",investmentType:positions[i].instrument.investmentType});break}}},onError=function(response){};this.setAccounts=function(accounts){angular.isUndefined(accounts)||(angular.isArray(accounts)?$scope.accounts=accounts:$scope.accounts=[accounts])},eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&($scope.loaded=!1,$scope.data=null)})}]),angular.module("sviInvestor").controller("SymbolCtrl",["$scope","$attrs","eventDispatcher","state",function($scope,$attrs,eventDispatcher,state){svi.ng.defaultFalse($scope,$attrs,"ignoreState"),$scope.symbol="",$scope.ignoreState||($scope.symbol=state.get("symbol-context","")),$scope.symbolList=[],$scope.underlying="",$scope.investmentType="",$scope.symbolHash="";var normalize=function(input){return null===input||!1===input?"":input};eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){(data.hasOwnProperty("symbol")||data.hasOwnProperty("symbolList"))&&(data.hasOwnProperty("symbol")?$scope.symbol=normalize(data.symbol):$scope.symbol="",data.hasOwnProperty("symbolList")?$scope.symbolList=data.symbolList:$scope.symbolList=[],data.hasOwnProperty("underlying")?$scope.underlying=normalize(data.underlying):$scope.underlying="",data.hasOwnProperty("investmentType")?$scope.investmentType=normalize(data.investmentType):$scope.investmentType="",$scope.symbolHash=Sha1.hash($scope.symbol+$scope.symbolList.join("")),$scope.ignoreState||state.set("symbol-context",$scope.symbol))})}]),"undefined"==typeof svi&&(window.svi={}),svi.ns=function(namespace){for(var ns=namespace.split("."),current=window,i=0,l=ns.length;i<l;i++)angular.isUndefined(current[ns[i]])&&(current[ns[i]]={}),current=current[ns[i]];return current},svi.ns("svi.array"),svi.array.extractValues=function(array,valueParam){var x,values=[];for(x in array)array.hasOwnProperty(x)&&array[x].hasOwnProperty(valueParam)&&values.push(array[x][valueParam]);return values},svi.array.remove=function(array,value){var ret=$.grep(array,function(item,index){return item!==value});return angular.isArray(ret)?ret:[]},svi.array.sortFunctionFactory=function(sortField,invert){return angular.isUndefined(invert)&&(invert=!1),function(a,b){return a[sortField]==b[sortField]?0:a[sortField]>b[sortField]?invert?-1:1:invert?1:-1}},function($){var Tab=$.fn.tab.Constructor;Tab.prototype.activate=function(element,container,callback){var $active=container.find("> .active"),transition=callback&&$.support.transition&&($active.length&&$active.hasClass("fade")||!!container.find("> .fade").length);function next(){$active.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-selected",!1),element.addClass("active").find('[data-toggle="tab"]').attr("aria-selected",!0),transition?(element[0].offsetWidth,element.addClass("in")):element.removeClass("fade"),element.parent(".dropdown-menu").length&&element.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-selected",!0),callback&&callback()}$active.length&&transition?$active.one("bsTransitionEnd",next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next(),$active.removeClass("in")}}(jQuery),svi.versionNumber="6.2.2",svi.buildNumber="1729197414510",svi.ns("svi.debug"),window.hasOwnProperty("sviDebug")||(window.sviDebug=!1),svi.debug.enabled=window.sviDebug,svi.debug.getInjector=function(){if(svi.hasOwnProperty("ngApp")&&angular.isObject(svi.ngApp))return svi.ngApp.get("$injector");var injector=angular.element(document.body).injector();return injector||(injector=angular.element(".sviInvestor").injector()),injector},svi.debug.showWidgets=function(internal){var handleDocClick=function(evt){if(!evt.shownWidgets){for(var curEl=evt.target;curEl;){if(curEl.classList.contains("svi-widget-popover"))return;curEl=curEl.parentElement}svi.$(".svi-widget-tooltip").popover("hide")}},handleWidgetClick=function(e){e.shownWidgets||(e.shownWidgets=!0,svi.$(".svi-widget-tooltip").popover("hide"),svi.$(e.currentTarget).popover("show"))};fetch("/Web/debug/debug/widgets?internal="+(internal?"true":"false")).then(function(resp){return resp.json()}).then(function(json){document.addEventListener("click",handleDocClick),json.widgets.forEach(function(widget){var insts=document.querySelectorAll("[data-"+widget.name);insts.length&&insts.forEach(function(inst){!function(inst,widgets,version){if(!inst.classList.contains("svi-widget-tooltip")){for(var content="",curEl=inst;curEl;){for(var widget=null,i=0;i<widgets.length;i++)if(curEl.hasAttribute("data-"+widgets[i].name)){widget=widgets[i];break}if(widget){var href="https://developer.scivantage.com/documentation/embedded-widgets/embedded-widgets-api/?version="+encodeURIComponent(version)+"&href="+encodeURIComponent(widget.href);content+='<div style="margin:5px 0">'+php.htmlspecialchars(widget.title)+'<br><a href="'+php.htmlspecialchars(href)+'" target="_blank">'+php.htmlspecialchars(widget.name)+"</a></div>"}curEl=curEl.parentElement}inst.querySelectorAll("[data-svi-loader]").forEach(function(loader){var child=loader.firstElementChild;if(child){var childScope=svi.angular.element(child).scope();childScope&&childScope.wsUris&&childScope.wsUris.length&&childScope.wsUris.forEach(function(uri){content+='<div style="margin:5px 0; overflow-x: auto">'+php.htmlspecialchars(uri)+"</div>"})}}),inst.style.outline="1px solid red",inst.classList.add("svi-widget-tooltip"),inst.classList.add("svi-bs-tooltip-disabled"),svi.$(inst).popover({animation:!1,content:content,html:!0,template:'<div class="popover svi-widget-popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>',placement:"auto",trigger:"manual",container:".modals-section"}),inst.addEventListener("click",handleWidgetClick)}}(inst,json.widgets,json.version)})})})},svi.ns("svi.fixDropdown"),svi.fixDropdown.onClick=function(e){if(!e||!e.currentTarget)return!1;$(e.currentTarget).parent().hasClass("open")?svi.fixDropdown.onHide(e):svi.fixDropdown.onShow(e)},svi.fixDropdown.onPageScroll=function(e){e&&e.data?(e=e.data,$(e.currentTarget).parent().hasClass("open")&&svi.fixDropdown.onShow(e)):$(document).click()},svi.fixDropdown.onShow=function(e){if(!e||!e.currentTarget)return!1;var doc=$(document),button=$(e.currentTarget),dropdown=button.parent().find(".dropdown-menu"),buttonOffset=button.offset(),buttonHeight=button.outerHeight(),windowHeight=$(window).height();doc.one("scroll",null,e,svi.fixDropdown.onPageScroll),button.parent().one("hide.bs.dropdown",svi.fixDropdown.onHide);var dropDownTop=buttonOffset.top+buttonHeight-doc.scrollTop(),dropDownLeft=buttonOffset.left-doc.scrollLeft();if(dropdown.hasClass("dropdown-menu-right")){var dropDownRight=$(window).width()-(dropDownLeft+button.outerWidth());dropdown.css("left","auto"),dropdown.css("right",dropDownRight+"px")}else dropdown.css("left",dropDownLeft+"px"),dropdown.css("right","auto");return dropDownTop+buttonHeight+dropdown.height()>windowHeight?(dropdown.css("top","auto"),dropdown.css("bottom",windowHeight-dropDownTop+buttonHeight+"px")):(dropdown.css("top",dropDownTop+"px"),dropdown.css("bottom","auto")),dropdown.css("position","fixed"),!0},svi.fixDropdown.onHide=function(e){$(document).off("scroll",svi.fixDropdown.onPageScroll)},svi.fixDropdown.closeAbosoluteDropdownEventRegistered=!1,svi.fixDropdown.registerCloseAbosoluteDropdownEvent=function(){svi.fixDropdown.closeAbosoluteDropdownEventRegistered||(svi.fixDropdown.closeAbosoluteDropdownEventRegistered=!0,$(window).bind("resize",function(e){$("#action-menu-dropdown-absolute-position").length&&$(".dropdown.open .dropdown-toggle").dropdown("toggle")}))},svi.ns("svi.format"),svi.format.camelCaseToDashes=function(str){return str.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},svi.format.camelCaseToSpaces=function(str){return str.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()},svi.format.spacesToCamelCase=function(str){return str.toLowerCase().replace(/ ([a-z])/g,function(match,$1){return $1.toUpperCase()})},function($){$.deserialize=function(str,options){var pairs=str.split(/&amp;|&/i),h={};options=options||{};for(var i=0;i<pairs.length;i++){var kv=pairs[i].split("=");if(kv[0]=decodeURIComponent(kv[0]),!options.except||-1==options.except.indexOf(kv[0]))if(/^\w+\[\w+\]$/.test(kv[0])){var matches=kv[0].match(/^(\w+)\[(\w+)\]$/);void 0===h[matches[1]]&&(h[matches[1]]={}),h[matches[1]][matches[2]]=decodeURIComponent(kv[1])}else h[kv[0]]=decodeURIComponent(kv[1])}return h},$.fn.deserialize=function(options){return $.deserialize($(this).serialize(),options)}}(jQuery),function($){$.fn.findExclude=function(selector,mask,result){return void 0===result&&(result=$()),this.children(":not("+mask+")").each(function(){var el=$(this);el.is(selector)&&result.push(this),el.findExclude(selector,mask,result)}),result}}(jQuery),jQuery.fn.hasScrollBar=function(){return!!this.get(0)&&this.get(0).scrollHeight>this.height()},jQuery.fn.reverse=Array.prototype.reverse,function($){$.fn.isInViewport=function(){var el=$(this),elementTop=el.offset().top,elementBottom=elementTop+el.outerHeight(),viewportTop=$(window).scrollTop(),viewportBottom=viewportTop+$(window).height();return viewportTop<elementBottom&&elementTop<viewportBottom},$.fn.scrollIntoView=function(offset,speed,callback){var el=$(this);return el.isInViewport()?"function"==typeof callback&&callback.apply(this,[]):("number"!=typeof offset&&(offset=0),"number"!=typeof speed&&(speed=0),$("html,body").animate({scrollTop:el.offset().top+offset},speed,null,callback)),el}}(jQuery),svi.ns("svi.ng"),svi.ng.addCommWatch=function($scope){return $scope.$watch("comm",function(newValue,oldValue){angular.isObject(newValue)&&angular.forEach(newValue,function(value,key){$scope[key]=value})},!0)},svi.ng.getControllerFactory=function(el,$scope,name,variableName){var cls="."+name,ctrlName=$.camelCase(name);return angular.isUndefined(variableName)&&(variableName=ctrlName+"Ctrl"),function(refresh){if(refresh||!$scope[variableName]){angular.isString(el)&&(el=angular.element(el));var ctrl=el.find(cls).controller(ctrlName);ctrl&&($scope[variableName]=ctrl)}return $scope[variableName]}},svi.ng.getLoaderFactory=function(el,$scope,name){angular.isUndefined(name)&&(name="loader");var fn=svi.ng.getControllerFactory(el,$scope,"svi-loader",name);return function(){if(!$scope[name]){var loaderCtrl=fn();loaderCtrl&&($scope[name]=loaderCtrl.getScope())}return $scope[name]}},svi.ng.getInput=function($scope,$attrs,field){return $scope.hasOwnProperty(field)?$scope[field]:$attrs.hasOwnProperty(field)?$attrs[field]:null},svi.ng.required=function($attrs,field,emptyOk){if(angular.isUndefined(emptyOk)&&(emptyOk=!1),!$attrs.hasOwnProperty(field)||""===$attrs[field]&&!emptyOk)throw field+" is required";return $attrs[field]},svi.ng.defaultString=function($scope,$attrs,field,defaultValue,noSetAttr){var input=svi.ng.getInput($scope,$attrs,field);return input="*EMPTY*"===input?"":input||defaultValue,$scope[field]=noSetAttr?input:$attrs[field]=input,$scope[field]},svi.ng.defaultValidString=function($scope,$attrs,field,allowedValues,defaultValue){var str=svi.ng.defaultString($scope,$attrs,field,defaultValue);return str===defaultValue||php.in_array(str,allowedValues)||($scope[field]=$attrs[field]=defaultValue),$scope[field]},svi.ng.defaultInt=function($scope,$attrs,field,defaultValue,maxValue,minValue){var input=svi.ng.getInput($scope,$attrs,field),num=parseInt(input);if((num=isNaN(num)?defaultValue:num)!==defaultValue&&angular.isNumber(maxValue)&&maxValue<num)throw field+": "+num+" is greater than maximum of "+maxValue;if(num!==defaultValue&&angular.isNumber(minValue)&&num<minValue)throw field+": "+num+" is less than minimum of "+minValue;return $scope[field]=$attrs[field]=num,$scope[field]},svi.ng.defaultFloat=function($scope,$attrs,field,defaultValue){var input=svi.ng.getInput($scope,$attrs,field),num=parseFloat(input);return $scope[field]=$attrs[field]=isNaN(num)?defaultValue:num,$scope[field]},svi.ng.defaultBoolean=function($scope,$attrs,field,defaultValue){return svi.ng[defaultValue?"defaultTrue":"defaultFalse"]($scope,$attrs,field)},svi.ng.defaultTrue=function($scope,$attrs,field){var input=svi.ng.getInput($scope,$attrs,field);return $scope[field]=$attrs[field]=svi.ng.strToBoolean(input,!0),$scope[field]},svi.ng.defaultFalse=function($scope,$attrs,field){var input=svi.ng.getInput($scope,$attrs,field);return $scope[field]=$attrs[field]=svi.ng.strToBoolean(input,!1),$scope[field]},svi.ng.strToBoolean=function(input,defaultValue){return"boolean"==typeof input?input:((angular.isUndefined(defaultValue)||"boolean"!=typeof defaultValue)&&(defaultValue=!1),angular.isUndefined(input)||null===input?defaultValue:"number"==typeof input||"object"==typeof input?!!input:defaultValue?!("false"===input.toLowerCase()||"N"===input.toUpperCase()||"0"===input||""===input):"true"===input.toLowerCase()||"Y"===input.toUpperCase()||"1"===input)},svi.ng.parseJSON=function($scope,$attrs,field,jsonString){if(void 0===jsonString&&(jsonString=svi.ng.defaultString($scope,$attrs,field,"")),""===jsonString)$scope[field]=$attrs[field]=null;else try{$scope[field]=$attrs[field]=JSON.parse(jsonString)}catch(e){if(null!=e.message.match("&"))return svi.ng.parseJSON($scope,$attrs,field,php.htmlspecialchars_decode(jsonString));throw field+": Error parsing JSON: "+e+"\nInput String: "+jsonString}return $scope[field]},svi.ns("svi.ng.symbol"),svi.ng.symbol.isCUSIP=function(symbol){var chunk1=symbol.substring(0,3),chunk2=symbol.substring(3,6),chunk3=symbol.substring(6,8),regex1=new RegExp(/^[0-9]*$/i),regex2=new RegExp(/^[a-z0-9]*$/i);return regex1.test(chunk1)&&regex2.test(chunk2)&&regex2.test(chunk3)},svi.ns("svi.ngTemplates"),svi.ngTemplates.hasOwnProperty("_templatesImported")||(svi.ngTemplates._templatesImported=!1),svi.ngTemplates._addTemplate=function(id,html){svi.ngTemplates[id]=html,svi.ngTemplates._templatesImported&&svi.ngApp.get("$templateCache").put(id,html)},svi.ngTemplates._normalizePath=function(path,removeExt){if(!angular.isString(path))return console.error("normalizeTCPath: path is expected to be string. path is: "+path),path;angular.isUndefined(removeExt)&&(removeExt=!1);var parts=path.split("?");if(2==parts.length){var query=jQuery.deserialize(parts[1]);query.hasOwnProperty("template")&&(query.hasOwnProperty("config")&&angular.isObject(query.config)&&(query.config=JSON.stringify(query.config)),path=query.hasOwnProperty("config")&&angular.isString(query.config)&&"{}"!=query.config?query.template.replace(/\.p?html$/,removeExt?"":".html")+"?"+query.config:query.template)}else 1==parts.length&&(path=parts[0]);return path=path.replace(/\.p?html$/,removeExt?"":".html")},Array.prototype.union||(Array.prototype.union=function(a){return this.diff(a).concat(a)}),Array.prototype.intersect||(Array.prototype.intersect=function(a){return this.filter(function(i){return-1!==a.indexOf(i)})}),Array.prototype.diff||(Array.prototype.diff=function(a){return this.filter(function(i){return-1===a.indexOf(i)})}),Array.prototype.symDiff||(Array.prototype.symDiff=function(a){return this.diff(a).concat(a.diff(this))}),Math.hasOwnProperty("log10")||(Math.log10=function(x){return Math.log(x)/Math.LN10}),String.prototype.startsWith||(String.prototype.startsWith=function(searchString,position){return position=position||0,this.substr(position,searchString.length)===searchString}),svi.ns("Sha1"),Sha1.hash=function(msg){msg=msg.utf8Encode();var i,t,K=[1518500249,1859775393,2400959708,3395469782],l=(msg+=String.fromCharCode(128)).length/4+2,N=Math.ceil(l/16),M=new Array(N);for(i=0;i<N;i++){M[i]=new Array(16);for(var j=0;j<16;j++)M[i][j]=msg.charCodeAt(64*i+4*j)<<24|msg.charCodeAt(64*i+4*j+1)<<16|msg.charCodeAt(64*i+4*j+2)<<8|msg.charCodeAt(64*i+4*j+3)}M[N-1][14]=8*(msg.length-1)/Math.pow(2,32),M[N-1][14]=Math.floor(M[N-1][14]),M[N-1][15]=8*(msg.length-1)&4294967295;var a,b,c,d,e,H0=1732584193,H1=4023233417,H2=2562383102,H3=271733878,H4=3285377520,W=new Array(80);for(i=0;i<N;i++){for(t=0;t<16;t++)W[t]=M[i][t];for(t=16;t<80;t++)W[t]=Sha1.ROTL(W[t-3]^W[t-8]^W[t-14]^W[t-16],1);for(a=H0,b=H1,c=H2,d=H3,e=H4,t=0;t<80;t++){var s=Math.floor(t/20),T=Sha1.ROTL(a,5)+Sha1.f(s,b,c,d)+e+K[s]+W[t]&4294967295;e=d,d=c,c=Sha1.ROTL(b,30),b=a,a=T}H0=H0+a&4294967295,H1=H1+b&4294967295,H2=H2+c&4294967295,H3=H3+d&4294967295,H4=H4+e&4294967295}return Sha1.toHexStr(H0)+Sha1.toHexStr(H1)+Sha1.toHexStr(H2)+Sha1.toHexStr(H3)+Sha1.toHexStr(H4)},Sha1.f=function(s,x,y,z){switch(s){case 0:return x&y^~x&z;case 1:return x^y^z;case 2:return x&y^x&z^y&z;case 3:return x^y^z}},Sha1.ROTL=function(x,n){return x<<n|x>>>32-n},Sha1.toHexStr=function(n){for(var s="",i=7;0<=i;i--)s+=(n>>>4*i&15).toString(16);return s},void 0===String.prototype.utf8Encode&&(String.prototype.utf8Encode=function(){return unescape(encodeURIComponent(this))}),void 0===String.prototype.utf8Decode&&(String.prototype.utf8Decode=function(){try{return decodeURIComponent(escape(this))}catch(e){return this}}),"undefined"!=typeof module&&module.exports&&(module.exports=Sha1),"function"==typeof define&&define.amd&&define([],function(){return Sha1}),svi.ns("svi.sqope"),svi.sqope.launch=function(page){page=page||"dashboard",svi.sqope.isActive()?svi.sqope.goToPage(page):svi.sqope.sso(page)},svi.sqope.isActive=function(){return window.hasOwnProperty("PR_CONFIG")},svi.sqope.goToPage=function(page){window.location.hash="/"+page},svi.sqope.sso=function(page){window.location=svi.url.getHost()+"/Web/sqope/redirect/"+page},svi.ns("svi.ui"),svi.ui.pulse=function(selector,color){void 0===color&&(color="#B0E3FF"),$(selector).animate({backgroundColor:color},{duration:1e3,always:function(opt){$(opt.elem).css("background-color","")}})},svi.ns("svi.url"),svi.url.getHost=function(){var host="";if("object"==typeof sviInvestorAppConfig&&sviInvestorAppConfig.hasOwnProperty("host")&&sviInvestorAppConfig.host)host=sviInvestorAppConfig.host;else try{host=svi.Config.getHost()}catch(e){}return host||(host=""),host},svi.url.addHost=function(path){return svi.url.getHost()+path},svi.url.newWindowRedirect=function(url,target,specs){if($.browser.msie){var win=window.open("",target,specs),referLink=win.document.createElement("a");referLink.href=url,win.document.body.appendChild(referLink),referLink.click()}else $.browser.msedge&&(url=svi.url.getHost()+"/Web/util/util/fixReferer?url="+encodeURIComponent(url)),window.open(url,target,specs)},svi.ns("svi.util"),svi.util.parseRegExp=function(str){return new RegExp(str.substr(str.indexOf("/")+1,str.lastIndexOf("/")-1),str.substr(str.lastIndexOf("/")+1))},svi.util.convertOptionSymbol=function(option){var tmpArray=option.split(":");return 4===tmpArray.length?tmpArray[0]+" "+tmpArray[3]+" "+tmpArray[2]+" "+tmpArray[1].replace(/-/g,"/"):""},svi.util.sortByKeys=function(obj){for(var keys=Object.keys(obj).sort(),data={},i=0,l=keys.length;i<l;i++)data[keys[i]]=obj[keys[i]];return data},svi.util.closeExpandedDDL=function(evt){if((evt=evt||(window.event?event:null))&&evt.relatedTarget){if(document.activeElement){var focussable=Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return 0<element.offsetWidth||0<element.offsetHeight||element===document.activeElement}),index=focussable.indexOf(document.activeElement);if(evt.relatedTarget.classList.contains("btn")||evt.relatedTarget.classList.contains("alert-button")||"checkbox"==evt.relatedTarget.className||evt.relatedTarget.attributes["data-toggle"]||evt.relatedTarget.attributes["aria-expanded"]||evt.relatedTarget.attributes["data-ng-focus"]||evt.relatedTarget.attributes.role&&"menuitem"==evt.relatedTarget.attributes.role.value||"A"===evt.relatedTarget.tagName){var ddl=document.getElementsByClassName("open");ddl&&ddl[0]&&ddl[0].classList.remove("open");var indexOfPrevElement=focussable.indexOf(evt.relatedTarget);focussable[index+(index-indexOfPrevElement)].focus()}else focussable[index-1].focus()}}},svi.ns("svi.widgets"),svi.widgets.initApp=function(el){var injector=angular.element(el).injector();return injector||angular.bootstrap(el,["sviInvestor"])},svi.widgets.destroyApp=function(el){var injector=angular.element(el).injector();injector&&injector.get("$rootScope").$destroy()},angular.module("directives").directive("sviAccountProfile",["APP_CONFIG","$templateCache","$timeout","labels","accountList","nameAddress","eventDispatcher","piwik",function(APP_CONFIG,$templateCache,$timeout,labels,accountList,nameAddress,eventDispatcher,piwik){return{replace:!1,scope:{account:"@",showBonusTrades:"@",showBonusTradesExpiration:"@",showDayTraderValue:"@"},template:$templateCache.get("accountProfile/accountProfile.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultFalse($scope,$attrs,"showBonusTrades"),svi.ng.defaultTrue($scope,$attrs,"showBonusTradesExpiration"),svi.ng.defaultString($scope,$attrs,"showDayTraderValue","")}catch(e){throw"sviAccountProfile: "+e}$scope.nameAddress=null;var getWidgetCtrl=svi.ng.getControllerFactory($element,$scope,"svi-widget");$scope.setLoader=function(loader){$scope.loader=loader;var widget=getWidgetCtrl();widget&&widget.setLoader(loader)},labels.setupLabels($scope,["accountProfile","buyingPower"]);var loadCallback=function(){return nameAddress.getNameAddress($scope.account)},onSuccess=function(data){piwik.trackPage("accountProfile","Account Profile",1e3*data._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.nameAddress=data.nameAddress.nameAddress},onError=function(reason){piwik.trackPage("accountProfile/error","Error: Account Profile",!1,[{name:"numAccounts",index:1,value:1}])};this.getLoader=svi.ng.getLoaderFactory($element.find(".na-loader"),$scope),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,200)},$scope.api=this,$timeout(function(){$scope.api&&($scope.nameAddress||$scope.api.load())},200),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&data.hasOwnProperty("currentAccount")&&($scope.account=data.currentAccount,$scope.nameAddress=null,$scope.api&&$scope.api.load())},!0)}]}}]),angular.module("directives").directive("sviAccountsSummaryContainer",["APP_CONFIG","$templateCache","$timeout","$log","totalPortfolioMovers","accountList","eventDispatcher","state","labels","$compile","piwik","actionMenu",function(APP_CONFIG,$templateCache,$timeout,$log,totalPortfolioMovers,accountList,eventDispatcher,state,labels,$compile,piwik,actionMenu){return{replace:!1,scope:{template:"@",columns:"@",columnPriority:"@",responsiveColumns:"@",sortable:"@",forceAllAccounts:"@",showExpander:"@",showTitle:"@",autoExpandSingle:"@",showOptionBuyingPower:"@",localProductType:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultString($scope,$attrs,"columns",'["accountDisplay","cash","marketValue","marketValueChange","percentChange"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["accountDisplay","account","accountNickname","marketValue","cash","marketValueChange","percentChange"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultTrue($scope,$attrs,"sortable"),svi.ng.defaultFalse($scope,$attrs,"showExpander"),svi.ng.defaultTrue($scope,$attrs,"showTitle"),svi.ng.defaultTrue($scope,$attrs,"autoExpandSingle"),svi.ng.defaultTrue($scope,$attrs,"localProductType"),svi.ng.defaultTrue($scope,$attrs,"forceAllAccounts")}catch(e){throw"sviAccountsSummaryContainer: "+e}$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.productId=!1,svi.ng.defaultTrue($scope,$attrs,"showOptionBuyingPower"),$scope.refocus=null,$scope.multiAccountFlag=!1,$scope.defaultClasses=APP_CONFIG.defaultClasses,$scope.financialAdvisorClasses=APP_CONFIG.financialAdvisorClasses,$scope.quickLinksClasses=APP_CONFIG.quickLinksClasses,$scope.tradesClasses=APP_CONFIG.tradesClasses,labels.setupLabels($scope,["accountsSummary"],{}),$scope.sortDir=state.get("acctSummary-sortDir","asc"),$scope.sortField=state.get("acctSummary-sortField","account"),$scope.$watch("sortField",function(val){state.set("acctSummary-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("acctSummary-sortDir",val).save()}),$scope.initComplete=!1,$scope.totalPortfolioMovers=!1;try{$attrs.columns=JSON.parse($attrs.columns)}catch(e){$log.error("sviAccountsSummaryContainer: Error parsing columns",e,$attrs.columns),$attrs.columns=[]}$scope.columns=$attrs.columns;try{$attrs.columnPriority=JSON.parse($attrs.columnPriority)}catch(e){$log.error("sviAccountsSummaryContainer: Error parsing columnPriority",e,$attrs.columnPriority),$attrs.columnPriority={}}$scope.columnPriority=$attrs.columnPriority,$scope.getLoadParameters=function(){var loadParameters={sortField:$scope.sortField,sortDir:$scope.sortDir};return!1!==$scope.productId&&(loadParameters.productId=null!==$scope.productId?$scope.productId:"NULL"),$scope.forceAllAccounts&&(loadParameters.switchAccounts="N"),loadParameters},this.getLoader=svi.ng.getLoaderFactory($element,$scope,"loader"),this.load=function(){if($scope.initComplete){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,200)}};var loadCallback=function(){$scope.totalPortfolioMovers=!1;var data=$scope.getLoadParameters();return totalPortfolioMovers.getAllAccountsSummary($scope.forceAllAccounts?"all":$scope.accounts,data)},onSuccess=function(response){piwik.trackPage("accountsSummaryContainer","Account Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:$scope.forceAllAccounts?"all":angular.isArray($scope.accounts)?$scope.accounts.length:1}]),response.totalPortfolioMovers.accounts?1<response.totalPortfolioMovers.accounts.length?($scope.totalPortfolioMovers=response.totalPortfolioMovers,setActionMenu(),$scope.multiAccountFlag=!0):($scope.detailDatapoints=response.totalPortfolioMovers.accounts[0].detailDatapoints,$scope.quickLinks=response.totalPortfolioMovers.accounts[0].quickLinks,$scope.totalPortfolioMovers=response.totalPortfolioMovers):$scope.api.getLoader().setMessage($scope.labels.noPortfolioData)},onError=function(reason){piwik.trackPage("accountsSummaryContainer/error","Error: Account Summary",!1,[{name:"numAccounts",index:1,value:$scope.forceAllAccounts?"all":angular.isArray($scope.accounts)?$scope.accounts.length:1}])};$scope.api=this,$timeout(function(){$scope.initComplete=!0,$scope.totalPortfolioMovers||$scope.api.load()},400);var setActionMenu=function(){$scope.totalPortfolioMovers.accounts.map(function(account){var eventData=JSON.parse(JSON.stringify(account));account.actionMenu=[{priority:0,label:$scope.labels.quickView,type:"event",event:{name:"ACCOUNT.QUICK.VIEW.IN.MODAL",data:{account:eventData}}},{priority:5,label:$scope.labels.detail,type:"event",event:{name:"ACCOUNT.CONTEXT.CHANGED",data:{index:eventData.accountIndex,account:eventData.account,nickname:eventData.accountNickname,productId:eventData.productId,currentAccount:[eventData.accountIndex]}}}]})};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,data.hasOwnProperty("productId")?$scope.productId=data.productId:$scope.productId=!1,$scope.multiAccountFlag=!1,$scope.totalPortfolioMovers=!1,0<$scope.accounts.length&&$scope.api.load()},!0,$element),eventDispatcher.on("ACCT_SUMMARY.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.refocus='.svi-column-header[data-event="ACCT_SUMMARY.'+data.field+'"]',$scope.api.load())},!0,$element),eventDispatcher.on("ACCT_SUMMARY.ACTION.TRADE",function(e,data){actionMenu.startTradeWidget(data)},!1,$element)}],link:function($scope,$element,$attrs){$element.html($templateCache.get("accountsSummaryContainer/accountsSummaryContainer"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviAccountsSummaryGrid",["$templateRequest","$compile","eventDispatcher","labels","floatThead","expander","$timeout","$modal",function($templateRequest,$compile,eventDispatcher,labels,floatThead,expander,$timeout,$modal){return{replace:!1,scope:{columns:"=",columnPriority:"=",responsiveColumns:"@",totalPortfolioMovers:"=",sortField:"=?",sortDir:"=?",sortable:"=",showExpander:"@",autoExpandSingle:"@",localProductType:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultFalse($scope,$attrs,"showExpander"),svi.ng.defaultTrue($scope,$attrs,"autoExpandSingle"),svi.ng.defaultTrue($scope,$attrs,"localProductType")}catch(e){throw"sviAccountsSummaryGrid: "+e}$scope.api=this,$scope.id=php.uniqid("accountSummaryGrid"),$scope.modal=null,$scope.modalScope=null,labels.setupLabels($scope,["accountsSummary"],{}),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{expander:!1,marketValueChange:"currencyIndicator",percentChange:"percentIndicator"}},floatThead.init($scope,$element),expander.init($scope,$scope.id,$element);var attachRowHandlers=function(){$scope.showExpander&&$element.find(".svi-expand-row-target").each(function(){var el=$(this);if($scope.rc&&$scope.rc.isColCollapsed("expander")){if(!el.hasClass("svi-toggle-row")){var index=el.attr("data-toggle-row");el.addClass("svi-toggle-row"),el.on("click",$scope.onActivate),el.on("keypress",$scope.onActivate),el.attr("tabindex")||(el.attr("data-added-tabindex",1),el.attr("tabindex","0")),el.attr("role")||(el.attr("data-added-role",1),el.attr("role","button")),$scope.totalPortfolioMovers&&$scope.totalPortfolioMovers.accounts&&$scope.totalPortfolioMovers.accounts[index]?el.attr("aria-label","toggle details for account "+$scope.totalPortfolioMovers.accounts[index].accountDisplay):el.attr("aria-label","toggle account details"),el.attr("aria-expanded",$scope.visibleRows[index]?"true":"false")}}else el.hasClass("svi-toggle-row")&&(el.removeClass("svi-toggle-row"),el.off("click",$scope.onActivate),el.off("keypress",$scope.onActivate),el.attr("data-added-tabindex")&&(el.removeAttr("data-added-tabindex"),el.removeAttr("tabindex")),el.attr("data-added-role")&&(el.removeAttr("data-added-role"),el.removeAttr("role")),el.removeAttr("aria-label"),el.removeAttr("aria-expanded"))})};$scope.$watch("totalPortfolioMovers",function(){expander.reset($scope),$scope.autoExpandSingle&&$scope.totalPortfolioMovers&&$scope.totalPortfolioMovers.accounts&&1==$scope.totalPortfolioMovers.accounts.length&&$timeout(function(){$scope.rc.expandRow(0),expander.expand($scope,0)},200),$timeout(attachRowHandlers,250)}),$scope.$watch("rc.isColCollapsed('expander')",function(newVal,oldVal){attachRowHandlers()}),$scope.onActivate=function(evt){if("keypress"!=evt.type||13==evt.which||32==evt.which)if(evt.stopPropagation(),evt.preventDefault(),$scope.showExpander){var el=$(evt.target).closest("[data-toggle-row]"),index=el.attr("data-toggle-row");$scope.visibleRows[index]?($scope.rc.collapseRow(index),expander.collapse($scope,index)):($scope.rc.expandRow(index),expander.expand($scope,index)),$timeout(function(){el.hasClass("svi-toggle-row")&&el.attr("aria-expanded",$scope.visibleRows[index]?"true":"false")})}else $scope.rc.onClick(evt)},$scope.onClick=function(event,index){$scope.onActivate(event)},eventDispatcher.on("EXPANDER."+$scope.id,function(evt,data){if(angular.isObject(data)&&data.hasOwnProperty("show")&&data.show&&data.hasOwnProperty("target")){var index=parseInt(data.target);if(!isNaN(index)&&$scope.totalPortfolioMovers&&$scope.totalPortfolioMovers.accounts&&$scope.totalPortfolioMovers.accounts.length>index){var account=$scope.totalPortfolioMovers.accounts[index];angular.isObject(account)&&account.hasOwnProperty("productId")&&eventDispatcher.trigger("PRODUCT_TYPE.CHANGED."+$scope.id,account)}}},!1,$element),$scope.displayModal=function(account){$scope.modalScope=$scope.$new(),$scope.modalScope.labels=$scope.labels,$scope.modalScope.id="accountsSummaryChart"+$scope.id,$scope.modalScope.accountData=account,$scope.modalScope.title="Account: "+account.account+" "+account.accountNickname,$scope.modalScope.detailDatapoints=JSON.parse(JSON.stringify(account.detailDatapoints)),$scope.modalScope.quickLinks=JSON.parse(JSON.stringify(account.quickLinks)),$scope.modalScope.accountIndex=JSON.parse(JSON.stringify(account.accountIndex)),$scope.modal=$modal({scope:$scope.modalScope,templateUrl:"accountsSummaryGrid/accountSummaryModal.tpl.html",container:".modals-section",backdrop:!0,animation:"",show:!0})},this.hide=function(){$scope.modal&&$scope.modal.$isShown&&($("body").removeClass("modal-open"),$scope.modal.hide())},eventDispatcher.on("ACCOUNT.QUICK.VIEW.IN.MODAL",function(e,data){e&&data.account&&$scope.displayModal(data.account)},!0,$element),eventDispatcher.on("ACCOUNT.QUICK.VIEW.IN.MODAL.CLOSE",function(e,data){$scope.api.hide()},!0,$element)}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("accountInfo/accountsSummaryGrid/accountsSummaryGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviAccountSummaryDetail",["$templateCache","accountList","piwik","$log","$timeout","APP_CONFIG","$filter","labels","balances","orders","iraSummary","holdings","projectedIncome","permissions","eventDispatcher","switchAccount",function($templateCache,accountList,piwik,$log,$timeout,APP_CONFIG,$filter,labels,balances,orders,iraSummary,holdings,projectedIncome,permissions,eventDispatcher,switchAccount){return{replace:!1,scope:{account:"@",dataPoints:"=?",defaultClasses:"@",financialAdvisorClasses:"@",tradesClasses:"@",quickLinksClasses:"@",showOptionBuyingPower:"@",quickLinks:"=?",rcRows:"&?",accountData:"="},template:$templateCache.get("accountSummaryDetail/accountSummaryDetail.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){var self=this;svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"defaultClasses","col-lg-6 col-md-6 col-xs-6"),svi.ng.defaultString($scope,$attrs,"financialAdvisorClasses","col-md-12"),svi.ng.defaultString($scope,$attrs,"tradesClasses","col-md-12"),svi.ng.defaultString($scope,$attrs,"quickLinksClasses","col-md-12"),$scope.fields=null,$scope.fieldsByName={},$scope.isMarginAccount=!1,$scope.optionLevel=!1,$scope.isIRAAccount=!1,$scope.getBalanceData=!1,$scope.balanceData=null,$scope.balancesLoader=null,APP_CONFIG.accountClasses&&($scope.accountClasses=APP_CONFIG.accountClasses),svi.ng.defaultTrue($scope,$attrs,"showOptionBuyingPower"),$scope.setBalancesLoader=function(loader){$scope.balancesLoader=loader},$scope.getOrderStatusData=!1,$scope.orderStatusData=null,$scope.orderStatusLoader=null,$scope.setOrderStatusLoader=function(loader){$scope.orderStatusLoader=loader},$scope.getIncomeSummaryData=!1,$scope.incomeSummaryData=null,$scope.incomeSummaryLoader=null,$scope.setIncomeSummaryLoader=function(loader){$scope.incomeSummaryLoader=loader},$scope.getIraSummaryData=!1,$scope.iraSummaryData=null,$scope.iraSummaryLoader=null,$scope.setIraSummaryLoader=function(loader){$scope.iraSummaryLoader=loader},$scope.getHoldingsData=!1,$scope.holdingsData=null,$scope.holdingsLoader=null,$scope.setHoldingsLoader=function(loader){$scope.holdingsLoader=loader},$scope.getProjectedIncomeData=!1,$scope.projectedIncomeData=null,$scope.projectedIncomeLoader=null,$scope.shouldShowAccountLinks=null,$scope.setProjectedIncomeLoader=function(loader){$scope.projectedIncomeLoader=loader},$scope.myFA=!1,permissions.get("MY_FINANCIAL_ADVISOR").then(function(result){result&&angular.isObject(result)&&result.hasOwnProperty("data")&&result.data.success&&($scope.myFA=!!result.data.MY_FINANCIAL_ADVISOR,eventDispatcher.broadcast("PRODUCT_TYPE.REFRESH"))}),$scope.tradePricing=!1,permissions.get("TRADE_PRICING_PAG").then(function(result){result&&angular.isObject(result)&&result.hasOwnProperty("data")&&result.data.success&&($scope.tradePricing=!!result.data.TRADE_PRICING_PAG,eventDispatcher.broadcast("PRODUCT_TYPE.REFRESH"))}),labels.setupLabels($scope,["accountSummaryDetail"],{balancesLoading:"Loading Balances",orderStatusLoading:"Loading Order Status",incomeSummaryLoading:"Loading Income Summary",iraSummaryLoading:"Loading IRA Summary",holdingsLoading:"Loading Holdings",projectedIncomeLoading:"Loading Projected Income"}),$scope.$watch("dataPoints",function(dataPoints){if($scope.getBalanceData=!1,$scope.getOrderStatusData=!1,$scope.getIncomeSummaryData=!1,$scope.getIraSummaryData=!1,$scope.getHoldingsData=!1,$scope.getProjectedIncomeData=!1,$scope.fieldsByName={},angular.isArray(dataPoints)&&0!==dataPoints.length){$scope.fields=[];for(var supported,dp=null,i=0,l=dataPoints.length;i<l;i++)if(dp=dataPoints[i],angular.isObject(dp)&&dp.hasOwnProperty("name")&&dp.hasOwnProperty("label")){switch(dp.hasOwnProperty("classes")||(dp.classes=$scope.defaultClasses),supported=!0,dp.name){case"stockBuyingPower":case"optionBuyingPower":case"marginBalance":case"pctEquity":case"shortBalance":case"daytrading":$scope.getBalanceData=!0;break;case"openOrders":$scope.getOrderStatusData=!0;break;case"incomeYTD":case"expenseYTD":$scope.getIncomeSummaryData=!0;break;case"contributionsYTD":case"distributionsYTD":$scope.getIraSummaryData=!0;break;case"estDividend":case"yield":$scope.getHoldingsData=!0;break;case"projectedInterest":case"projectedDividends":$scope.getProjectedIncomeData=!0;break;default:supported=!1,$log.warn("sviAccountSummaryDetail: unsupported field",dp.name)}supported&&($scope.fields.push(dp),$scope.fieldsByName[dp.name]=dp)}else $log.warn("sviAccountSummaryDetail: invalid datapoint",dp);0===$scope.fields.length&&($scope.fields=null)}else $scope.fields=null;$scope.getBalanceData&&!$scope.balanceData&&self.loadBalances(),$scope.getOrderStatusData&&!$scope.orderStatusData&&self.loadOrderStatus(),$scope.getIncomeSummaryData&&!$scope.incomeSummaryData&&self.loadIncomeSummary(),$scope.getIraSummaryData&&!$scope.iraSummaryData&&self.loadIraSummary(),$scope.getHoldingsData&&!$scope.holdingsData&&self.loadHoldings(),$scope.getProjectedIncomeData&&!$scope.projectedIncomeData&&self.loadProjectedIncome()}),angular.isArray($scope.quickLinks)||($scope.quickLinks=[]),self.loadBalances=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.balancesLoader)return $timeout(self.loadBalances,200);$scope.balanceData=null,$scope.balancesLoader.setLoadHandler(loadBalancesCallback).load(invalidateCache).then(onBalancesSuccess,onError)};var loadBalancesCallback=function(invalidateCache){return balances.getBalances($scope.account,null,invalidateCache)},onBalancesSuccess=function(response){if(piwik.trackPage("accountSummaryDetail/balances","Account Summary Detail: Balances",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.balances)try{$scope.isMarginAccount=response.isMarginAccount,$scope.optionLevel=parseInt(response.optionLevel),$scope.isIRAAccount=response.isIRAAccount,$scope.balanceData=response.balances.accountBalances[0].accountBalance}catch(e){}else $scope.balancesLoader.setError($scope.labels.balancesError)};self.loadOrderStatus=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.orderStatusLoader)return $timeout(self.loadOrderStatus,200);$scope.orderStatusData=null,$scope.orderStatusLoader.setLoadHandler(loadOrderStatusCallback).load(invalidateCache).then(onOrderStatusSuccess,onError)};var loadOrderStatusCallback=function(invalidateCache){return orders.getAccountOrders($scope.account,{filterField:["orderStatus"],filterValue:[["Open"]]},invalidateCache)},onOrderStatusSuccess=function(response){if(piwik.trackPage("accountSummaryDetail/orderStatus","Account Summary Detail: Order Status",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.orders)try{$scope.orderStatusData=response.orders}catch(e){}else $scope.orderStatusLoader.setError($scope.labels.orderStatusError)};self.loadIncomeSummary=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.incomeSummaryLoader)return $timeout(self.loadIncomeSummary,200);$scope.incomeSummaryData=null,$scope.incomeSummaryLoader.setLoadHandler(loadIncomeSummaryCallback).load(invalidateCache).then(onIncomeSummarySuccess,onError)};var loadIncomeSummaryCallback=function(invalidateCache){return balances.getIncomeExpense($scope.account,null,invalidateCache)},onIncomeSummarySuccess=function(response){if(piwik.trackPage("accountSummaryDetail/incomeSummary","Account Summary Detail: Income Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.incomeExpenseSummary)try{$scope.incomeSummaryData=response.incomeExpenseSummary}catch(e){}else $scope.incomeSummaryLoader.setError($scope.labels.incomeSummaryError)};self.loadIraSummary=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.iraSummaryLoader)return $timeout(self.loadIraSummary,200);$scope.iraSummaryData=null,$scope.iraSummaryLoader.setLoadHandler(loadIraSummaryCallback).load(invalidateCache).then(onIraSummarySuccess,onError)};var loadIraSummaryCallback=function(invalidateCache){return iraSummary.getIraSummary($scope.account,null,invalidateCache)},onIraSummarySuccess=function(response){if(piwik.trackPage("accountSummaryDetail/iraSummary","Account Summary Detail: Ira Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.iraSummary)try{$scope.iraSummaryData=response.iraSummary}catch(e){}else $scope.iraSummaryLoader.setError($scope.labels.iraSummaryError)};self.loadHoldings=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.holdingsLoader)return $timeout(self.loadHoldings,200);$scope.holdingsData=null,$scope.holdingsLoader.setLoadHandler(loadHoldingsCallback).load(invalidateCache).then(onHoldingsSuccess,onError)};var loadHoldingsCallback=function(invalidateCache){return holdings.getHoldings($scope.account,{totalsOnly:"Y"},invalidateCache)},onHoldingsSuccess=function(response){if(piwik.trackPage("accountSummaryDetail/holdings","Account Summary Detail: Holdings",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.holdingsTotals)try{$scope.holdingsData=response.holdingsTotals}catch(e){}else $scope.holdingsLoader.setError($scope.labels.holdingsError)};self.loadProjectedIncome=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.projectedIncomeLoader)return $timeout(self.loadProjectedIncome,200);$scope.projectedIncomeData=null,$scope.projectedIncomeLoader.setLoadHandler(loadProjectedIncomeCallback).load(invalidateCache).then(onProjectedIncomeSuccess,onError)};var loadProjectedIncomeCallback=function(invalidateCache){return projectedIncome.getProjectedIncome($scope.account,null,invalidateCache)},onProjectedIncomeSuccess=function(response){if(piwik.trackPage("accountSummaryDetail/projectedIncome","Account Summary Detail: Projected Income",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.projectedIncome)try{$scope.projectedIncomeData=response.projectedIncome}catch(e){}else $scope.projectedIncomeLoader.setError($scope.labels.projectedIncomeError)},onError=function(){},applyFilter=function(field,value){var dp=$scope.fieldsByName[field];if(dp.hasOwnProperty("filter")&&dp.filter){var filter=$filter(dp.filter);if(angular.isFunction(filter)){if(dp.hasOwnProperty("filterArgs")&&angular.isArray(dp.filterArgs)){var args=angular.copy(dp.filterArgs);return args.unshift(value),filter.apply(null,args)}return filter(value)}}return value},checkOptionByKey=function(field,values){switch(field){case"patternDaytrader":return values.includes($scope.balanceData.buyingPower[field]);case"margin":return values===$scope.isMarginAccount;default:return!1}},canShowValue=function(field){var dp=$scope.fieldsByName[field];if(dp.hasOwnProperty("options")){for(var isShow=!0,i=0;i<dp.options.length;i++)isShow=checkOptionByKey(dp.options[i].field,dp.options[i].values);return isShow}return!0};$scope.getValue=function(field){switch(field){case"daytrading":if($scope.balanceData)return canShowValue(field)?applyFilter(field,$scope.balanceData.buyingPower.daytrading):null;break;case"stockBuyingPower":if($scope.balanceData&&$scope.isMarginAccount)return canShowValue(field)?applyFilter(field,$scope.balanceData.buyingPower.stock):null;break;case"optionBuyingPower":if($scope.balanceData&&$scope.isMarginAccount&&$scope.showOptionBuyingPower)return canShowValue(field)?applyFilter(field,$scope.balanceData.buyingPower.options):null;break;case"marginBalance":if($scope.balanceData&&$scope.isMarginAccount)return applyFilter(field,$scope.balanceData.money.marginBalance);break;case"pctEquity":if($scope.balanceData&&$scope.isMarginAccount)return applyFilter(field,$scope.balanceData.buyingPower.equityPercentage);break;case"shortBalance":if($scope.balanceData&&$scope.balanceData.shortBalance)return applyFilter(field,$scope.balanceData.shortBalance);break;case"openOrders":if($scope.orderStatusData)return applyFilter(field,$scope.orderStatusData.totalRecords);break;case"incomeYTD":if($scope.incomeSummaryData)return applyFilter(field,$scope.incomeSummaryData.totals.incomeYearToDate);break;case"expenseYTD":if($scope.incomeSummaryData)return applyFilter(field,$scope.incomeSummaryData.totals.expenseYearToDate);break;case"contributionsYTD":if($scope.iraSummaryData)return applyFilter(field,$scope.iraSummaryData.iraSummary.totalContributionsCurrentYear);break;case"distributionsYTD":if($scope.iraSummaryData)return applyFilter(field,$scope.iraSummaryData.iraSummary.totalDistributionsCurrentYear);break;case"estDividend":if($scope.holdingsData)return applyFilter(field,$scope.holdingsData.estDividend);break;case"yield":if($scope.holdingsData)return applyFilter(field,$scope.holdingsData.yield);break;case"projectedInterest":if($scope.projectedIncomeData)return applyFilter(field,$scope.projectedIncomeData.totals.grandInterestAmt);break;case"projectedDividends":if($scope.projectedIncomeData)return applyFilter(field,$scope.projectedIncomeData.totals.grandDividentAmt)}return null};$timeout(function(){$scope.currentAccountData=accountList.getAccountObjectByIndex($scope.account),eventDispatcher.trigger("PRODUCT_TYPE.CHANGED.ACCOUNT.SUMMARY.DETAIL",$scope.currentAccountData),$scope.currentAccountData.groups=accountList.getGroupByAccountIndex($scope.account),$scope.shouldShowAccountLinks=1<accountList.getAccountObjects().length},300),$scope.showAllAccounts=function(){eventDispatcher.trigger("ACCOUNT.QUICK.VIEW.IN.MODAL.CLOSE");var accountsIndexes=accountList.getIndexesFromObjects(accountList.getAccountObjects());switchAccount.multi(accountsIndexes)},$scope.showGroupAccounts=function(groupId){eventDispatcher.trigger("ACCOUNT.QUICK.VIEW.IN.MODAL.CLOSE");var group=accountList.getGroupByGroupId(groupId);switchAccount.group(group)},$scope.api=self}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviIraContribution",["APP_CONFIG","$templateCache","$timeout","iraSummary","nameAddress","sviUrl","accountList","eventDispatcher","labels","piwik","config","dateUtils","$compile",function(APP_CONFIG,$templateCache,$timeout,iraSummary,nameAddress,sviUrl,accountList,eventDispatcher,labels,piwik,config,dateUtils,$compile){var NOW=dateUtils.getDate();return{replace:!1,scope:{account:"@",defaultAge:"@",listener:"@",visGroupId:"@",displayAccount:"@",isIra:"@",template:"@"},template:$templateCache.get("iraContribution/iraContribution.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultInt($scope,$attrs,"defaultAge",37),svi.ng.defaultString($scope,$attrs,"listener","ACCOUNT.CONTEXT.CHANGED"),svi.ng.defaultString($scope,$attrs,"visGroupId",""),svi.ng.defaultTrue($scope,$attrs,"displayAccount"),svi.ng.defaultFalse($scope,$attrs,"isIra"),svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],"")}catch(e){throw"sviIraContribution: "+e}labels.setupLabels($scope,["general","iraContribution"],{}),$scope.showIraContributionWidget=!1,$scope.currentYear=0,$scope.currentYear=dateUtils.getYear(),$scope.priorYear=$scope.currentYear,$scope.priorYear--,$scope.showPriorYear=!1,$scope.contributionLimits={},$scope.contributionLimitCurrentYear="",$scope.contributionLimitPriorYear="",$scope.contributeButtonlink="",$scope.iraContributionCYMaxed=!1,$scope.iraContributionPYMaxed=!1;var yearsAgoStr=$scope.defaultAge+" years ago";$scope.dateOfBirth=new Date(1e3*php.strtotime(yearsAgoStr,NOW)),$scope.dob50yearsAgo=new Date(1e3*php.strtotime("50 years ago",NOW)),$scope.dob70halfyearsAgo=new Date(1e3*php.strtotime("70 years ago 6 months ago",NOW)),$scope.contributionsCurrentYear=0,$scope.contributionsPriorYear=0,$scope.precentageCurrentYear=0,$scope.precentagePriorYear=0,$scope.accountDisplay=accountList.getCurrentAccountDisplay();$scope.onClick=function(account){sviUrl.href($scope.contributeButtonlink)};var showIraContributionWidget=function(){!function(){var taxEndDate=dateUtils.makeDate(NOW.getFullYear(),3,15);switch(taxEndDate.getDay()){case 5:case 6:taxEndDate=dateUtils.makeDate(NOW.getFullYear(),3,18);break;case 0:taxEndDate=dateUtils.makeDate(NOW.getFullYear(),3,17)}NOW<=taxEndDate&&($scope.showPriorYear=!0)}();var ageIsElligible=$scope.dateOfBirth>$scope.dob70halfyearsAgo,accountGroups=accountList.getCurrentGroup(),isAccountGroup=null!=accountGroups&&1<accountGroups.accounts.length;$scope.contributionsCurrentYear>=$scope.contributionLimitCurrentYear?$scope.iraContributionCYMaxed=!0:$scope.iraContributionCYMaxed=!1,$scope.contributionsPriorYear>=$scope.contributionLimitPriorYear?$scope.iraContributionPYMaxed=!0:$scope.iraContributionPYMaxed=!1,!isAccountGroup&&ageIsElligible&&$scope.isIra?($scope.showIraContributionWidget=!0,svi.ui.pulse(".iraContribTitle")):$scope.showIraContributionWidget=!1};this.getLoader=svi.ng.getLoaderFactory($element,$scope),$scope.nameAddressData=null;var loadNameAddressCallback=function(invalidateCache){return nameAddress.getNameAddress($scope.account,null,invalidateCache)},onNameAddressSuccess=function(response){piwik.trackPage("iraContribution/nameAddress","Ira Contribution: Name Address",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]);try{if($scope.nameAddressData=response.nameAddress.nameAddress,$scope.nameAddressData.hasOwnProperty("dateOfBirth")&&""!==$scope.nameAddressData.dateOfBirth)$scope.dateOfBirth=new Date($scope.nameAddressData.dateOfBirth);else{var yearsAgoStr=$scope.defaultAge+" years ago";$scope.dateOfBirth=new Date(1e3*php.strtotime(yearsAgoStr,NOW))}lastYearFromCofig=Object.keys($scope.contributionLimits).sort().pop(),$scope.dateOfBirth<$scope.dob50yearsAgo?($scope.contributionLimits.hasOwnProperty($scope.currentYear)?$scope.contributionLimitCurrentYear=$scope.contributionLimits[$scope.currentYear].over50below70:$scope.contributionLimitCurrentYear=$scope.contributionLimits[lastYearFromCofig].over50below70,$scope.contributionLimits.hasOwnProperty($scope.priorYear)?$scope.contributionLimitPriorYear=$scope.contributionLimits[$scope.priorYear].over50below70:$scope.contributionLimitPriorYear=$scope.contributionLimits[lastYearFromCofig].over50below70):($scope.contributionLimits.hasOwnProperty($scope.currentYear)?$scope.contributionLimitCurrentYear=$scope.contributionLimits[$scope.currentYear].under50:$scope.contributionLimitCurrentYear=$scope.contributionLimits[lastYearFromCofig].under50,$scope.contributionLimits.hasOwnProperty($scope.priorYear)?$scope.contributionLimitPriorYear=$scope.contributionLimits[$scope.priorYear].under50:$scope.contributionLimitPriorYear=$scope.contributionLimits[lastYearFromCofig].under50),$scope.api.loadIraSummary()}catch(e){}var lastYearFromCofig};$scope.iraSummaryData=null;var loadIraSummaryCallback=function(invalidateCache){return iraSummary.getIraSummary($scope.account,null,invalidateCache)},onIraSummarySuccess=function(response){piwik.trackPage("iraContribution/iraSummary","Ira Contribution: Ira Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]);try{$scope.iraSummaryData=response.iraSummary.iraSummary,$scope.iraSummaryData.hasOwnProperty("contributionLimitCurrentYear")&&""!==$scope.iraSummaryData.contributionLimitCurrentYear&&($scope.contributionLimitCurrentYear=$scope.iraSummaryData.contributionLimitCurrentYear),$scope.iraSummaryData.hasOwnProperty("contributionLimitPriorYear")&&""!==$scope.iraSummaryData.contributionLimitPriorYear&&($scope.contributionLimitPriorYear=$scope.iraSummaryData.contributionLimitPriorYear),$scope.iraSummaryData.hasOwnProperty("contributionsCurrentYear")&&$scope.iraSummaryData.hasOwnProperty("contributionsPriorYear")&&($scope.contributionsCurrentYear=$scope.iraSummaryData.contributionsCurrentYear,$scope.contributionsPriorYear=$scope.iraSummaryData.contributionsPriorYear,$scope.precentageCurrentYear=Math.round(Math.abs(100*$scope.contributionsCurrentYear/$scope.contributionLimitCurrentYear)),$scope.precentagePriorYear=Math.round(Math.abs(100*$scope.contributionsPriorYear/$scope.contributionLimitPriorYear)),$scope.initComplete=!0,showIraContributionWidget())}catch(e){}},loadConfigCallback=function(){return config.getConfig(["iraContribution"])},onConfigSuccess=function(data){if(data.hasOwnProperty("config")){var config=data.config;config.hasOwnProperty("contributeButtonlink")&&($scope.contributeButtonlink=config.contributeButtonlink),config.hasOwnProperty("contributionLimit")&&($scope.contributionLimits=config.contributionLimit,$scope.api.loadNameAddress())}},onError=function(reason){};this.load=function(){$scope.api.loadConfig()},this.loadConfig=function(invalidateCache){angular.isUndefined(invalidateCache)&&(invalidateCache=!1);var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadConfigCallback).load().then(onConfigSuccess,onError):$timeout($scope.api.loadConfig,400)},this.loadNameAddress=function(invalidateCache){angular.isUndefined(invalidateCache)&&(invalidateCache=!1);var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadNameAddressCallback).load().then(onNameAddressSuccess,onError):$timeout($scope.api.loadNameAddress,400)},this.loadIraSummary=function(invalidateCache){if(!$scope.isIra)return $scope.iraSummaryData=null,void showIraContributionWidget();angular.isUndefined(invalidateCache)&&(invalidateCache=!1);var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadIraSummaryCallback).load().then(onIraSummarySuccess,onError):$timeout($scope.api.loadIraSummary,400)},$scope.api=this,eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&($scope.nameAddressData=null,$scope.iraSummaryData=null,$scope.loaded=!1,$scope.account=$scope.accounts[0],$scope.accountDisplay=accountList.getCurrentAccountDisplay(),$scope.api.load()),1<$scope.accounts.length&&($scope.isIra=!1)}),eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(e,data){data.hasOwnProperty("single")&&angular.isObject(data.single)&&(data.single.hasOwnProperty("index")&&($scope.account=data.single.index,$scope.accountDisplay=accountList.getAccountsWithNicknames()[$scope.account]),!data.single.hasOwnProperty("isIRA")||$scope.accounts&&1<$scope.accounts.length?$scope.isIra=!1:$scope.isIra=data.single.isIRA,$scope.api.load(),showIraContributionWidget())})}],link:function($scope,$element){var template=$templateCache.get("iraContribution/iraContributionWidget.tpl.html");$element.html(template).show(),$compile($element.contents())($scope),$timeout(function(){$scope.api.load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviIraSummary",["$templateCache","$timeout","iraSummary","accountList","eventDispatcher","labels","piwik",function($templateCache,$timeout,iraSummary,accountList,eventDispatcher,labels,piwik){return{replace:!1,scope:{account:"@",year:"@",yearDropdown:"@",showTaxWithholding:"@",showContributionLimit:"@",hideNullable:"@"},template:$templateCache.get("iraSummary/iraSummary.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultValidString($scope,$attrs,"year",["current","prior"],"current"),svi.ng.defaultString($scope,$attrs,"yearDropdown",'[{"display":"Current Year","value":"current"},{"display":"Prior Year","value":"prior"}]'),svi.ng.defaultTrue($scope,$attrs,"showTaxWithholding"),svi.ng.defaultFalse($scope,$attrs,"showContributionLimit"),svi.ng.defaultFalse($scope,$attrs,"hideNullable"),"false"===$scope.yearDropdown.toLowerCase()&&($scope.yearDropdown=$attrs.yearDropdown=!1)}catch(e){throw"sviIraSummary: "+e}$scope.initComplete=!1,$scope.iraSummary=!1,labels.setupLabels($scope,["general","iraSummary"],{});var modalInit=!($scope.setLoader=function(loader){$scope.loader=loader});$scope.showMore=function(){modalInit?$($element.find(".ira-summary-modal")).modal("show"):(modalInit=!0,$($element.find(".ira-summary-modal")).modal({backdrop:!0,show:!0}))},$scope.hideMore=function(){$($element.find(".ira-summary-modal")).modal("hide")};var load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout(load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}},loadCallback=function(invalidateCache){return $("html,body").animate({scrollTop:0},0),iraSummary.getIraSummary($scope.account,!1,invalidateCache)},onSuccess=function(response){piwik.trackPage("iraSummary","IRA Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.hasOwnProperty("iraSummary")&&response.iraSummary.hasOwnProperty("iraSummary")?$scope.iraSummary=response.iraSummary.iraSummary:$scope.loader.setMessage($scope.labels.noIRASummaryData)},onError=function(reason){piwik.trackPage("iraSummary/error","Error: IRA Summary",!1,[{name:"numAccounts",index:1,value:1}])};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.iraSummary=!1,load())},!0),eventDispatcher.on("IRA_SUMMARY.YEAR.FILTER.CHANGED",function(e,data){$scope.year!==data.value&&($scope.year=data.value)},!0),eventDispatcher.on("IRA_SUMMARY.REFRESH",function(){load(!0)}),eventDispatcher.on("IRA_SUMMARY.MODAL.SHOW",function(){$scope.showMore()}),eventDispatcher.on("IRA_SUMMARY.MODAL.HIDE",function(){$scope.hideMore()}),$timeout(function(){$scope.initComplete=!0,$scope.iraSummary||load()},400)}]}}]),angular.module("directives").directive("sviMyFinancialAdvisor",["$templateCache","$timeout","labels","accountList","myFinancialAdvisor","eventDispatcher","piwik","$compile",function($templateCache,$timeout,labels,accountList,myFinancialAdvisor,eventDispatcher,piwik,$compile){return{replace:!1,scope:{account:"@",listener:"@",template:"@",eventAccount:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"listener","ACCOUNT.CONTEXT.CHANGED"),svi.ng.defaultString($scope,$attrs,"eventAccount","index"),svi.ng.defaultValidString($scope,$attrs,"template",["","Info"],"")}catch(e){throw"sviMyFinancialAdvisor: "+e}$scope.advisorInfo=null,labels.setupLabels($scope,["myFinancialAdvisor"]);var loadCallback=function(){return myFinancialAdvisor.getAdvisorInfo($scope.account)},onSuccess=function(data){piwik.trackPage("myFinancialAdvisor","My Financial Advisor",1e3*data._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.advisorInfo=data.myFinancialAdvisor.registeredRep},onError=function(reason){piwik.trackPage("myFinancialAdvisor/error","Error: My Financial Advisor",!1,[{name:"numAccounts",index:1,value:1}]);var loader=$scope.api.getLoader();loader&&(loader.clearAllMessages(),loader.setWarning($scope.labels.advisorUnavailable))};this.getLoader=svi.ng.getLoaderFactory($element,$scope,"loader"),this.load=function(){if(null!==$scope.account&&""!==$scope.account&&!1!==$scope.account){var loader=$scope.api.getLoader();loader?($scope.advisorInfo=null,loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)):$timeout($scope.api.load,200)}},$scope.api=this,$timeout(function(){!$scope.advisorInfo&&$scope.api&&$scope.api.load()},200),$scope.$watch("account",function(newVal,oldVal){newVal!=oldVal&&$scope.api.load()}),eventDispatcher.addSingleAccountListener($scope,$element)}],link:function($scope,$element,$attrs){$element.html($templateCache.get("myFinancialAdvisor/myFinancialAdvisor"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviAssetAllocation",["APP_CONFIG","$templateCache","assetallocation","assetOverview","highcharts","eventDispatcher","$filter","accountList","labels","$timeout","state","config","piwik","$compile",function(APP_CONFIG,$templateCache,assetallocation,assetOverview,highcharts,eventDispatcher,$filter,accountList,labels,$timeout,state,config,piwik,$compile){return{replace:!1,scope:{mode:"@",account:"@",accounts:"=?",chartType:"@",title:"@",donutInnerSize:"@",assetClassificationType:"@",assetClassificationEnabled:"@",assetClassificationFilterShow:"@",template:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"mode",["single","multi"],"multi"),svi.ng.defaultValidString($scope,$attrs,"chartType",["pie","donut"],"donut"),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"donutInnerSize","20%"),svi.ng.defaultString($scope,$attrs,"assetClassificationType",""),svi.ng.defaultFalse($scope,$attrs,"assetClassificationEnabled"),svi.ng.defaultFalse($scope,$attrs,"assetClassificationFilterShow"),svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),"multi"!==$scope.mode||$attrs.accounts?"single"===$scope.mode&&svi.ng.defaultString($scope,$attrs,"account",accountList.getCurrentAccountIndex()):$scope.accounts=[accountList.getCurrentAccountIndex()],config.getAssetClassification().then(function(response){200===response.status&&response.data.success&&($scope.assetClassificationConfig=response.data.assetClassificationConfig)}),$scope.assetClassificationType=state.get("assetOverview-assetClassificationType",null),$scope.$watch("assetClassificationType",function(val){state.set("assetOverview-assetClassificationType",val).save()})}catch(e){throw"sviAssetAllocation: "+e}$scope.id=php.uniqid("assetAllocation"),$scope.chart=null,$scope.assets=null,$scope.options=null,$scope.seriesData=null,$scope.mvData=null,$scope.setLoader=function(loader){$scope.loader=loader},labels.setupLabels($scope,["general","assetTypes","assetOverview"],{}),$scope.getLoadParameters=function(){var data={};return $scope.assetClassificationType&&(data.assetClassificationType=$scope.assetClassificationType),data},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return null!=$scope.chart&&$scope.chart.destroy(),$scope.chart=null,$scope.assets=null,data=$scope.getLoadParameters(),"single"===$scope.mode?(data.sortField=state.get("assetOverviewGrid-sortField","marketValue"),data.sortDir=state.get("assetOverviewGrid-sortDir","desc"),assetOverview.getAssetOverview($scope.account,data)):$scope.assetClassificationEnabled?assetallocation.getAssetAllocationsByClassification($scope.accounts,data):assetallocation.getAssetAllocations($scope.accounts,data)};$scope.getClassificationColor=function(asset){if(null!=$scope.assetClassificationColors)for(i=0;i<$scope.assetClassificationColors.length;i++)if($scope.assetClassificationColors[i].name===asset)return $scope.assetClassificationColors[i].color;return""};var onSuccess=function(response){var classificationTypeColors;(piwik.trackPage("assetAllocation","Asset Allocation Chart",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:"single"===$scope.mode?1:angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.assetClassificationEnabled)&&(response.hasOwnProperty("assetOverview")&&(classificationTypeColors=response.assetOverview.classificationTypeColors),response.hasOwnProperty("assetAllocation")&&(classificationTypeColors=response.assetAllocation.classificationTypeColors),$scope.assetClassificationType&&($scope.assetClassificationColors=classificationTypeColors[$scope.assetClassificationType.charAt(0).toLowerCase()+$scope.assetClassificationType.substr(1)]));var labelFilter=$filter("labels");$scope.getChartColor=$filter("assetTypeColor");var color,seriesData=[],mvData=[];if($scope.assets=[],$scope.assetTypes=[],"single"===$scope.mode){if(!(response.success&&response.hasOwnProperty("assetOverview")&&response.assetOverview.hasOwnProperty("assets")))return void $scope.loader.setError($scope.labels.chartRenderError);if(!response.assetOverview.assets.length)return void $scope.loader.setMessage($scope.labels.assetOverviewChartNoData);response=php.array_values(php.usort(response.assetOverview.assets,svi.array.sortFunctionFactory("marketValue",!0))),angular.forEach(response,function(assetType){var labelToDisplay=assetType.investmentTypeDisplay;color=$scope.assetClassificationEnabled?(labelToDisplay=assetType.assetClassificationDisplay,$scope.getClassificationColor(assetType.assetClassification)):$scope.getChartColor(assetType.investmentType),(0<assetType.marketValuePctTotal||0<assetType.marketValue)&&!assetType.isChild&&(seriesData.push({name:labelToDisplay,y:parseFloat(assetType.marketValuePctTotal),color:color,marketValue:assetType.marketValue}),mvData.push({name:labelToDisplay,y:assetType.marketValue,color:color}),$scope.assets.push({assetType:labelToDisplay,pctValue:assetType.marketValuePctTotal,marketValue:assetType.marketValue,legendColor:color}))})}else{if(!(response.success&&response.hasOwnProperty("assetAllocation")&&response.assetAllocation.hasOwnProperty("securityTypes")))return void $scope.loader.setError($scope.labels.chartRenderError);if(!response.assetAllocation.securityTypes.length)return void $scope.loader.setMessage($scope.labels.assetOverviewChartNoData);response=php.array_values(php.usort(response.assetAllocation.securityTypes,svi.array.sortFunctionFactory("marketValue",!0))),angular.forEach(response,function(assetType){var label,id,color,value;if(value=$scope.assetClassificationEnabled?(label=assetType.name,id=$scope.id+"-overview-table-"+assetType.name,color=$scope.getClassificationColor(assetType.name),assetType.marketValue):(label=labelFilter(assetType.securityType,$scope.labels),id=$scope.id+"-overview-table-"+assetType.securityType,color=$scope.getChartColor(assetType.securityType),assetType.value),0<assetType.percent||0<value){seriesData.push({name:label,id:id,y:parseFloat(assetType.percent),color:color,marketValue:value}),mvData.push({name:label,y:value,color:color}),$scope.assets.push({assetType:label,pctValue:assetType.percent,marketValue:value,legendColor:color});var assetTypeSecurities={name:label,id:id,pctValue:assetType.percent,marketValue:value,legendColor:color,securities:[]};if($scope.assetClassificationEnabled)angular.forEach(assetType.securities,function(security){assetTypeSecurities.securities.push({symbol:security.name,pctValue:security.percent,marketValue:security.marketValue})});else{var count=0,pctOther=0,marketValueOther=0;angular.forEach(assetType.securities,function(security){count<=4?assetTypeSecurities.securities.push({symbol:security.instrument.symbol,pctValue:security.percent,marketValue:security.value}):(pctOther+=parseFloat(security.percent),marketValueOther+=parseFloat(security.value)),count++}),(0<pctOther||0<marketValueOther)&&assetTypeSecurities.securities.push({symbol:"Other",pctValue:pctOther,marketValue:marketValueOther})}$scope.assetTypes.push(assetTypeSecurities)}})}$scope.seriesData=seriesData,$scope.mvData=mvData,createChart()},createChart=function(){if(!$scope.options)return $timeout(createChart,200);null!=$scope.chart?highcharts.replaceSeries($scope.chart,[$scope.seriesData,$scope.mvData]):($scope.options.chart.renderTo=$element.find(".chart")[0],$scope.options.chart.height=$element.find(".chart").width()||300,$scope.options.series[0].data=$scope.seriesData,$scope.options.series[1].data=$scope.mvData,$scope.chart=highcharts.getChart($scope.options)),$scope.currentPoint=null},onError=function(){$scope.loader.setError($scope.labels.chartRenderError),piwik.trackPage("assetAllocation/error","Error: Asset Allocation Chart",!1,[{name:"numAccounts",index:1,value:"single"===$scope.mode?1:angular.isArray($scope.accounts)?$scope.accounts.length:1}])};$scope.toggleTables=function(point){0<$scope.assetTypes.length&&($scope.currentPoint=$scope.currentPoint?$scope.currentPoint:null,null!==$scope.currentPoint&&point.id===$scope.currentPoint.id?$scope.currentPoint=null:$scope.currentPoint=point)},eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){if("single"===$scope.mode){if($scope.account===data.currentAccount)return;$scope.account=data.currentAccount,$scope.load()}else $scope.accounts=data.currentAccount,0<$scope.accounts.length&&$scope.load()},!0,$element),eventDispatcher.on("ASSET_OVERVIEW.BY_ASSET_CLASSIFICATION.FILTER.CHANGED",function(e,data){var value=angular.isObject(data)&&data.hasOwnProperty("value")?data.value:data;value&&$scope.assetClassificationType!==value&&($scope.assetClassificationType=value,$scope.pageSize&&($scope.currentPage=1),$scope.load())},!0,$element);var currencyFilter=$filter("sviCurrency");$scope.options={chart:{type:"pie",renderTo:$element.find(".chart")[0],height:$element.find(".chart").width()||300},accessibility:{description:"Pie chart displaying asset allocation by asset type.",landmarkVerbosity:"disabled",keyboardNavigation:{order:["chartMenu","series"]},point:{valueDescriptionFormat:"{index}. {xDescription}{separator}{point.percentage:.2f}%."}},exporting:{csv:{columnHeaderFormatter:function(item){return item&&item.hasOwnProperty("name")?item.name:"Asset Type"}}},credits:{enabled:!1},title:{text:""},tooltip:{pointFormatter:function(){return"<b>"+currencyFilter(this.marketValue)+"</b>"}},plotOptions:{pie:{center:["50%","50%"],allowPointSelect:!1,cursor:"pointer",point:{events:{click:function(event){$scope.toggleTables(event.point),$scope.$applyAsync()}}}}},series:[{name:"Asset Percentage",zIndex:1,size:"95%",innerSize:"donut"===$scope.chartType?$scope.donutInnerSize:"0%",dataLabels:{formatter:function(){return 2.5<=this.y?Math.round(this.y)+"%":""},style:{textOutline:!1}},data:[]},{name:"Market Value",zIndex:0,size:"95%",innerSize:"donut"===$scope.chartType?$scope.donutInnerSize:"0%",dataLabels:{formatter:function(){return""}},label:{enabled:!1},accessibility:{keyboardNavigation:{enabled:!1}},data:[]}]}}],link:function($scope,$element){var template=$templateCache.get("assetAllocation/assetAllocation"+$scope.template+".tpl.html");$element.html(template).show(),$compile($element.contents())($scope),$timeout(function(){$scope.load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviAssetAllocationBalances",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","highcharts","accountList","labels","$filter","balances","piwik","bsBreakpoint",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,highcharts,accountList,labels,$filter,balances,piwik,bsBreakpoint){return{replace:!1,scope:{useParentData:"@",chartType:"@",accountType:"@",isIRA:"@",isMargin:"@",longOrShort:"@"},template:$templateCache.get("assetAllocationBalances/assetAllocationBalances.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"chartType","donut"),$scope.options={},$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.loaded=!1,svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultString($scope,$attrs,"accountType","cash"),svi.ng.defaultFalse($scope,$attrs,"isIRA"),svi.ng.defaultString($scope,$attrs,"longOrShort",""),svi.ng.defaultFalse($scope,$attrs,"isMargin"),$scope.show=!0,$scope.id=php.uniqid("assetAllocationBalances"),$scope.chart=null,$scope.seriesData=[],labels.setupLabels($scope,["general","assetTypes","assetAllocationBalances"],{}),$scope.getChartColor=$filter("assetTypeColor"),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loaded=!1,$scope.title="",$scope.balance=null,$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return $($element).find(".chart")[0]&&$($($element).find(".chart")[0]).html(""),!0===$scope.useParentData||"true"===$scope.useParentData?$scope.$parent.loadCallback():balances.getBalances($scope.accounts[0])},processSeriesData=function(){var seriesData=[],securities=$scope.balance.accountBalance.securities,stock=securities.stocks,option=securities.options,mutualFunds=securities.mutualFunds,fixedIncome=securities.fixedIncome,other=(securities.cashMV,securities.other),longOptions=securities.longOptions,longStocks=securities.longStocks,shortOptions=securities.shortOptions,shortStocks=securities.shortStocks,heldAway=securities.heldAway,total=securities.total,getPct=function(assetTypeAmount,totalAmount){return 0===assetTypeAmount?0:(totalAmount||(totalAmount=total),Math.abs(assetTypeAmount/totalAmount*100))};if(""===$scope.longOrShort)0<stock&&seriesData.push({id:"Stock",name:$scope.labels.Stock,color:$scope.getChartColor("stock"),value:stock,y:stock,visible:2.5<getPct(stock)}),0<option&&seriesData.push({id:"Options",name:$scope.labels.Option,color:$scope.getChartColor("option"),value:option,y:option,visible:2.5<getPct(option)}),0<mutualFunds&&seriesData.push({id:"Mutual Funds",name:$scope.labels.MutualFund,color:$scope.getChartColor("mutualFund"),value:mutualFunds,y:mutualFunds,visible:2.5<getPct(mutualFunds)}),0<fixedIncome&&seriesData.push({id:"Fixed Income",name:$scope.labels.FixedIncome,color:$scope.getChartColor("fixedIncome"),value:fixedIncome,y:fixedIncome,visible:2.5<getPct(fixedIncome)}),0<heldAway&&seriesData.push({id:"heldAwayAssets",name:$scope.labels.HeldAwayAssets,color:$scope.getChartColor("heldAwayAssets"),value:heldAway,y:heldAway}),0<other&&seriesData.push({id:"Other",name:$scope.labels.Other,color:$scope.getChartColor("other"),value:other,y:other,visible:2.5<getPct(other)}),$scope.title=labels.cache.assetAllocationBalances.totalSecurities+" "+$filter("currency")(total),$scope.show=!0;else if($scope.isMargin&&"long"===$scope.longOrShort){var longTotal=longOptions+longStocks;0<longStocks&&seriesData.push({name:$scope.labels.Stock,color:$scope.getChartColor("stock"),value:longStocks,y:longStocks,visible:2.5<getPct(longStocks,longTotal)}),0<longOptions&&seriesData.push({name:$scope.labels.Option,color:$scope.getChartColor("option"),value:longOptions,y:longOptions,visible:2.5<getPct(longOptions,longTotal)}),$scope.title=labels.cache.assetAllocationBalances.totalLong+" "+$filter("currency")(longTotal),$scope.show=0<seriesData.length}else if($scope.isMargin&&"short"===$scope.longOrShort){var shortTotal=shortOptions+shortStocks;0<Math.abs(parseFloat(shortStocks))&&seriesData.push({name:$scope.labels.Stock,color:$scope.getChartColor("stock"),value:shortStocks,y:Math.abs(parseFloat(shortStocks)),visible:2.5<getPct(shortStocks,shortTotal)}),0<Math.abs(parseFloat(shortOptions))&&seriesData.push({name:$scope.labels.Option,color:$scope.getChartColor("option"),value:shortOptions,y:Math.abs(parseFloat(shortOptions)),visible:2.5<getPct(shortOptions,shortTotal)}),$scope.title=labels.cache.assetAllocationBalances.totalShort+" "+$filter("currency")(shortTotal),$scope.show=0<seriesData.length}else $scope.show=!1;$scope.seriesData=seriesData,$timeout(function(){null!=$scope.chart&&$scope.chart.destroy(),$scope.options.series[0].data=seriesData,$scope.chart=highcharts.getChart($scope.options)},100)},onSuccess=function(response){piwik.trackPage("assetAllocationBalances","Asset Allocation Chart (from Balance Data)",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.balances.accountBalances.length?($scope.loaded=!0,$scope.balance=response.balances.accountBalances[0],processSeriesData()):$scope.loader.setError($scope.labels.dataRenderError)},onError=function(response){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("assetAllocationBalances/error","Error: Asset Allocation Chart (from Balance Data)",!1,[{name:"numAccounts",index:1,value:1}])};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&$scope.load()}),eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(e,data){data.hasOwnProperty("single")&&angular.isObject(data.single)&&$scope.$watch("loaded",function(){!0===$scope.loaded&&(data.single.hasOwnProperty("accountType")&&($scope.accountType=data.single.accountType,$scope.isMargin="margin"===$scope.accountType),data.single.hasOwnProperty("isIRA")&&($scope.isIRA=data.single.isIRA),processSeriesData())})})}],link:function($scope,$element,$attrs){var currencyFilter=$filter("sviCurrency"),pctFilter=$filter("percent");($scope.options={chart:{type:"pie",renderTo:$($element).find(".chart")[0],reflow:!0,height:250},accessibility:{description:"Pie chart displaying asset allocation.",landmarkVerbosity:"disabled"},credits:{enabled:!1},title:{text:""},legend:{align:"right",verticalAlign:"top",layout:"vertical",enabled:!0,floating:!0,borderRadius:"5",borderWidth:"1",symbolRadius:"5",useHTML:!0,labelFormatter:function(){return this.name+"<br/>"+currencyFilter(this.value)}},tooltip:{pointFormatter:function(){return"<b>"+currencyFilter(this.value)+"</b>"}},plotOptions:{pie:{center:["25%","50%"],allowPointSelect:!0,showInLegend:!0,cursor:"pointer",dataLabels:{formatter:function(){return pctFilter(this.percentage)}}}},series:[{name:"Assets",innerSize:"donut"===$scope.chartType?"25%":"0%",data:[]}]},bsBreakpoint)&&(bsBreakpoint.getBreakpoint()==bsBreakpoint.XS&&($scope.options.plotOptions.pie.center=["50%","50%"],$scope.options.legend.align="center",$scope.options.legend.floating=!1,$scope.options.legend.verticalAlign="bottom",$scope.options.legend.y=-40,$scope.options.chart.height=380));$timeout(function(){$scope.load()},300)}}}]),angular.module("directives").directive("sviAssetAllocationByAccount",["$filter","$templateCache","assetallocation","highcharts","APP_CONFIG",function($filter,$templateCache,assetallocation,highcharts,APP_CONFIG){return{replace:!1,scope:{title:"@"},template:$templateCache.get("assetAllocationByAccount/assetAllocationByAccount.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"title","Asset Allocation by Account")}],link:function($scope,$element,$attrs){var options={chart:{renderTo:$($element).find(".chart")[0],type:"bar",marginTop:50,marginLeft:70},accessibility:{description:"Bar chart displaying asset allocation."},title:{text:""},credits:{enabled:!1},xAxis:{categories:["12345678","24681359","87654321"],reversed:!0,labels:{formatter:function(){var accountNickname=this.accountNickname?"<br>"+$filter("ellipsis")(this.accountNickname,10):"";return this.value+accountNickname}}},yAxis:{min:0,max:100,maxPadding:0,title:{text:""},labels:{format:"{value}%"}},legend:{backgroundColor:"#FFFFFF",verticalAlign:"top",reversed:!0,align:"left",borderWidth:0},tooltip:{formatter:function(){return this.series.name+": "+this.y+"%"}},plotOptions:{series:{stacking:"percent",pointWidth:35,pointPadding:.1},bar:{dataLabels:{enabled:!0,color:"#ffffff",inside:!0,formatter:function(){return 2.5<=this.y?this.y+"%":""}}}},series:[{name:"Other",data:[0],color:APP_CONFIG.chartColors.assetTypes.other},{name:"Fixed Income",data:[0],color:APP_CONFIG.chartColors.assetTypes.fixedIncome},{name:"Mutual Fund",data:[0],color:APP_CONFIG.chartColors.assetTypes.fund},{name:"Equity",data:[0],color:APP_CONFIG.chartColors.assetTypes.equity},{name:"Option",data:[0],color:APP_CONFIG.chartColors.assetTypes.option}]};$scope.showSpinner=!0,assetallocation.getAssetAllocationByAccounts([0,1]).success(function(data,status,headers,config){if(($scope.showSpinner=!1)!==data.status){var chart=highcharts.getChart(options);chart.series[0].setData([10,20,30]),chart.series[1].setData([10,40,30]),chart.series[2].setData([40,20,30]),chart.series[3].setData([5,15,5]),chart.series[4].setData([25,5,5])}else $scope.message="Unable to display chart"}).error(function(data,status,headers,config){})}}}]),angular.module("directives").directive("sviAssetOverviewGrid",["$templateRequest","$compile","APP_CONFIG","$timeout","state","assetOverview","accountList","eventDispatcher","labels","expander","config","piwik",function($templateRequest,$compile,APP_CONFIG,$timeout,state,assetOverview,accountList,eventDispatcher,labels,expander,config,piwik){return{replace:!1,scope:{account:"@",columns:"@",columnPriority:"@",responsiveColumns:"@",assetClassificationType:"@",assetClassificationEnabled:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["investmentType", "assetClassification", "account", "marketValue", "marketValuePctTotal", "purchaseCost", "rtUnrealizedGainLoss", "realizedGainLoss"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["investmentType","assetClassification","marketValue","marketValuePctTotal","unrealizedGainLoss","rtUnrealizedGainLoss","account","realizedGainLoss","marketValueNegPctTotal","purchaseCost","marginEnabled"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.parseJSON($scope,$attrs,"columns"),svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){throw"sviAssetOverviewGrid: "+e}$scope.assetClassificationType=state.get("assetOverview-assetClassificationType"),$scope.$watch("assetClassificationType",function(val){state.set("assetOverview-assetClassificationType",val).save()}),APP_CONFIG.accountClasses&&($scope.accountClasses=APP_CONFIG.accountClasses),$scope.sortDir=state.get("assetOverviewGrid-sortDir","desc"),$scope.sortField=state.get("assetOverviewGrid-sortField","marketValue"),$scope.initComplete=!1,$scope.assetOverview=!1,labels.setupLabels($scope,["general","assetTypes","assetOverview"],{}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.getLoadParameters=function(){var data={sortField:$scope.sortField,sortDir:$scope.sortDir};return $scope.assetClassificationType&&(data.assetClassificationType=$scope.assetClassificationType),data};var load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}},loadCallback=function(invalidateCache){$("html,body").animate({scrollTop:0},0);var data=$scope.getLoadParameters();return assetOverview.getAssetOverview($scope.account,data,invalidateCache)},onSuccess=function(response){piwik.trackPage("assetOverviewGrid","Asset Overview Grid",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]);try{if($scope.assetOverview=response.assetOverview,!$scope.assetOverview.assets.length)throw"no data"}catch(e){$scope.loader.setMessage($scope.labels.noAssetOverviewData)}},onError=function(reason){piwik.trackPage("assetOverviewGrid/error","Error: Asset Overview Grid",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}])},init=function(){$scope.loader?($scope.initComplete=!0,$scope.assetOverview||load()):$timeout(init,200)};$timeout(init,400),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.isMultiAccount=angular.isArray($scope.account)&&1<$scope.account.length,$scope.assetOverview=!1,load())},!0),eventDispatcher.on("ASSET_OVERVIEW.BY_ASSET_CLASSIFICATION.FILTER.CHANGED",function(e,data){var value=angular.isObject(data)&&data.hasOwnProperty("value")?data.value:data;$scope.assetClassificationType!=value&&($scope.assetClassificationType=value,$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("ASSET_OVERVIEW.REFRESH",function(){load(!0)}),eventDispatcher.on("ASSET_OVERVIEW.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,state.set("assetOverviewGrid-sortField",$scope.sortField),state.set("assetOverviewGrid-sortDir",$scope.sortDir),load())},!0),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{expander:!1,unrealizedGainLoss:"currencyChange",rtUnrealizedGainLoss:"currencyChange",realizedGainLoss:"currencyChange"}},expander.init($scope,"ASSETOVERVIEWGRID"),$scope.$watch("assetOverview",function(){expander.reset($scope)})}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("assetAllocation/assetOverviewGrid/assetOverviewGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviAccountBalance",["$templateCache","$compile","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","balances","sviUrl","piwik",function($templateCache,$compile,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,balances,sviUrl,piwik){return{replace:!1,scope:{template:"@",useParentData:"@",useTradingBalances:"@",showCashAndMmf:"@",showAccountValue:"@",showBankDepositProgram:"@",showCashMmf:"@",showCashEquiv:"@",showSecurities:"@",showStockBuyingPower:"@",showOptionBuyingPower:"@",showHeldAway:"@",hasHeldAway:"@",showDetailsLink:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.balance=null,svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultFalse($scope,$attrs,"useTradingBalances"),svi.ng.defaultTrue($scope,$attrs,"showCashAndMmf"),svi.ng.defaultTrue($scope,$attrs,"showAccountValue"),svi.ng.defaultFalse($scope,$attrs,"showBankDepositProgram"),svi.ng.defaultTrue($scope,$attrs,"showCashMmf"),svi.ng.defaultFalse($scope,$attrs,"showCashEquiv"),svi.ng.defaultFalse($scope,$attrs,"showSecurities"),svi.ng.defaultTrue($scope,$attrs,"showStockBuyingPower"),svi.ng.defaultTrue($scope,$attrs,"showOptionBuyingPower"),svi.ng.defaultFalse($scope,$attrs,"showHeldAway"),svi.ng.defaultFalse($scope,$attrs,"hasHeldAway"),svi.ng.defaultTrue($scope,$attrs,"showDetailsLink")}catch(e){throw"sviAccountBalance: "+e}labels.setupLabels($scope,["general","accountBalance"],{accountBalanceTitle:"Account Balances",cash:"Cash",mmf:"Money Market Fund",optionReq:"Option Requirement",totalSecurities:"Securities",bankDepositProgram:"Bank Deposit Program"}),this.getLoader=svi.ng.getLoaderFactory($element,$scope,"loader"),$scope.load=function(){if(!$scope.api.getLoader())return $timeout($scope.load,200);$scope.api.getLoader().setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return $scope.useParentData?$scope.$parent.loadCallback():$scope.useTradingBalances?balances.getTradingBalances($scope.accounts[0]):balances.getBalances($scope.accounts[0])},onSuccess=function(response){if(piwik.trackPage("accountBalance","Account Balance",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.useTradingBalances){if(!response.tradingBalances.tradingBalance.length)return void $scope.api.getLoader().setError($scope.labels.dataRenderError);$scope.balance=response.tradingBalances.tradingBalance[0]}else{if(!response.balances.accountBalances.length)return void $scope.api.getLoader().setError($scope.labels.dataRenderError);$scope.balance=response.balances.accountBalances[0]}},onError=function(response){$scope.api.getLoader().setError($scope.labels.dataRenderError),piwik.trackPage("accountBalance/error","Error: Account Balance",!1,[{name:"numAccounts",index:1,value:1}])};this.more=function(){sviUrl.href(["accountBalances",{action:"balances"}])},$scope.api=this,$timeout(function(){angular.isFunction($scope.load)&&$scope.load()},300),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&angular.isFunction($scope.load)&&($scope.balance=null,$scope.load())}),eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(e,data){angular.isObject(data)&&data.hasOwnProperty("single")&&angular.isObject(data.single)&&data.single.hasOwnProperty("hasHeldAwayAssets")&&($scope.hasHeldAway=data.single.hasHeldAwayAssets)})}],link:function($scope,$element,$attrs){$element.html($templateCache.get("accountBalance/accountBalance"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviAccountBalanceValue",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","balances","bsBreakpoint","piwik",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,balances,bsBreakpoint,piwik){return{replace:!1,scope:{useParentData:"@",marginEnabled:"@",activitiesUrl:"@"},template:$templateCache.get("accountBalanceValue/accountBalanceValue.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.loaded=!1,svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultFalse($scope,$attrs,"marginEnabled"),svi.ng.defaultString($scope,$attrs,"activitiesUrl",""),labels.setupLabels($scope,["general","accountBalanceValue"],{totalAccountValue:"Total Account Value",marginDebit:"Margin Debit"}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return!0===$scope.useParentData||"true"===$scope.useParentData?$scope.$parent.loadCallback():balances.getBalances($scope.accounts[0])},onSuccess=function(response){piwik.trackPage("accountBalanceValue","Account Balance Value",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.balances.accountBalances.length?($scope.loaded=!0,$scope.balance=response.balances.accountBalances[0],$scope.marginEnabled=!!response.isMarginAccount):$scope.loader.setError($scope.labels.dataRenderError)},onError=function(response){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("accountBalanceValue/error","Error: Account Balance Value",!1,[{name:"numAccounts",index:1,value:1}])};$timeout(function(){$scope.load()},300),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&($scope.loaded=!1,$scope.load())}),eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(e,data){data.hasOwnProperty("single")&&angular.isObject(data.single)&&data.single.hasOwnProperty("marginEnabled")&&($scope.marginEnabled=data.single.marginEnabled)})}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviBalanceListContainer",["$templateCache","$timeout","$log","balances","accountList","eventDispatcher","state","labels","$compile","navigation","piwik",function($templateCache,$timeout,$log,balances,accountList,eventDispatcher,state,labels,$compile,navigation,piwik){return{replace:!1,scope:{template:"@",columns:"@",customClasses:"@",sortable:"@",forceAllAccounts:"@",accountUrl:"@",ownedAccount:"@",ownedDisclaimer:"@",ownedTooltip:"@",ownedTotalsTooltip:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultString($scope,$attrs,"columns",'["account","accountNickname","accountValue"]'),svi.ng.defaultString($scope,$attrs,"customClasses","{}"),svi.ng.defaultTrue($scope,$attrs,"sortable"),svi.ng.defaultTrue($scope,$attrs,"forceAllAccounts"),svi.ng.parseJSON($scope,$attrs,"accountUrl"),svi.ng.defaultFalse($scope,$attrs,"ownedAccount"),svi.ng.defaultString($scope,$attrs,"ownedDisclaimer",""),svi.ng.defaultString($scope,$attrs,"ownedTooltip",""),svi.ng.defaultString($scope,$attrs,"ownedTotalsTooltip","")}catch(e){throw"sviBalanceListContainer: "+e}$scope.accounts=[accountList.getCurrentAccountIndex()],$scope.refocus=null,labels.setupLabels($scope,["balanceList"],{}),$scope.sortDir=state.get("balanceList-sortDir","asc"),$scope.sortField=state.get("balanceList-sortField","accountBalance.account"),$scope.$watch("sortField",function(val){state.set("balanceList-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("balanceList-sortDir",val).save()}),$scope.initComplete=!1,$scope.balances=!1;try{$attrs.columns=JSON.parse($attrs.columns)}catch(e){$log.error("sviBalanceListContainer: Error parsing columns",e,$attrs.columns),$attrs.columns=[]}$scope.columns=$attrs.columns;try{$attrs.customClasses=JSON.parse($attrs.customClasses)}catch(e){$log.error("sviBalanceListContainer: Error parsing custom classes",e,$attrs.customClasses),$attrs.customClasses={}}$scope.customClasses=$attrs.customClasses,$scope.getLoadParameters=function(){var data={sortField:$scope.sortField,sortDir:$scope.sortDir};return $scope.forceAllAccounts&&(data.switchAccounts="N"),data},this.getLoader=svi.ng.getLoaderFactory($element,$scope,"loader"),this.load=function(invalidateCache){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError):$timeout($scope.api.load,200)};var loadCallback=function(invalidateCache){angular.isUndefined(invalidateCache)&&(invalidateCache=!1),$scope.balances=!1;var data=$scope.getLoadParameters();return balances.getBalances($scope.forceAllAccounts?"all":$scope.accounts,data,invalidateCache)},onSuccess=function(response){piwik.trackPage("balanceListContainer","Account Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:$scope.forceAllAccounts?"all":angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.balances=response.balances,angular.isArray($scope.balances.accountBalances)&&$scope.balances.accountBalances.length?$timeout(function(){svi.ui.pulse(".svi-balance-list-grid-grid, .svi-balance-list-grid-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)}):$scope.api.getLoader().setMessage($scope.labels.noBalancesData)},onError=function(reason){$scope.api.getLoader().setMessage($scope.labels.noBalancesData),piwik.trackPage("balanceListContainer/error","Error: Account Summary",!1,[{name:"numAccounts",index:1,value:$scope.forceAllAccounts?"all":angular.isArray($scope.accounts)?$scope.accounts.length:1}])};$scope.$watch("accountUrl",function(){angular.isObject($scope.accountUrl)&&navigation.getLaminasUrl($scope.accountUrl).then(function(response){response.data.success?$scope.accountUrl=svi.url.getHost()+response.data.url:$scope.accountUrl=""})}),$scope.api=this,$timeout(function(){$scope.initComplete=!0,!$scope.balances&&$scope.api&&$scope.api.load()},200),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,$scope.balances=!1,0<$scope.accounts.length&&$scope.api&&$scope.api.load()}),eventDispatcher.on("BALANCE_LIST.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.refocus='.svi-column-header[data-event="BALANCE_LIST.'+data.field+'"]',$scope.api&&$scope.api.load(!0))},!0)}],link:function($scope,$element,$attrs){$element.html($templateCache.get("balanceListContainer/balanceListContainer"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviBalanceListGrid",["$templateRequest","$compile","$filter","labels",function($templateRequest,$compile,$filter,labels){return{replace:!1,scope:{columns:"=",customClasses:"=",balances:"=",sortField:"=?",sortDir:"=?",sortable:"=",accountUrl:"=",ownedAccount:"=",ownedDisclaimer:"=",ownedTooltip:"=?",ownedTotalsTooltip:"=?"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.priorityColumns=["account","accountValue","accountNickname"],labels.setupLabels($scope,["balanceList"],{}),$scope.responsiveColumnsSettings={enabled:!0,priority:$scope.priorityColumns},$scope.accountClasses="",$scope.customClasses&&$scope.customClasses.account&&($scope.accountClasses=$scope.customClasses.account.toString().replace(/\,/g," ")),$scope.$watchGroup(["balances.accountBalances","accountUrl"],function(){if($scope.accountUrls=[],angular.isString($scope.accountUrl)&&$scope.balances&&$scope.balances.hasOwnProperty("accountBalances"))for(var index=0,i=0,l=$scope.balances.accountBalances.length;i<l;i++)index=$scope.balances.accountBalances[i].accountBalance.accountIndex,$scope.accountUrls[index]=$scope.accountUrl.replace("*ACCOUNT_INDEX*",index)})}],link:function($scope,$element,$attrs){var config={columns:$scope.columns,customClasses:$scope.customClasses};$templateRequest("balances/balanceListGrid/balanceListGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviBuyingPower",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","balances","piwik",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,balances,piwik){return{replace:!1,scope:{useParentData:"@",marginEnabled:"@",optionTradeEnabled:"@",optionLevel:"@",showOptionBuyingPower:"@",dayTraderSettings:"@",checkMarginAccount:"@"},template:$templateCache.get("buyingPower/buyingPower.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.loaded=!1,svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultFalse($scope,$attrs,"marginEnabled"),svi.ng.defaultFalse($scope,$attrs,"optionTradeEnabled"),svi.ng.defaultTrue($scope,$attrs,"showOptionBuyingPower"),svi.ng.defaultString($scope,$attrs,"optionLevel",null),svi.ng.defaultString($scope,$attrs,"dayTraderSettings",null),svi.ng.defaultFalse($scope,$attrs,"checkMarginAccount");try{svi.ng.parseJSON($scope,$attrs,"dayTraderSettings")}catch(e){$log.warn("sviBuyingPower: Error parsing dayTraderSettings: ",e,$attrs.dayTraderSettings),$scope.dayTraderSettings=$attrs.dayTraderSettings=null}$scope.getOptionLevel=function(optionLevel){var ol;switch(optionLevel){case 0:case"0":case"":case null:ol=null;break;default:ol=optionLevel}return ol},$scope.optionLevelValue=$scope.getOptionLevel($scope.optionLevel),labels.setupLabels($scope,["general","buyingPower"],{}),$scope.showStockBuyingPower=!0,$scope.showOptiontradinglevel=!0,$scope.showNonMarginBuyingPower=$scope.showOptionBuyingPower,$scope.showOldDayTrading=!0,$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return!0===$scope.useParentData||"true"===$scope.useParentData?$scope.$parent.loadCallback():balances.getBalances($scope.accounts[0])},onSuccess=function(response){piwik.trackPage("buyingPower","Buying Power",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.balances.accountBalances.length?($scope.loaded=!0,$scope.balance=response.balances.accountBalances[0],$scope.checkMarginAccount&&($scope.marginEnabled=!!response.isMarginAccount),updateMarginFields(response.isMarginAccount,$scope.balance)):$scope.loader.setError($scope.labels.dataRenderError)},updateMarginFields=function(marginEnabled,balance){$scope.checkMarginAccount&&($scope.showNonMarginBuyingPower=$scope.showOptionBuyingPower&&marginEnabled,$scope.showOptiontradinglevel=$scope.optionTradeEnabled,$scope.showStockBuyingPower=marginEnabled),$scope.showPatternDayTrader=!1,$scope.showOldDayTrading=!$scope.dayTraderSettings,$scope.showDayTrading=!1,$scope.dayTraderSettings&&marginEnabled&&($scope.showPatternDayTrader=$scope.dayTraderSettings.patternDayTraderStatus?$scope.dayTraderSettings.patternDayTraderStatus.includes(balance.accountBalance.buyingPower.patternDaytrader):null,$scope.showDayTrading=$scope.dayTraderSettings.dayTrading?$scope.dayTraderSettings.dayTrading.includes(balance.accountBalance.buyingPower.patternDaytrader):null)},onError=function(response){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("buyingPower/error","Error: Buying Power",!1,[{name:"numAccounts",index:1,value:1}])};$timeout(function(){$scope.load()},300),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&($scope.loaded=!1,$scope.load())}),eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(e,data){data.hasOwnProperty("single")&&angular.isObject(data.single)&&(data.single.hasOwnProperty("optionLevel")&&($scope.optionLevel=data.single.optionLevel,$scope.optionLevelValue=$scope.getOptionLevel(data.single.optionLevel)),data.single.hasOwnProperty("marginEnabled")&&($scope.marginEnabled=data.single.marginEnabled))})}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviCashFlowContainer",["$templateCache","$timeout","$log","cashFlow","accountList","eventDispatcher","labels","piwik",function($templateCache,$timeout,$log,cashFlow,accountList,eventDispatcher,labels,piwik){return{replace:!1,scope:{account:"@",columns:"@",columnPriority:"@",responsiveColumns:"@"},template:$templateCache.get("cashFlowContainer/cashFlowContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["year","month","moneyMarketFund","interest","dividend","maturities","total"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["year","month","total","moneyMarketFund","interest","dividend","maturities"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns")}catch(e){throw"sviCashFlowContainer: "+e}$scope.refocus=null,labels.setupLabels($scope,["cashFlow"],{}),$scope.initComplete=!1,$scope.cashFlow=!1;try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.warn("sviCashFlowContainer: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviCashFlowContainer: Error parsing columnPriority: ",e,$attrs.columnPriority)}$scope.setLoader=function(loader){$scope.loader=loader}}],link:function($scope,$element,$attrs){var load=function(){if($scope.initComplete)return $scope.loader?void $scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout(load,200)},loadCallback=function(invalidateCache){return $("html,body").animate({scrollTop:0},0),cashFlow.getCashFlow($scope.account,invalidateCache)},onSuccess=function(response){piwik.trackPage("cashFlowContainer","Cash Flow Container",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}]),$scope.cashFlow=response.cashFlow,response.cashFlow.cashFlowItems.length?$timeout(function(){svi.ui.pulse(".cash-flow-grid, .cash-flow-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)}):$scope.loader.setMessage($scope.labels.noCashFlowData)},onError=function(reason){piwik.trackPage("cashFlowContainer/error","Error: Cash Flow Container",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}])};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.cashFlow=!1,load())},!0),eventDispatcher.on("CASHFLOW.REFRESH",function(){load()}),$timeout(function(){$scope.initComplete=!0,$scope.cashFlow||load()},100)}}}]),angular.module("directives").directive("sviCashFlowGrid",["$templateRequest","$compile","labels","config","$sce","bsBreakpoint",function($templateRequest,$compile,labels,config,$sce,bsBreakpoint){return{replace:!1,scope:{title:"@",columns:"=",columnPriority:"=",responsiveColumns:"@",cashFlow:"="},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns")}catch(e){throw"sviCashFlowGrid: "+e}$scope.id=php.uniqid("CAHSFLOWGRID"),labels.setupLabels($scope,["cashFlow"],{}),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority}}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("balances/cashFlowGrid/cashFlowGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviIncomeExpenseSummary",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","balances","piwik",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,balances,piwik){return{replace:!1,scope:{ytdOnly:"@"},template:$templateCache.get("incomeExpenseSummary/incomeExpenseSummary.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultFalse($scope,$attrs,"ytdOnly"),$scope.account=accountList.getCurrentAccountIndex(),labels.setupLabels($scope,["incomeExpenseSummary"],{}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){angular.isObject(data)&&data.hasOwnProperty("index")&&$scope.account!=data.index&&($scope.account=data.index,$scope.load())}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return $scope.summary=null,balances.getIncomeExpense($scope.account)},onSuccess=function(response){piwik.trackPage("incomeExpenseSummary","Income Expense Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.summary=response.incomeExpenseSummary,$scope.summary.status.success&&null==$scope.summary.income&&null==$scope.summary.exemptIncome&&null==$scope.summary.expense&&($scope.loader.setMessage($scope.labels.incomeExpenseSummaryNoData),$scope.summary=null)},onError=function(response){piwik.trackPage("incomeExpenseSummary/error","Error: Income Expense Summary",!1,[{name:"numAccounts",index:1,value:1}])};$timeout(function(){$scope.load()},200)}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviIncomeInformation",["$templateCache","$timeout","assetOverview","accountList","eventDispatcher","labels","$filter","piwik",function($templateCache,$timeout,assetOverview,accountList,eventDispatcher,labels,$filter,piwik){return{replace:!1,scope:{account:"@",config:"@",multiAccountEnabled:"@"},template:$templateCache.get("incomeInformation/incomeInformation.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"config","{}"),svi.ng.parseJSON($scope,$attrs,"config"),svi.ng.defaultFalse($scope,$attrs,"multiAccountEnabled")}catch(e){throw"sviIncomeInformation: "+e}$scope.initComplete=!1,$scope.incomeMargin=!1,labels.setupLabels($scope,["incomeInformation"],{}),$scope.incomeItems=[{clazz:"currency",propertyName:"estAnnualIncome"},{clazz:"number",propertyName:"currentYield"}],$scope.setLoader=function(loader){$scope.loader=loader};var load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout(load,200);$scope.multiAccountEnabled||!$scope.isMultiAccount?$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError):$scope.incomeMargin=!1}},loadCallback=function(invalidateCache){return $("html,body").animate({scrollTop:0},0),assetOverview.getIncomeMargin($scope.account,!1,invalidateCache)},formatters={estAnnualIncome:$filter("sviCurrency"),currentYield:$filter("percent")};$scope.formatValue=function(item,propertyName){return item?formatters[propertyName](item[propertyName]):""};var onSuccess=function(response){piwik.trackPage("incomeInformation","Income Information",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}]);try{$scope.incomeMargin=response.incomeMargin.total,$scope.accountData=response.incomeMargin.accountData,Array.isArray($scope.accountData)||($scope.accountData=[])}catch(e){$scope.loader.setMessage($scope.labels.incomeInformationNoData)}},onError=function(reason){piwik.trackPage("incomeInformation/error","Error: Income Information",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}])};eventDispatcher.on("EXPANDER.INCOMEINFOGRID",function(e,data){$scope.incomeItems[parseInt(data.target)].expanded=data.show}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.isMultiAccount=angular.isArray($scope.account)&&1<$scope.account.length,$scope.incomeMargin=null,load())},!0);var init=function(){$scope.loader?($scope.initComplete=!0,$scope.incomeMargin||load()):$timeout(init,200)};$timeout(init,400)}]}}]),angular.module("directives").directive("sviCdContainer",["$templateCache","$log","$timeout","$filter","cd","eventDispatcher","state","labels","tags","piwik",function($templateCache,$log,$timeout,$filter,cd,eventDispatcher,state,labels,tags,piwik){var dateFilter=$filter("date"),normalizeDate=function(dateString){if(!dateString)return"";var date;if(angular.isDate(dateString)||angular.isNumber(dateString))date=dateString;else{if(!angular.isString(dateString))return"";if(!1===(date=php.strtotime(dateString.replace(/-/g,"/"))))return"";date*=1e3}return dateFilter(date,"yyyy-MM-dd")};return{replace:!1,scope:{columns:"@",columnPriority:"@",responsiveColumns:"@",pageSize:"@",startDate:"@",endDate:"@"},template:$templateCache.get("cdContainer/cdContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"columns",'["longName","state","term","maturity","intFreq","rate","offerYield","cusip","amountAvailable","restrictions"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["term","rate","offerYield","longName","state","maturity","intFreq","cusip","amountAvailable","restrictions"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultInt($scope,$attrs,"pageSize",0),svi.ng.defaultInt($scope,$attrs,"issuerDisplayLength",20)}catch(e){throw"sviCdContainer: "+e}var startDate=$attrs.startDate;startDate||(startDate=state.get("cd-dateRangeFrom")),$scope.startDate=$attrs.startDate=startDate?normalizeDate(startDate):"";var interestFrequency,endDate=$attrs.endDate;endDate||(endDate=state.get("cd-dateRangeTo")),$scope.endDate=$attrs.endDate=endDate?normalizeDate(endDate):"",$scope.sortDir=state.get("cd-sortDir","asc"),$scope.sortField=state.get("cd-sortField","offering.maturity"),$scope.currentPage=0,$scope.pageSize&&($scope.currentPage=1),$scope.totalPages=0,$scope.pageCacheID="",$scope.refocus=null,labels.setupLabels($scope,["cd"],{}),$scope.initComplete=!1,$scope.cd=!1;try{(interestFrequency=state.get("cd-interestFrequency"))||(interestFrequency=[])}catch(e){interestFrequency=[]}$scope.filters={interestFrequency:interestFrequency};try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.error("sviCdContainer: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}$scope.$watch("sortField",function(val){state.set("cd-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("cd-sortDir",val).save()}),$scope.$watch("filters.interestFrequency",function(val){state.set("cd-interestFrequency",val).save()});try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviCdContainer: Error parsing columnPriority: ",e,$attrs.columnPriority)}$scope.getLoadParameters=function(){var index,data={sortField:$scope.sortField,sortDir:$scope.sortDir,startDate:$scope.startDate||"",endDate:$scope.endDate||""};$scope.pageSize&&(data.pageSize=$scope.pageSize,data.pageNum=$scope.currentPage,data.pageCacheID=$scope.pageCacheID),data.filterField=[],data.filterValue=[];var interestFrequencyLength=$scope.filters.interestFrequency.length;if(interestFrequencyLength){index=data.filterField.length,data.filterValue[index]=[];for(var j=0;j<interestFrequencyLength;j++)data.filterValue[index]=php.array_merge(data.filterValue[index],$scope.filters.interestFrequency[j].value);data.filterField[index]="intFreq"}return data},$scope.setLoader=function(loader){$scope.loader=loader}}],link:function($scope,$element,$attrs){var load=function(){if($scope.initComplete)return $scope.loader?void $scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout(load,200)},loadCallback=function(){$("html,body").animate({scrollTop:0},0);var data=$scope.getLoadParameters();return cd.getCd(data)},onSuccess=function(response){piwik.trackPage("cdContainer","Certificate of Deposit Container",1e3*response._loaderMetadata.elapsedTime),$scope.cd=response.cd,$scope.currentPage=$scope.cd.pageNum,$scope.totalPages=$scope.cd.pageCount,$scope.pageCacheID=$scope.cd.pageCacheID,$scope.cd.requestQuery&&$scope.cd.requestQuery.startDate&&$scope.cd.requestQuery.endDate&&($scope.startDate=normalizeDate($scope.cd.requestQuery.startDate),$scope.endDate=normalizeDate($scope.cd.requestQuery.endDate),eventDispatcher.trigger("CD.DATE_RANGE.FILTER.CHANGED",{from:$scope.startDate,to:$scope.endDate})),$scope.cd&&$scope.cd.cdItems&&$scope.cd.cdItems.length?$timeout(function(){void 0!==svi.marketHoverOver&&$element.get()&&svi.marketHoverOver.attachTooltips($element.get()[0]),svi.ui.pulse(".cd-grid, .cd-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)}):$scope.loader.setMessage($scope.labels.noCdData)},onError=function(reason){angular.isObject(console)&&console.error(reason),piwik.trackPage("cdContainer/error","Error: Certificate of Deposit Container",!1)};eventDispatcher.on("CD.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.cd=!1,$scope.sortField=data.field,$scope.sortDir=data.dir,$scope.refocus='.svi-column-header[data-event="CD.'+data.field+'"]',load())},!0),eventDispatcher.on("CD.PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.cd=!1,$scope.currentPage=data,load())},!0),eventDispatcher.on("CD.INTEREST_FREQUENCY.FILTER.CHANGED",function(e,data){if(!data||0===data.length)return 0===$scope.filters.interestFrequency.length?void 0:($scope.filters.interestFrequency=[],load());if($scope.filters.interestFrequency!==data){if($scope.filters.interestFrequency.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.filters.interestFrequency[i].value!==data[i].value){same=!1;break}if(same)return}$scope.cd=!1,$scope.filters.interestFrequency=data,$scope.pageSize&&($scope.currentPage=1),load()}},!0),$timeout(function(){$scope.initComplete=!0,$scope.cd||load()},400),eventDispatcher.on("CD.DATE_RANGE.FILTER.CHANGED",function(e,data){if(data.hasOwnProperty("from")&&data.hasOwnProperty("to")){var from=normalizeDate(data.from),to=normalizeDate(data.to);data.isAll&&(to=from=""),$scope.startDate==from&&$scope.endDate==to||($scope.startDate=from,$scope.endDate=to,$scope.pageSize&&($scope.currentPage=1),data.hasOwnProperty("fromQuickDateRange")&&data.fromQuickDateRange||eventDispatcher.trigger("CD.QUICK_DATE_RANGE.FILTER.CHANGED",{value:"custom"}),load())}},!0),eventDispatcher.on("CD.QUICK_DATE_RANGE.FILTER.CHANGED",function(e,data){data.hasOwnProperty("value")&&angular.isObject(data.value)&&data.value.hasOwnProperty("from")&&data.value.hasOwnProperty("to")&&(data.value.fromMaturityDateRange=!0,data.isAll&&(data.value.isAll=!0),eventDispatcher.trigger("CD.DATE_RANGE.FILTER.CHANGED",data.value))},!0)}}}]),angular.module("directives").directive("sviCdGrid",["$templateRequest","$compile","$filter","labels","expander","floatThead",function($templateRequest,$compile,$filter,labels,expander,floatThead){return{replace:!1,scope:{title:"@",columns:"=",columnPriority:"=",responsiveColumns:"@",cd:"=",sortField:"=?",sortDir:"=?",id:"@",issuerDisplayLength:"@",restrictionsDisplayLength:"@",cusipDisplayLength:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultInt($scope,$attrs,"issuerDisplayLength",20),svi.ng.defaultInt($scope,$attrs,"restrictionsDisplayLength",8),svi.ng.defaultInt($scope,$attrs,"cusipDisplayLength",20)}catch(e){throw"sviCdGrid: "+e}$scope.id=php.uniqid("CDGRID"),labels.setupLabels($scope,["cd"],{}),floatThead.init($scope,$element),expander.init($scope,$scope.id,$element),$scope.$watch("cd",function(){expander.reset($scope)}),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{actionMenu:!1,expander:!1}}}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("cd/cdGrid/cdGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviUsbNavigationHelper",["$log","eventDispatcher","config","$compile",function($log,eventDispatcher,config,$compile){var waitForElm=function(selector){return new Promise(function(resolve){if(document.querySelector(selector))return resolve(document.querySelector(selector));var observer=new MutationObserver(function(mutations){document.querySelector(selector)&&(resolve(document.querySelector(selector)),observer.disconnect())});observer.observe(document.body,{childList:!0,subtree:!0})})},switchMenuItemsVisibility=function(data,permissionsConfig){data.hasOwnProperty("combined")&&angular.forEach(permissionsConfig,function(page,index){data.combined.hasOwnProperty(index)&&waitForElm("#"+permissionsConfig[index]).then(function(){data.combined[index]?$("#"+permissionsConfig[index]).show():$("#"+permissionsConfig[index]).hide()})})};return{replace:!1,controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"config","[]");try{$attrs.config=JSON.parse($attrs.config)}catch(e){$log.error("sviUsbNavigationHelper: Error parsing config",e,$attrs.config),$attrs.config=[]}$scope.config=$attrs.config,$scope.currentAccountData={},$scope.currentContainerClass=null,eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(event,data){$scope.currentAccountData=data,switchMenuItemsVisibility(data,$scope.config)}),window.addEventListener("resize",function(event){var searchedContainerClass,currentWidth=document.body.offsetWidth;searchedContainerClass=currentWidth<=1024?".TopMenuBarMobileContainer":".top-menu-bar__content-wrapper",$scope.currentContainerClass!==searchedContainerClass&&waitForElm(searchedContainerClass).then(function(elm){angular.element("#scivantage-search-input").empty().addClass("svi-bs").append($compile("<div data-svi-snap-quote data-symbol-lookup='false' data-placement='bottom'></div>")($scope)),switchMenuItemsVisibility($scope.currentAccountData,$scope.config),$scope.currentContainerClass=searchedContainerClass})},!0)}],link:function($scope,$element,$attrs){waitForElm("#scivantage-search-input").then(function(elm){angular.element("#scivantage-search-input").empty().addClass("svi-bs").append($compile("<div data-svi-snap-quote data-symbol-lookup='false' data-placement='bottom'></div>")($scope))}),angular.element("#svi-fastQuote").empty().addClass("svi-bs").append($compile("<div data-svi-snap-quote data-symbol-lookup='false' data-placement='bottom'></div>")($scope))}}}]),angular.module("directives").directive("sviAccountDropdown",["$templateCache","accountList","APP_CONFIG","eventDispatcher","sviUrl","labels","$location","switchAccount","session","$log",function($templateCache,accountList,APP_CONFIG,eventDispatcher,sviUrl,labels,$location,switchAccount,session,$log){return{replace:!1,scope:{selectLabel:"@",autoReload:"@",buttonClass:"@",fixDropdown:"@",filterBy:"@",filterBoid:"@",dropdownClasses:"@",initEvent:"@"},template:$templateCache.get("accountDropdown/accountDropdown.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultTrue($scope,$attrs,"initEvent"),""!==APP_CONFIG.currentAccount?($scope.selectedAccount=accountList.getCurrentAccountIndex(),svi.ng.defaultString($scope,$attrs,"selectLabel",accountList.getCurrentAccountDisplay()),$scope.initEvent&&switchAccount.single($scope.selectedAccount)):($scope.selectedAccount=null,svi.ng.defaultString($scope,$attrs,"selectLabel","Select Account")),svi.ng.defaultFalse($scope,$attrs,"autoReload"),svi.ng.defaultString($scope,$attrs,"buttonClass",""),svi.ng.defaultFalse($scope,$attrs,"fixDropdown"),svi.ng.defaultString($scope,$attrs,"filterBy",""),svi.ng.defaultString($scope,$attrs,"filterBoid",""),svi.ng.defaultString($scope,$attrs,"dropdownClasses",""),APP_CONFIG.accountClasses&&($scope.accountClasses=APP_CONFIG.accountClasses),$scope.id=php.uniqid("acctDropdown"),labels.setupLabels($scope,["general"]),$scope.filterAccountsByBoid=function(accountList){if($scope.filterBoid)for(var filterBoids=$scope.filterBoid.split(","),i=0,l=accountList.length;i<l;i++)php.in_array(accountList[i].boid,filterBoids)&&accountList.splice(i--,1);return accountList};var _filterByIndexes=[],updateAccountList=function(){var _accountObjList=$scope.accountList=accountList.getAccountObjects(),_filterBoids=[];if($scope.filterBoid&&(_filterBoids=$scope.filterBoid.split(",")),0<_accountObjList.length&&$scope.filterBy)_filterByIndexes=[],session.get($scope.filterBy,!0).then(function(result){if(200==result.status&&result.data.hasOwnProperty($scope.filterBy)){var list=result.data[$scope.filterBy].split("|");if(list.length!=_accountObjList.length)return void $log.error("Account Filter List length ("+list.length+") != Account List length ("+_accountObjList.length+")");$scope.accountList=[];for(var i=0,l=list.length;i<l;i++)_filterByIndexes.push(svi.ng.strToBoolean(list[i])&&!php.in_array(_accountObjList[i].boid,_filterBoids)),_filterByIndexes[i]?$scope.accountList.push(_accountObjList[i]):i==$scope.selectedAccount&&($log.debug("Current account ("+i+") not allowed by filter list: "+JSON.stringify(list)),$scope.selectedAccount=null,$scope.selectLabel="Select Account",eventDispatcher.trigger("ACCOUNT.FILTERED",{index:i,filter:list}))}});else if(0<_accountObjList.length&&0<_filterBoids.length){$scope.accountList=[],_filterByIndexes=[];for(var i=0,l=_accountObjList.length;i<l;i++)_filterByIndexes.push(!php.in_array(_accountObjList[i].boid,_filterBoids)),_filterByIndexes[i]?$scope.accountList.push(_accountObjList[i]):i==$scope.selectedAccount&&($log.debug("Current account ("+i+") not allowed by boid list: "+JSON.stringify(_filterBoids)),$scope.selectedAccount=null,$scope.selectLabel="Select Account",eventDispatcher.trigger("ACCOUNT.FILTERED",{index:i,filter:_filterBoids}))}else accountList.getCurrentAccountDisplay()!=$scope.selectLabel&&($scope.selectedAccount=null,$scope.selectLabel="Select Account")};$scope.$watch("filterBy",updateAccountList),eventDispatcher.on("SESSION.ACCOUNT_LIST.CHANGED",updateAccountList),updateAccountList(),$scope.onClick=function(data){var accountIndex=data.index;if(!0===$scope.autoReload){var url=$location.absUrl().replace(/\/account\/(?:[0-9]+\/)?/,"/account/"+accountIndex+"/").replace(/\/multiAccount\/(?:[0-9]+\/)?/,"/multiAccount/"+accountIndex+"/");return $location.absUrl()==url?void switchAccount.single(data.index).then(function(){sviUrl.href(url)}):void sviUrl.href(url)}switchAccount.single(data.index),$scope.selectedAccount=[accountIndex],$scope.selectLabel=data.account+(data.nickname?accountList.getNicknameSeparator()+data.nickname:"")},eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(event,data){$scope.filterBy&&!_filterByIndexes[data.index]||($scope.selectedAccount=data.index,$scope.selectLabel=accountList.getCurrentAccountDisplay())}),$scope.onDropdown=function(e){$scope.fixDropdown&&svi.fixDropdown.onClick(e)},$scope.onFocus=function(){$(".open").removeClass("open")}}]}}]),angular.module("directives").directive("sviActionBar",["$templateCache","eventDispatcher","$timeout","sviUrl",function($templateCache,eventDispatcher,$timeout,sviUrl){return{replace:!1,scope:{barClass:"@",maxItems:"@",stacked:"@",items:"="},template:$templateCache.get("actionBar/actionBar.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"barClass",""),svi.ng.defaultFalse($scope,$attrs,"stacked"),svi.ng.defaultInt($scope,$attrs,"maxItems",5),$scope.onClick=function(item,event){if("dropdown"!==item.type){angular.isDefined(event)&&(event.preventDefault(),event.stopPropagation());var el=$element.find(".dropdown.open");switch(el&&el.dropdown("toggle"),eventDispatcher.trigger("NAVIGATION.CONTEXT.CHANGED",item),item.type){case"url":var target,windowSpecification=null;angular.isDefined(event)&&(2===event.which||1===event.which&&(event.metaKey||event.ctrlKey))?target="_blank":(target=item.target,windowSpecification=item.specs),sviUrl.href(item.url,target,windowSpecification);break;case"javascript":if(!item.function)throw JSON.stringify(item)+" is missing the required parameters to execute.";for(var fn=item.function.split("."),ref=window,i=0;i<fn.length;i++){if(!angular.isDefined(ref[fn[i]]))throw 0<i?fn[i]+" is not a member of "+fn[i-1]:fn[i]+" is not a member of window";ref=ref[fn[i]]}if("function"!=typeof ref)throw item.function+" is not a function";ref.apply(window,item.params);break;case"event":eventDispatcher.trigger(item.event.name,item.event.data)}}},$scope.enableDropdowns=function(){var el=$element.find(".dropdown-toggle");el?el.dropdown():$element.find(".svi-action-bar")||$timeout($scope.enableDropdowns,200)},$timeout($scope.enableDropdowns),$scope.enableDropdown=function($event){$event&&$event.delegateTarget&&$($event.delegateTarget).dropdown()},$scope.$watch("items",function(newVal){if(angular.isArray(newVal)){for(var changed=!1,i=0,l=newVal.length;i<l;i++)"url"!==newVal[i].type||newVal[i].url||(changed=!0);changed&&($scope.items=newVal),$timeout($scope.enableDropdowns)}},!0)}]}}]),angular.module("directives").directive("sviActionMenu",["$templateCache","eventDispatcher","$timeout","sviUrl",function($templateCache,eventDispatcher,$timeout,sviUrl){return{replace:!1,scope:{label:"@",ariaLabel:"@",menuClass:"@",buttonClass:"@",icon:"@",fixDropdown:"@",items:"=",globalDropdown:"@",comm:"=?"},template:$templateCache.get("actionMenu/actionMenu.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"label",""),svi.ng.defaultString($scope,$attrs,"ariaLabel",""),svi.ng.defaultString($scope,$attrs,"menuClass",""),svi.ng.defaultString($scope,$attrs,"buttonClass","btn btn-xs btn-primary"),svi.ng.defaultString($scope,$attrs,"icon","caret"),svi.ng.defaultFalse($scope,$attrs,"fixDropdown"),svi.ng.defaultFalse($scope,$attrs,"globalDropdown"),$scope.onClick=function(item,event){if(angular.isDefined(event)&&(event.preventDefault(),event.stopPropagation()),"dropdown"===item.type){if(angular.isDefined(event)&&angular.isDefined(event.target)){var parent=angular.element(event.target).parent();parent.siblings().removeClass("open"),parent.toggleClass("open")}}else{var el=$element.find(".dropdown-toggle");switch(el&&el.dropdown("toggle"),eventDispatcher.trigger("NAVIGATION.CONTEXT.CHANGED",item),item.type){case"url":var target,windowSpecification=null;angular.isDefined(event)&&(2===event.which||1===event.which&&(event.metaKey||event.ctrlKey))?target="_blank":(target=item.target,windowSpecification=item.specs),sviUrl.href(item.url,target,windowSpecification);break;case"javascript":if(!item.function)throw JSON.stringify(item)+" is missing the required parameters to execute.";for(var fn=item.function.split("."),ref=window,i=0;i<fn.length;i++){if(!angular.isDefined(ref[fn[i]]))throw 0<i?fn[i]+" is not a member of "+fn[i-1]:fn[i]+" is not a member of window";ref=ref[fn[i]]}if("function"!=typeof ref)throw item.function+" is not a function";ref.apply(window,item.params);break;case"event":eventDispatcher.trigger(item.event.name,item.event.data)}}},$scope.touched=!1,$scope.onDropdown=function(e){$(e.currentTarget).closest("tr").hasClass("svi-rc-toggle-row")&&!1===$scope.touched?($(e.currentTarget).dropdown("toggle"),$scope.touched=!0):$(e.currentTarget).dropdown(),$scope.fixDropdown&&svi.fixDropdown.onClick(e)},$scope.globalDropdown&&($element.find(".dropdown").on("show.bs.dropdown",function(){$(".svi-bs").append($element.find(".dropdown").css({position:"absolute",left:$element.find(".dropdown").offset().left,top:$element.find(".dropdown").offset().top,"z-index":"1045"}).attr("id","action-menu-dropdown-absolute-position").detach())}),$element.find(".dropdown").on("hidden.bs.dropdown",function(){$element.find(".svi-action-menu").append($("#action-menu-dropdown-absolute-position").css({position:"unset",left:"unset",top:"unset"}).attr("id","").detach()),$("#action-menu-dropdown-absolute-position").remove(),$("#action-menu-dropdown-absolute-position").length&&$("#action-menu-dropdown-absolute-position").attr("id","").addClass("hidden")}),svi.fixDropdown.registerCloseAbosoluteDropdownEvent()),svi.ng.addCommWatch($scope)}]}}]),angular.module("directives").directive("sviBreadcrumbs",["$templateCache","piwik","$sce",function($templateCache,piwik,$sce){return{replace:!1,scope:{breadcrumbs:"@sviBreadcrumbs",split:"@"},template:$templateCache.get("breadcrumbs/breadcrumbs.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"split",">"),$scope.parts=[],$scope.$watch("breadcrumbs",function(newVal,oldVal){newVal==oldVal&&$scope.parts.length||($scope.parts=newVal.split($scope.split))}),piwik.trackPage("breadcrumbs","Breadcrumbs")}]}}]),angular.module("directives").directive("sviClickEvent",["eventDispatcher","$log",function(eventDispatcher,$log){return{replace:!1,scope:{eventId:"@",value:"@",valueJson:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"eventId")}catch(e){throw"sviClickEvent: "+e}$scope.broadcast=function(){var value=null;if($attrs.hasOwnProperty("valueJson"))try{svi.ng.parseJSON($scope,$attrs,"valueJson"),value=$attrs.valueJson}catch(e){$log.warn("sviClickEvent: Error parsing valueJson: ",e,$attrs.valueJson),value=null}null!==value&&""!==value||!$attrs.hasOwnProperty("value")||(value=$attrs.value),eventDispatcher.trigger($scope.eventId,value)},$element.on("click",$scope.broadcast)}]}}]),angular.module("directives").directive("sviClickOutside",["$parse","$timeout",function($parse,$timeout){return{link:function(scope,element,attrs){function handler(event){$(event.target).closest(element).length||scope.$apply(function(){$parse(attrs.sviClickOutside)(scope)})}$timeout(function(){document.addEventListener("click",handler,!0)}),scope.$on("$destroy",function(){document.removeEventListener("click",handler,!0)})}}}]),angular.module("directives").directive("sviCollapse",["$templateCache","eventDispatcher","bsBreakpoint","$timeout","$window",function($templateCache,eventDispatcher,bsBreakpoint,$timeout,$window){return{scope:{autoCollapse:"@",onSymbolChange:"@",symbolEventName:"@",collapsibleTitle:"@",eventId:"@",initiallyCollapsed:"@",zoomEnabled:"@",zoomWidth:"@",zoomHeight:"@"},transclude:!0,replace:!0,template:$templateCache.get("collapse/collapse.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.api=this,svi.ng.defaultTrue($scope,$attrs,"autoCollapse"),svi.ng.defaultString($scope,$attrs,"onSymbolChange","none"),svi.ng.defaultString($scope,$attrs,"symbolEventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultString($scope,$attrs,"collapsibleTitle","",!0),svi.ng.defaultString($scope,$attrs,"eventId",null),svi.ng.defaultFalse($scope,$attrs,"initiallyCollapsed"),svi.ng.defaultFalse($scope,$attrs,"zoomEnabled"),svi.ng.defaultString($scope,$attrs,"zoomWidth",null),svi.ng.defaultString($scope,$attrs,"zoomHeight",null),$scope.id=php.uniqid(),$scope.expanded=!0,$scope.expanded=!($scope.initiallyCollapsed||$scope.autoCollapse&&bsBreakpoint.isMobile()),eventDispatcher.on($scope.symbolEventName,function(e,data){"none"!==$scope.onSymbolChange&&("mobileCollapse"===$scope.onSymbolChange&&bsBreakpoint.isMobile()?$scope.expanded=!1:"mobileExpand"===$scope.onSymbolChange&&bsBreakpoint.isMobile()?$scope.expanded=!0:"collapse"===$scope.onSymbolChange?$scope.expanded=!1:"expand"===$scope.onSymbolChange&&($scope.expanded=!0))},null,$element),$scope.transitioning=!1;var resize=function(){$window.dispatchEvent(new Event("resize"))};$scope.toggle=function(){$scope.expanded=!$scope.expanded,$scope.transitioning=!0,$timeout(function(){$scope.transitioning=!1},500),$scope.expanded&&$timeout(resize)},$scope.collapse=function(){$scope.expanded&&$scope.toggle()},$scope.expand=function(){$scope.expanded||$scope.toggle()},$scope.zoomed=!1,$scope.toggleZoom=function(){$scope.expand(),$timeout(function(){$scope.zoomed?$scope.unzoom():$scope.zoom()})};var showBackdrop=function(show){var backdrop=$element.find(".backdrop");show?backdrop.addClass("visible"):backdrop.removeClass("visible")};$scope.unzoom=function(){if($scope.zoomed){var panel=$element.find(".panel");showBackdrop(!1),$element.css({width:"",height:""}),panel.removeClass("zoomed"),panel.css({width:"",height:""}),$scope.zoomed=!1,$window.dispatchEvent(new Event("resize"))}},$scope.zoom=function(){if(!$scope.zoomed){var panel=$element.find(".panel");showBackdrop(!0),$element.css({width:$element.innerWidth(),height:$element.innerHeight()});var height=panel.innerHeight(),width=panel.innerWidth();if($scope.zoomWidth&&(width=$scope.zoomWidth),$scope.zoomHeight&&(height=$scope.zoomHeight),!$scope.zoomWidth&&!$scope.zoomHeight)width<height?width=width/height*(height=$window.innerHeight-20):height=height/width*(width=$window.innerWidth-20);panel.addClass("zoomed"),width&&panel.css("width",width),height&&panel.css("height",height),$scope.zoomed=!0,$window.dispatchEvent(new Event("resize"))}};var ifMine=function(data,fn){$scope.eventId&&data&&data.hasOwnProperty("eventId")&&data.eventId===$scope.eventId&&fn(data)};$scope.eventId&&(eventDispatcher.on("COLLAPSE.COLLAPSE",function(e,data){ifMine(data,$scope.collapse)},!1,$element),eventDispatcher.on("COLLAPSE.EXPAND",function(e,data){ifMine(data,$scope.expand)},!1,$element),eventDispatcher.on("COLLAPSE.TOGGLE",function(e,data){ifMine(data,$scope.toggle)},!1,$element))}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviColumnChart",["APP_CONFIG","$templateCache","$timeout","highcharts","eventDispatcher","$filter",function(APP_CONFIG,$templateCache,$timeout,highcharts,eventDispatcher,$filter){return{scope:{chartData:"@",title:"@",subtitle:"@",legend:"="},template:$templateCache.get("columnChart/columnChart.tpl.html"),controller:["$scope","$attrs","$element",function($scope,$attrs,$element){($scope.api=this).name="columnChart",this.friendlyName="Column Chart";try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"subtitle","")}catch(e){throw"sviColumnChart: "+e}$scope.data=null,$scope.chart=null,$scope.colors=APP_CONFIG.chartColors.graphicColors.map(function(colorItem){return colorItem.color}),$scope.chartOptions=function(){var numberFilter=$filter("sviNumber");return{chart:{renderTo:$element.find(".column-chart")[0],type:"column",height:$element.find(".column-chart").height()||300,reflow:!0},title:{text:$scope.title,align:"left",x:35,style:{fontFamily:"inherit"}},subtitle:{text:$scope.subtitle,align:"left",x:35,style:{fontFamily:"inherit"}},legend:{verticalAlign:"top",align:"right"},xAxis:{type:"datetime",title:null},yAxis:{title:null},tooltip:{pointFormatter:function(){return"<b>"+numberFilter(this.y,2,!0,!1)+"</b>"}},series:[]}};var createChart=function(){$scope.chart&&$scope.chart.destroy();var options=$.extend(!0,{},$scope.chartOptions());if($scope.data){if(!$scope.data.data)return;$scope.data.data.forEach(function(item,i){options.series.push({data:item,name:$scope.legend[i],color:$scope.colors[i]})}),$scope.chart=highcharts.getChart(options),$scope.chart.reflow()}};eventDispatcher.on("EARNINGS.EVENTS.MODAL.OPEN",function(e,data){createChart(),data&&($scope.data=JSON.parse(data))}),$scope.$watch("chartData",function(newVal,oldVal){newVal&&newVal!==oldVal&&($scope.data=JSON.parse(newVal),createChart())}),$timeout(function(){createChart()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("directives").directive("sviDropdownHelper",["$window","$timeout",function($window,$timeout){return{restrict:"A",link:function($scope,$element,$attrs){var menuSelector=".dropdown-menu";$attrs.sviDropdownHelper&&(menuSelector=$attrs.sviDropdownHelper),$attrs.fixDropdown&&svi.ng.strToBoolean($attrs.fixDropdown,!1)&&$element.on("click",svi.fixDropdown.onClick),$timeout(function(){var menu=$element.parent().find(menuSelector);1!=menu.length&&console.error("WARNING: dropdown helper matched more than one element",menu),$element.offset().left>$window.innerWidth/2?menu.addClass("dropdown-menu-right"):menu.removeClass("dropdown-menu-right")})}}}]),angular.module("directives").directive("sviDynamicHtml",["$compile","$sce",function($compile,$sce){return{replace:!0,controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.$watch($attrs.sviDynamicHtml,function(html){try{html=$sce.getTrustedHtml(html),$element.html(html),$compile($element.contents())($scope)}catch(e){throw"sviDynamicHtml: "+e+html}})}]}}]),angular.module("directives").directive("sviErrorPage",["$popover","$templateCache",function($popover,$templateCache){return{restrict:"A",scope:{error:"="},template:$templateCache.get("errorPage/errorPage.tpl.html"),link:function(scope,elem,attrs){var datesPopup,destroyDatesPopup=function(){datesPopup&&(datesPopup.destroy(),datesPopup=null)};scope.$watch("error",function(){destroyDatesPopup()}),scope.showDates=function(){if(!datesPopup){var link=elem.find(".pr_link");datesPopup=$popover(link,{scope:scope,container:"body",placement:"bottom-left",trigger:"manual",template:$templateCache.get("errorPage/datesPopup.tpl.html")})}datesPopup.$promise.then(datesPopup.$isShown?datesPopup.hide:datesPopup.show)},scope.$on("$destroy",function(){destroyDatesPopup()})}}}]),angular.module("directives").directive("sviExpander",["$templateCache","$timeout","eventDispatcher",function($templateCache,$timeout,eventDispatcher){return{replace:!1,scope:{target:"@",expanded:"@",iconCollapsed:"@",iconExpanded:"@",btnStyle:"@",tooltip:"@",eventId:"@",handleDom:"@",accordion:"@",ariaLabel:"@"},template:$templateCache.get("expander/expander.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"target",""),svi.ng.defaultFalse($scope,$attrs,"expanded"),svi.ng.defaultString($scope,$attrs,"iconCollapsed","far fa-plus-square"),svi.ng.defaultString($scope,$attrs,"iconExpanded","far fa-minus-square"),svi.ng.defaultString($scope,$attrs,"btnStyle","link"),svi.ng.defaultString($scope,$attrs,"tooltip",""),svi.ng.defaultString($scope,$attrs,"eventId",""),svi.ng.defaultFalse($scope,$attrs,"handleDom"),svi.ng.defaultFalse($scope,$attrs,"accordion"),svi.ng.defaultString($scope,$attrs,"ariaLabel",$scope.tooltip?$scope.tooltip:"toggle details"),$scope.toggle=function($event){angular.isObject($event)&&($event.stopPropagation(),$event.preventDefault()),$scope.expanded?$scope.collapse():$scope.expand()},$scope.expand=function(noEvent){if($scope.expanded=!0,$scope.icon=$scope.iconExpanded,$scope.eventId&&!noEvent&&eventDispatcher.trigger("EXPANDER."+$scope.eventId,{target:$scope.target,show:!0,source:"sviExpander"}),$scope.handleDom){var rows=$($scope.target),placeholder=rows.last().next();placeholder.hasClass("expander-placeholder")&&placeholder.remove(),rows.show()}},$scope.collapse=function(noEvent){if($scope.expanded=!1,$scope.icon=$scope.iconCollapsed,$scope.eventId&&!noEvent&&eventDispatcher.trigger("EXPANDER."+$scope.eventId,{target:$scope.target,show:!1,source:"sviExpander"}),$scope.handleDom){var placeholder,rows=$($scope.target);if(rows.length%2==1)"TR"==rows[0].tagName.toUpperCase()&&(placeholder=$('<tr class="expander-placeholder"><td>&nbsp;</td></tr>'),rows.last().after(placeholder),rows.push(placeholder[0]));rows.hide()}},$scope.icon=$scope.expanded?$scope.iconExpanded:$scope.iconCollapsed,$scope.handleDom&&$timeout(function(){$scope.expanded?$scope.expand():$scope.collapse()}),$scope.eventId&&eventDispatcher.on("EXPANDER."+$scope.eventId,function(e,data){angular.isObject(data)&&data.hasOwnProperty("target")&&data.hasOwnProperty("show")&&(String(data.target)===String($scope.target)?data.hasOwnProperty("source")&&"sviExpander"==data.source||(data.show?$scope.expand(!0):$scope.collapse(!0)):$scope.accordion&&data.show&&$scope.expanded&&$scope.collapse())},!1,$element)}]}}]),angular.module("directives").directive("sviFilterCheckbox",["$templateCache","eventDispatcher","state",function($templateCache,eventDispatcher,state){return{replace:!1,scope:{eventId:"@",stateId:"@",title:"@",value:"@"},template:$templateCache.get("filterCheckbox/filterCheckbox.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"eventId"),svi.ng.required($attrs,"stateId"),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"value","")}catch(e){throw"sviFilterCheckbox: "+e}if($scope.id=php.uniqid($attrs.stateId),""===$scope.value){var stateValue=state.get($attrs.stateId);$scope.value=!!stateValue&&($attrs.value=stateValue)}else state.set($attrs.stateId,$scope.value).save();$scope.broadcast=function(){state.set($scope.stateId,$scope.value).save(),eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",$scope.value)},$scope.$watch("value",function(newValue,oldValue){newValue!=oldValue&&$scope.broadcast()}),eventDispatcher.on($scope.eventId+".FILTER.CHANGED",function(e,data){data&&($scope.value=data)})}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviFilterDateRange",["$templateCache","$timeout","eventDispatcher","state","labels","dateUtils",function($templateCache,$timeout,eventDispatcher,state,labels,dateUtils){return{replace:!1,scope:{eventId:"@",stateId:"@",delay:"@",labelClass:"@",fromLabel:"@",toLabel:"@",fromDate:"@",toDate:"@",minDate:"@",maxDate:"@",maxRange:"@",format:"@",isStateDisabled:"@",fireEventImmediately:"@"},template:$templateCache.get("filterDateRange/filterDateRange.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.required($attrs,"eventId"),svi.ng.required($attrs,"stateId"),svi.ng.defaultInt($scope,$attrs,"delay",1e3),svi.ng.defaultString($scope,$attrs,"labelClass","sr-only"),svi.ng.defaultString($scope,$attrs,"fromLabel","From Date"),svi.ng.defaultString($scope,$attrs,"toLabel","Until Date"),svi.ng.defaultString($scope,$attrs,"fromDate",""),svi.ng.defaultString($scope,$attrs,"toDate",""),svi.ng.defaultString($scope,$attrs,"minDate",""),svi.ng.defaultString($scope,$attrs,"maxDate",""),svi.ng.defaultInt($scope,$attrs,"maxRange",0),svi.ng.defaultString($scope,$attrs,"format","M/d/yyyy"),svi.ng.defaultFalse($scope,$attrs,"isStateDisabled"),svi.ng.defaultFalse($scope,$attrs,"fireEventImmediately"),$scope.id=php.uniqid($attrs.stateId);var stateValue,normalizeDate=function(dateString){return dateUtils.normalizeDate(dateString,$scope.format)};if($scope.fromDate=$attrs.fromDate=normalizeDate($scope.fromDate),$scope.toDate=$attrs.toDate=normalizeDate($scope.toDate),"today"!==$scope.minDate&&($scope.minDate=$attrs.minDate=normalizeDate($scope.minDate)),"today"!==$scope.maxDate&&($scope.maxDate=$attrs.maxDate=normalizeDate($scope.maxDate)),$scope.minDate||$scope.maxDate){var minDateToDisable,maxDateToDisable,disableFromRange=[],disableToRange=[];if($scope.minDate){var minDate=new Date($scope.minDate);minDateToDisable=new Date(minDate.getTime()-864e5),disableFromRange.push({start:"-Infinity",end:minDateToDisable}),disableToRange.push({start:"-Infinity",end:minDateToDisable})}$scope.maxDate&&(maxDateToDisable="today"===$scope.maxDate?new Date:new Date($scope.maxDate),disableFromRange.push({start:maxDateToDisable,end:"+Infinity"}),disableToRange.push({start:maxDateToDisable,end:"+Infinity"})),$scope.disabledFrom=disableFromRange,$scope.disabledTo=disableToRange,$scope.maxDateProxy=maxDateToDisable}labels.setupLabels($scope,["forms"],{}),$scope.fromDate?$scope.isStateDisabled||state.set($attrs.stateId+"From",$scope.fromDate).save():(stateValue=state.get($attrs.stateId+"From"))&&!$scope.isStateDisabled&&($scope.fromDate=$attrs.fromDate=stateValue),$scope.toDate?$scope.isStateDisabled||state.set($attrs.stateId+"To",$scope.toDate).save():(stateValue=state.get($attrs.stateId+"To"))&&!$scope.isStateDisable&&($scope.toDate=$attrs.toDate=stateValue),$scope.broadcast=function(){if($scope.fromDate&&$scope.toDate){var fromDate,toDate;try{if(angular.isDate($scope.fromDate))fromDate=$scope.fromDate;else if(fromDate=new Date($scope.fromDate),isNaN(fromDate.getTime()))return;if($scope.dateForm.fromDate.$setViewValue(fromDate,"directive"),angular.isDate($scope.toDate))toDate=$scope.toDate;else if(toDate=new Date($scope.toDate),isNaN(toDate.getTime()))return;$scope.dateForm.toDate.$setViewValue(toDate,"directive")}catch(e){return}var fromDateStr=normalizeDate(fromDate),toDateStr=normalizeDate(toDate);if($scope.validationError="",toDate<fromDate)return void($scope.validationError=$scope.labels.dateRangeErrorReversed);var rangeSize=(toDate-fromDate)/864e5;if(rangeSize=Math.round(rangeSize),0<$scope.maxRange&&rangeSize>$scope.maxRange)return void($scope.validationError=$scope.labels.dateRangeErrorMaxRange.replace("%DAYS%",$scope.maxRange));$scope.dateForm.fromDate.$valid&&$scope.dateForm.toDate.$valid&&($scope.isStateDisabled||(state.set($attrs.stateId+"From",fromDateStr),state.set($attrs.stateId+"To",toDateStr)),eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",{from:fromDateStr,to:toDateStr}))}else $scope.validationError="",$scope.fromDate||state.remove($attrs.stateId+"From"),$scope.toDate||state.remove($attrs.stateId+"To")},$scope.onFocus=function(){$(".open").removeClass("open")};var applyFromValidationError=function(){$scope.validationFromDateError||$scope.validationToDateError?$scope.validationError=$scope.validationFromDateError||$scope.validationToDateError:$scope.validationError=""};$scope.timeout=null,$scope.$watch("fromDate",function(newValue,oldValue){if(newValue){var normalizedNewDate=normalizeDate(newValue);if(normalizedNewDate!==normalizeDate(oldValue)){var fromDate=newValue,toDate=$scope.toDate;$scope.validationFromDateError="",angular.isDate(newValue)||(fromDate=new Date(newValue)),toDate&&!angular.isDate(toDate)&&(toDate=new Date(toDate)),$scope.minDate&&fromDate<new Date($scope.minDate)&&($scope.validationFromDateError=$scope.labels.dateRangeErrorMinDate.replace("%DATE%",$scope.minDate)),$scope.maxDate&&$scope.maxDateProxy&&fromDate>$scope.maxDateProxy&&($scope.validationFromDateError=$scope.labels.dateRangeErrorMaxDate),fromDate&&toDate&&!$scope.validationFromDateError&&!$scope.validationToDateError?toDate<fromDate?($scope.dateForm.toDate.$setViewValue("","input"),$scope.toDate=fromDate,$scope.dateForm.toDate.$setUntouched(),$scope.$applyAsync('toDate=""'),$timeout.cancel($scope.timeout)):($timeout.cancel($scope.timeout),$scope.fireEventImmediately?eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",{from:normalizedNewDate,to:normalizeDate(toDate)}):$scope.timeout=$timeout($scope.broadcast,$scope.delay)):$scope.validationFromDateError||$scope.validationToDateError||!$scope.fireEventImmediately?applyFromValidationError():eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",{from:normalizedNewDate,to:normalizeDate(toDate)})}}else $scope.validationFromDateError="",applyFromValidationError()}),$scope.$watch("toDate",function(newValue,oldValue){if(newValue){var normalizedNewDate=normalizeDate(newValue);if(normalizedNewDate!==normalizeDate(oldValue)){var toDate=newValue,fromDate=$scope.fromDate;$scope.validationToDateError="",angular.isDate(newValue)||(toDate=new Date(newValue)),fromDate&&!angular.isDate(fromDate)&&(fromDate=new Date(fromDate)),$scope.minDate&&toDate<new Date($scope.minDate)&&($scope.validationToDateError=$scope.labels.dateRangeErrorMinDate.replace("%DATE%",$scope.minDate)),$scope.maxDate&&$scope.maxDateProxy&&toDate>$scope.maxDateProxy&&($scope.validationToDateError=$scope.labels.dateRangeErrorMaxDate),fromDate&&toDate&&!$scope.validationToDateError&&!$scope.validationFromDateError?toDate<fromDate?($scope.dateForm.fromDate.$setViewValue("","input"),$scope.fromDate=toDate,$scope.dateForm.fromDate.$setUntouched(),$scope.$applyAsync('fromDate=""'),$timeout.cancel($scope.timeout)):($timeout.cancel($scope.timeout),$scope.fireEventImmediately?eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",{from:normalizeDate(fromDate),to:normalizedNewDate}):$scope.timeout=$timeout($scope.broadcast,$scope.delay)):$scope.validationFromDateError||$scope.validationToDateError||!$scope.fireEventImmediately?applyFromValidationError():eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",{from:normalizeDate(fromDate),to:normalizedNewDate})}}else $scope.validationToDateError="",$scope.validationFromDateError||$scope.validationToDateError?$scope.validationError=$scope.validationToDateError||$scope.validationFromDateError:$scope.validationError=""}),eventDispatcher.on($scope.eventId+".FILTER.CHANGED",function(e,data){data&&angular.isObject(data)&&(data.hasOwnProperty("from")&&(""!==data.from&&$scope.dateForm.fromDate.$setUntouched(),$scope.fromDate=normalizeDate(data.from)),data.hasOwnProperty("to")&&(""!==data.to&&$scope.dateForm.toDate.$setUntouched(),$scope.toDate=normalizeDate(data.to)))},null,$element)}]}}]),angular.module("directives").directive("sviFilterDropdown",["$templateCache","eventDispatcher","state","$timeout",function($templateCache,eventDispatcher,state,$timeout){return{replace:!1,scope:{eventId:"@",stateId:"@",options:"@",selected:"@",title:"@",ariaLabel:"@",disabled:"@",dropdownClass:"@",buttonClass:"@",comm:"=?",labelText:"@",isStateDisabled:"@",hasError:"=?"},require:"?ngModel",template:$templateCache.get("filterDropdown/filterDropdown.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){var processSelectedOption=function(){if($scope.options&&angular.isArray($scope.options)&&$scope.options.length)for(var i=0,c=$scope.options.length;i<c;i++)if("object"!=typeof $scope.selected&&$scope.options[i].value===$scope.selected||"object"==typeof $scope.selected&&$scope.options[i].value===$scope.selected.value){$scope.title=$attrs.title=$scope.options[i].display,$scope.selected=$scope.options[i];break}};try{svi.ng.defaultString($scope,$attrs,"eventId",""),svi.ng.defaultString($scope,$attrs,"stateId",""),svi.ng.parseJSON($scope,$attrs,"options"),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"ariaLabel",""),svi.ng.defaultFalse($scope,$attrs,"disabled"),svi.ng.defaultString($scope,$attrs,"dropdownClass",""),svi.ng.defaultString($scope,$attrs,"buttonClass",""),svi.ng.defaultString($scope,$attrs,"selectedItemNames","None selected"),svi.ng.defaultString($scope,$attrs,"labelText",""),svi.ng.defaultFalse($scope,$attrs,"isStateDisabled"),svi.ng.defaultFalse($scope,$attrs,"hasError");var selected=$scope.stateId&&!$scope.isStateDisabled?state.get($scope.stateId):null;null!==selected?$scope.selected=$attrs.selected=selected:svi.ng.defaultString($scope,$attrs,"selected",""),processSelectedOption()}catch(e){throw"sviFilterDropdown: "+e}$scope.$watch("options",processSelectedOption,!0),$scope.onClick=function(option){$scope.selected!=option&&($scope.title=option.display,$scope.selectedItemNames=option.display,$scope.selected=option,$scope.stateId&&$scope.selected&&!$scope.isStateDisabled&&state.set($scope.stateId,$scope.selected.value).save(),$scope.api.broadcast())},$scope.onBlur=function(){$(".open").removeClass("open")},this.broadcast=function(){processSelectedOption(),$scope.modelCtrl&&$scope.selected&&$scope.modelCtrl.$setViewValue($scope.selected.value,"input"),$scope.eventId&&eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",$scope.selected)},this.setSelected=function(selected){$scope.selected=$attrs.selected=selected,processSelectedOption()},$scope.api=this,svi.ng.addCommWatch($scope),$scope.eventId&&(eventDispatcher.on($scope.eventId+".FILTER.CHANGED",function(evt,data){angular.isObject(data)&&data.hasOwnProperty("value")&&$scope.api.setSelected(data.value)}),eventDispatcher.on($scope.eventId+".INPUT.DISABLE",function(e,data){data.value&&$scope.api.setSelected(""),$scope.disabled=data.value})),$timeout(this.broadcast)}],link:function($scope,$element,$attrs,modelCtrl){modelCtrl&&(($scope.modelCtrl=modelCtrl).$render=function(){$scope.api.setSelected(modelCtrl.$modelValue)})}}}]),angular.module("directives").directive("sviFilterMultiDropdown",["$templateCache","$log","eventDispatcher","state",function($templateCache,$log,eventDispatcher,state){return{replace:!1,scope:{eventId:"@",options:"@",stateId:"@",title:"@",selectedLabel:"@",filter:"@",selectAll:"@",ariaLabel:"@",isStateDisabled:"@"},template:$templateCache.get("filterMultiDropdown/filterMultiDropdown.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"eventId"),svi.ng.required($attrs,"stateId"),svi.ng.parseJSON($scope,$attrs,"options"),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"selectedLabel",""),svi.ng.defaultTrue($scope,$attrs,"filter"),svi.ng.defaultTrue($scope,$attrs,"selectAll"),svi.ng.defaultString($scope,$attrs,"ariaLabel",""),svi.ng.defaultString($scope,$attrs,"selectedItemNames",""),svi.ng.defaultFalse($scope,$attrs,"isStateDisabled")}catch(e){throw"sviFilterMultiDropdown: "+e}var selected;if($scope.buttonId=$scope.stateId+php.uniqid(),!$scope.isStateDisabled)try{(selected=state.get($attrs.stateId))||(selected=[])}catch(e){selected=[]}if(selected&&0<selected.length&&(!angular.isObject(selected[0])||angular.isArray(selected[0])))try{var i,j,c,options=[];for(i=0,c=$scope.options.length;i<c;i++)if(angular.isArray($scope.options[i].value)){for(j=0;j<selected.length;j++)if(angular.equals($scope.options[i].value,selected[j])){options.push($scope.options[i]);break}}else php.in_array($scope.options[i].value,selected)&&options.push($scope.options[i]);selected=options}catch(e){$log.error("sviFilterMultiDropdown: Error parsing selected: ",e)}$scope.selected=selected,$scope.onClick=function(){$scope.isStateDisabled||state.set($scope.stateId,$scope.selected),eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",$scope.selected)},eventDispatcher.on($scope.eventId+".FILTER.CHANGED",function(e,data){if(!data||0===data.length){if($scope.selected&&0===$scope.selected.length)return;$scope.selected=[]}if($scope.selected!==data){if($scope.selected&&$scope.selected.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.selected[i].value!==data[i].value){same=!1;break}if(same)return}$scope.selected=data,$scope.selectedItemNames="";for(var j=0,k=data.length;j<k;j++)0<j&&($scope.selectedItemNames+=","),$scope.selectedItemNames+=data[j].display}}),$scope.$watch("selected",function(newVal){eventDispatcher.trigger($scope.eventId+".FILTER.UPDATED",newVal)}),eventDispatcher.on($scope.eventId+".FILTER.CLEARED",function(){$scope.selected=[]},!0)}]}}]),angular.module("directives").directive("sviFilterText",["$templateCache","$timeout","eventDispatcher","state",function($templateCache,$timeout,eventDispatcher,state){return{replace:!1,scope:{eventId:"@",stateId:"@",delay:"@",title:"@",value:"@",capitalize:"@",isStateDisabled:"@",isLabelForSrOnly:"@"},template:$templateCache.get("filterText/filterText.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"eventId"),svi.ng.required($attrs,"stateId"),svi.ng.defaultInt($scope,$attrs,"delay",1e3),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"value",""),svi.ng.defaultFalse($scope,$attrs,"capitalize"),svi.ng.defaultFalse($scope,$attrs,"isStateDisabled"),svi.ng.defaultTrue($scope,$attrs,"isLabelForSrOnly")}catch(e){throw"sviFilterText: "+e}if($scope.id=php.uniqid($attrs.stateId),$scope.isDisabled=!1,$scope.value||$scope.isStateDisabled)state.set($attrs.stateId,$scope.value).save();else{var stateValue=state.get($attrs.stateId);stateValue&&($scope.value=$attrs.value=stateValue)}$scope.broadcast=function(){$scope.isStateDisabled||state.set($scope.stateId,$scope.value).save(),eventDispatcher.trigger($scope.eventId+".FILTER.CHANGED",$scope.value)},$scope.timeout=null,$scope.$watch("value",function(newValue,oldValue){newValue!=oldValue&&($scope.capitalize&&($scope.value=$scope.value.toUpperCase()),$timeout.cancel($scope.timeout),$scope.timeout=$timeout($scope.broadcast,$scope.delay))}),$scope.onFocus=function(){$(".open").removeClass("open")},eventDispatcher.on($scope.eventId+".FILTER.CHANGED",function(e,data){""===data?$scope.value="":data&&($scope.value=data)}),eventDispatcher.on($scope.eventId+".INPUT.DISABLE",function(e,data){$scope.value="",$scope.isDisabled=data})}]}}]),angular.module("directives").directive("sviFireEvent",["eventDispatcher","$timeout",function(eventDispatcher,$timeout){return{replace:!1,scope:{eventId:"@",value:"@",delay:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"eventId"),svi.ng.defaultString($scope,$attrs,"value","");try{svi.ng.parseJSON($scope,$attrs,"value")}catch(e){}svi.ng.defaultInt($scope,$attrs,"delay",50)}catch(e){throw"sviFireEvent: "+e}$scope.broadcast=function(){eventDispatcher.trigger($scope.eventId,$scope.value)},$timeout($scope.broadcast,$scope.delay)}]}}]),angular.module("directives").directive("sviGaugeChart",["APP_CONFIG","$templateCache","$timeout","highcharts",function(APP_CONFIG,$templateCache,$timeout,highcharts){return{replace:!1,scope:{value:"@",maxValue:"@",chartColor:"@",backgroundColor:"@",description:"@"},template:$templateCache.get("gaugeChart/gaugeChart.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="gaugeChart",this.friendlyName="Gauge chart",$scope.chart=null,$scope.getOptions=function(){return{chart:{type:"solidgauge",renderTo:$element.find(".gauge-chart")[0],height:$element.find(".gauge-chart").height()||200,width:$element.find(".gauge-chart").height()||200,margin:[0,0,0,0],backgroundColor:$scope.backgroundColor},title:{text:null},subtitle:{text:null},exporting:{enabled:!1},tooltip:{enabled:!1},accessibility:{landmarkVerbosity:"disabled",description:$scope.description,keyboardNavigation:{enabled:!1}},pane:{startAngle:0,endAngle:360,background:[{borderWidth:0,outerRadius:"100%",innerRadius:"85%",backgroundColor:Highcharts.color($scope.chartColor).setOpacity(.3).get()}]},yAxis:{min:0,max:100,lineWidth:0,tickPositions:[]},plotOptions:{solidgauge:{dataLabels:{borderWidth:0,verticalAlign:"middle",align:"center",enabled:!0,useHTML:!0,format:'<div class="label-value">{point.y}</div><div class="label-text">out of {point.outOf}</div>'},rounded:!0,stickyTracking:!1}},series:[{data:[{color:$scope.chartColor,radius:"100%",innerRadius:"85%",y:+$scope.value,outOf:+$scope.maxValue}]}]}};var createChart=function(){$scope.chart&&$scope.chart.destroy(),$scope.chart=highcharts.getChart($.extend(!0,{},$scope.getOptions()))};$scope.$watch("value",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&createChart()}),$timeout(function(){createChart()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.core").directive("sviHelp",["APP_CONFIG","$templateCache",function(APP_CONFIG,$templateCache){return{replace:!1,scope:{message:"@"},template:$templateCache.get("help/help.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="help",this.friendlyName="Help";try{svi.ng.defaultString($scope,$attrs,"message","")}catch(e){throw"sviHelp: "+e}}]}}]),angular.module("directives").directive("sviInputSymbol",["$templateCache","$timeout","bloodhound","APP_CONFIG","labels","config","bsBreakpoint","eventDispatcher","$filter","$tooltip",function($templateCache,$timeout,bloodhound,APP_CONFIG,labels,config,bsBreakpoint,eventDispatcher,$filter,$tooltip){var investmentTypeToAssetType={mutualfund:["MF"],stock:["CS","ETF"]};return{replace:!1,scope:{name:"@",id:"@",placeholder:"@",value:"@",inputCls:"@",investmentType:"@",debounceDelay:"@",capitalize:"@",osi:"@",enableLookup:"@",lookupPlacement:"@",enableReplacement:"@",manualSubmit:"@",submitMessage:"@",submitClass:"@",eventName:"@",autocompleteEventName:"@",comm:"=?",onlyValid:"@",clearOnSubmit:"@",ariaDescribedby:"@",isInputDisabled:"@"},require:"?ngModel",template:$templateCache.get("inputSymbol/inputSymbol.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"name","symbol"),svi.ng.defaultString($scope,$attrs,"id",php.uniqid("inputSymbol")),svi.ng.defaultString($scope,$attrs,"placeholder",""),svi.ng.defaultString($scope,$attrs,"value",""),svi.ng.defaultString($scope,$attrs,"inputCls",""),svi.ng.defaultValidString($scope,$attrs,"investmentType",["Stock","Option","MutualFund"],""),svi.ng.defaultInt($scope,$attrs,"debounceDelay",500),svi.ng.defaultTrue($scope,$attrs,"capitalize"),svi.ng.defaultTrue($scope,$attrs,"osi"),svi.ng.defaultTrue($scope,$attrs,"enableLookup"),svi.ng.defaultValidString($scope,$attrs,"lookupPlacement",["top","bottom"],"top"),svi.ng.defaultTrue($scope,$attrs,"enableReplacement"),svi.ng.defaultFalse($scope,$attrs,"manualSubmit"),svi.ng.defaultString($scope,$attrs,"submitMessage","Add Symbol to Compare"),svi.ng.defaultString($scope,$attrs,"submitClass","glyphicon glyphicon-plus"),svi.ng.defaultString($scope,$attrs,"eventName",""),svi.ng.defaultString($scope,$attrs,"autocompleteEventName",""),svi.ng.defaultFalse($scope,$attrs,"onlyValid"),svi.ng.defaultFalse($scope,$attrs,"clearOnSubmit"),svi.ng.defaultFalse($scope,$attrs,"isInputDisabled"),$attrs.hasOwnProperty("comm")||($scope.comm={})}catch(e){throw"sviInputSymbol: "+e}labels.setupLabels($scope,["general","inputSymbol"],{}).then(function(){"Add Symbol to Compare"===$scope.submitMessage&&($scope.submitMessage=$scope.labels.addSymbolMessage)}),$scope.arialive="",$scope.typeaheadResults=[],$scope.replacementRules=[],$scope.enableReplacement&&config.getConfig(["symbol","replacementRules"]).then(function(response){if(200===response.status&&response.data.success&&angular.isObject(response.data.config)){var rules=response.data.config;for(var x in rules)rules.hasOwnProperty(x)&&$scope.replacementRules.push({rule:svi.util.parseRegExp(rules[x]),value:x})}}),$scope.isMobile=bsBreakpoint.isMobile,$scope.disabled=!1,eventDispatcher.on("SYMBOL.CONTEXT.DISABLE",function(e,data){$scope.disabled=data.disabled});var url,ttAdapter,stockRegex=APP_CONFIG.validation.stockMask,trimmedStockRegex=stockRegex.substr(stockRegex.indexOf("^")+1,stockRegex.lastIndexOf("$")-2),fundRegex=APP_CONFIG.validation.fundMask,trimmedFundRegex=fundRegex.substr(fundRegex.indexOf("^")+1,fundRegex.lastIndexOf("$")-2);this.stockRegex=svi.util.parseRegExp(stockRegex),this.fundRegex=svi.util.parseRegExp(fundRegex),this.optionRegex=svi.util.parseRegExp(APP_CONFIG.validation.optionMask),this.multiStockRegex=svi.util.parseRegExp("/^(?:"+trimmedStockRegex+"|"+trimmedFundRegex+")(?:\\s*,\\s*(?:"+trimmedStockRegex+"|"+trimmedFundRegex+"))+$/i"),$scope.osi?(url=svi.url.getHost()+"/Modules/Lib/MVC/OSI/loadOSIData.php?query=%QUERY",$scope.templates="",$scope.bloodhound=bloodhound.create({limit:1e4,remote:{url:url,ajax:{xhrFields:{withCredentials:!0}},filter:function(data){if(angular.isArray(data)){var len=data.length;if(0<len&&angular.isArray(data[0]))for(var i=0;i<len;i++)data[i]={value:data[i][0]};return data}return[]}}}),ttAdapter=$scope.bloodhound.ttAdapter(),$scope.ttAdapter=function(query,callback){!$scope.osi||$scope.investmentType&&("Option"!==$scope.investmentType||$scope.api.isValid(query))||ttAdapter.apply($scope.bloodhound,arguments),callback([])}):(url=svi.url.getHost()+"/Web/symbol/search?query=%QUERY",$scope.templates={suggestion:function(context){var bg=$filter("assetTypeColor")(context.assetType);return'<div class="asset-type label pull-right" style="background-color: '+bg+"; color: "+$filter("textColor")(bg)+';">'+$scope.labels[context.assetType]+'</div><div class="symbol">'+context.symbol+'</div><div class="name">'+context.name+"</div>"}},$scope.bloodhound=bloodhound.create({limit:100,remote:{url:url,ajax:{headers:{Accept:"application/json","X-CSRFToken":APP_CONFIG.csrfToken,"X-SVISessionId":APP_CONFIG.sessionId},xhrFields:{withCredentials:!0}},filter:function(data){return angular.isObject(data)&&data.hasOwnProperty("result")&&angular.isArray(data.result)&&0<data.result.length?($scope.arialive=$scope.labels.typeaheadUpdated+data.result[0].name,$scope.typeaheadResults=data.result,$scope.onlyValid&&$scope.investmentType&&($scope.typeaheadResults=data.result.filter(function(result){return investmentTypeToAssetType[$scope.investmentType.toLowerCase()].includes(result.assetType)}))):($scope.arialive=$scope.labels.typeaheadNoResults,$scope.typeaheadResults=[]),$scope.typeaheadResults}}}),ttAdapter=$scope.bloodhound.ttAdapter(),$scope.ttAdapter=function(query,callback){ttAdapter.apply($scope.bloodhound,arguments)}),$scope.eventName&&eventDispatcher.on($scope.eventName,function(e,data){!angular.isObject(data)||!data.hasOwnProperty("symbol")||data.symbol===$scope.value||$scope.investmentType&&data.hasOwnProperty("investmentType")&&$scope.investmentType!==data.investmentType||($scope.value=data.symbol)},null,$element),eventDispatcher.on("SYMBOL.CONTEXT.CLEAR",function(){$scope.api.clearSymbol()}),this.getId=function(){return $scope.id},this.getValue=function(){return $scope.value},this.setValue=function(value){$scope.capitalize&&angular.isString(value)?$scope.value=value.toUpperCase():$scope.value=value,$scope.api.runReplacementRules()},$scope.valid=!1,this.isValid=function(value){angular.isUndefined(value)?value=$scope.value:$scope.value!==value&&($scope.value=value);var valid=!0;switch($scope.investmentType){case"Stock":valid=$scope.api.stockRegex.test(value);break;case"Option":valid=$scope.api.optionRegex.test(value);break;case"MutualFund":valid=$scope.api.fundRegex.test(value);break;default:valid=$scope.api.stockRegex.test(value)||$scope.api.optionRegex.test(value)||$scope.api.fundRegex.test(value)}return $scope.api.setValid(valid),valid},this.setValid=function(valid){return valid&&!$scope.valid&&$scope.api.hideInvalidTooltip(),$scope.valid=valid,this},this.runReplacementRules=function(){if($scope.enableReplacement&&angular.isString($scope.value)&&0<$scope.replacementRules.length)for(var i=0,l=$scope.replacementRules.length;i<l;i++)$scope.value=$scope.value.replace($scope.replacementRules[i].rule,$scope.replacementRules[i].value)},this.getTypeaheadController=svi.ng.getControllerFactory($element,$scope,"svi-typeahead"),this.getSymbolLookupController=svi.ng.getControllerFactory($element,$scope,"svi-symbol-lookup"),$scope.symbolLookup=!1,this.clearSymbol=function(){$scope.clearOnSubmit&&$timeout(function(){$scope.value="",$scope.comm.value=""},200)},this.symbolSubmit=function(){if(!$scope.osi){var val=$scope.api.getRawValue();if($scope.api.isValid(val))$scope.value=val;else if($scope.onlyValid)return void(null===val||""===val?$scope.api.hideInvalidTooltip():$scope.api.showInvalidTooltip());if($timeout(function(){$scope.api.getTypeaheadController().hideTypeahead()}),$scope.autocompleteEventName&&$scope.typeaheadResults)for(var i=0,l=$scope.typeaheadResults.length;i<l;i++)if($scope.value===$scope.typeaheadResults[i].value)return eventDispatcher.trigger($scope.autocompleteEventName,$scope.typeaheadResults[i]),void $scope.api.clearSymbol()}if($scope.eventName&&$scope.api.isValid()){var data={symbol:$scope.value};$scope.investmentType&&(data.investmentType=$scope.investmentType),eventDispatcher.trigger($scope.eventName,data),$scope.api.clearSymbol()}else $scope.eventName&&(null===$scope.value||""===$scope.value?$scope.api.hideInvalidTooltip():$scope.api.showInvalidTooltip())},this.toggleSymbolLookup=function(){if($scope.symbolLookup=!$scope.symbolLookup,$scope.symbolLookup){$scope.api.clearSymbol();var ctl=this.getSymbolLookupController();ctl&&ctl.setValue(""),$timeout(function(){$element.find(".symbol-lookup-area input").focus()},100)}else $timeout(function(){$element.find(".symbol-input-area input:not(.tt-hint)").focus()},100)},this.getRawValue=function(){return $element.find("#"+$scope.id).typeahead("val")};var invalidTooltip=null;this.showInvalidTooltip=function(){var msg=$scope.labels.inputSymbolInvalidSymbol;if(!invalidTooltip){var options={placement:"auto bottom",trigger:"manual",autoClose:!0,type:"danger",title:msg};invalidTooltip=$tooltip($element.find(".symbol-input-area"),options)}invalidTooltip.$scope.title=msg,invalidTooltip.$promise.then(invalidTooltip.show),$scope.arialive=msg+$scope.value},this.hideInvalidTooltip=function(){invalidTooltip&&invalidTooltip.$promise.then(invalidTooltip.hide),$scope.arialive=""},$scope.api=this,svi.ng.addCommWatch($scope)}],link:function($scope,$element,$attrs,modelCtrl){var checkTypeahead=function(){$scope.osi?"Option"!==$scope.investmentType&&""!==$scope.investmentType||$scope.api.stockRegex.test($scope.value)||$scope.api.fundRegex.test($scope.value)||$scope.api.multiStockRegex.test($scope.value)?$timeout(function(){$scope.api.getTypeaheadController().hideTypeahead()}):$scope.api.optionRegex.test($scope.value)||$timeout(function(){$scope.api.getTypeaheadController().showTypeahead()}):""!==$scope.api.getRawValue()&&$timeout(function(){$scope.api.getTypeaheadController().showTypeahead()})};$scope.typeaheadOpen=!1;var opened=function(){$scope.typeaheadOpen=!0},closed=function(){$scope.typeaheadOpen=!1},suggestionSelected=function(evt,suggestion){$scope.typeaheadOpen=!1,eventDispatcher.trigger($scope.autocompleteEventName,suggestion),$scope.api.clearSymbol()},suggestionCursorChanged=function(evt,suggestion){var msg=suggestion.name;$scope.labels.hasOwnProperty(suggestion.assetType)&&(msg+=", "+$scope.labels.typeaheadAssetType+": "+$scope.labels[suggestion.assetType]),msg+=". "+$scope.labels.typeaheadInstructions,$scope.arialive=msg};$scope.$watch("value",function(newValue,oldValue){newValue!==oldValue&&(""!==newValue&&($scope.symbolLookup=!1),eventDispatcher.trigger("POPOVER.HIDE","ALL"),$scope.capitalize&&angular.isString($scope.value)&&($scope.value=$scope.value.toUpperCase()),$scope.api.runReplacementRules(),modelCtrl&&modelCtrl.$setViewValue($scope.value,"input"),$scope.comm.value=$scope.value,$scope.osi&&checkTypeahead(),$scope.manualSubmit||$scope.api.symbolSubmit())}),$scope.$watch("investmentType",function(newValue,oldValue){newValue!==oldValue&&(angular.isString($scope.value)&&$scope.value.length&&$scope.api.isValid(),$scope.osi&&checkTypeahead())}),$scope.$watch("valid",function(newValue,oldValue){newValue!==oldValue&&modelCtrl&&modelCtrl.$setValidity("symbolRegexIS",newValue)}),modelCtrl&&(modelCtrl.$render=function(){$scope.capitalize&&angular.isString(modelCtrl.$modelValue)?$scope.value=modelCtrl.$modelValue.toUpperCase():$scope.value=modelCtrl.$modelValue,$scope.api.runReplacementRules()},modelCtrl.$validators.symbolRegexIS=function(modelValue,viewValue){var value=modelValue||viewValue;return!angular.isString(value)||0===value.length||$scope.api.isValid(value)}),$timeout(function(){$element.find(".tt-input").on("focus",checkTypeahead),$scope.osi||($element.find("#"+$scope.id).on("typeahead:cursorchanged",suggestionCursorChanged),$element.find("#"+$scope.id).on("typeahead:opened",opened),$element.find("#"+$scope.id).on("typeahead:closed",closed)),$scope.autocompleteEventName&&$element.find("#"+$scope.id).on("typeahead:selected",suggestionSelected),$scope.manualSubmit&&$element.find("#"+$scope.id).on("keypress",function(evt){13===evt.which&&$scope.api.symbolSubmit()})},400)}}}]),angular.module("directives").directive("sviLabelsCache",["labels",function(labels){return{replace:!1,scope:{setId:"@",labels:"@",onlyIfEmpty:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"setId"),svi.ng.parseJSON($scope,$attrs,"labels"),svi.ng.defaultTrue($scope,$attrs,"onlyIfEmpty")}catch(e){throw"sviLabelsCache: "+e}$attrs.onlyIfEmpty&&!angular.isUndefined(labels.cache[$attrs.setId])||(labels.cache[$attrs.setId]=$attrs.labels)}]}}]),angular.module("svi.core").directive("sviLipperAttribution",["APP_CONFIG","$templateCache",function(APP_CONFIG,$templateCache){return{replace:!1,scope:{label:"@",placement:"@",trigger:"@",container:"@",customClass:"@",lipperHelpText:"@"},template:$templateCache.get("lipperAttribution/lipperAttribution.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="lipperAttribution",this.friendlyName="Lipper Attribution";try{svi.ng.defaultString($scope,$attrs,"label","Refinitiv Lipper"),svi.ng.defaultString($scope,$attrs,"placement","top"),svi.ng.defaultString($scope,$attrs,"lipperHelpText",""),svi.ng.defaultString($scope,$attrs,"trigger","click"),svi.ng.defaultString($scope,$attrs,"container",".svi-bs"),svi.ng.defaultString($scope,$attrs,"customClass","")}catch(e){throw"sviLipperAttribution: "+e}$scope.api.onPopoverShow=function(){document.activeElement.getBoundingClientRect().top<55&&window.scrollBy(0,-150)}}]}}]),angular.module("directives").directive("sviLoader",["APP_CONFIG","$templateCache","$timeout","$q","labels","eventDispatcher","$cacheFactory","$log",function(APP_CONFIG,$templateCache,$timeout,$q,labels,eventDispatcher,$cacheFactory,$log){return{replace:!1,scope:{callback:"=?",hidden:"@",ignoreInvisible:"@",loadingLabel:"@",ariaSuccessMsg:"@",maxRetries:"@",waitSeconds:"@",eventId:"@",comm:"=?",customError:"@"},template:$templateCache.get("loader/loader.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultFalse($scope,$attrs,"hidden"),svi.ng.defaultFalse($scope,$attrs,"ignoreInvisible"),svi.ng.defaultString($scope,$attrs,"loadingLabel","",!0),svi.ng.defaultString($scope,$attrs,"ariaSuccessMsg",""),svi.ng.defaultInt($scope,$attrs,"maxRetries",APP_CONFIG.loader.maxRetries),svi.ng.defaultInt($scope,$attrs,"waitSeconds",APP_CONFIG.loader.waitSeconds),svi.ng.defaultString($scope,$attrs,"eventId",""),svi.ng.parseJSON($scope,$attrs,"customError"),labels.setupLabels($scope,["loader"],{loading:"Loading",retry1:"Retrying in",retry2:"seconds",warningTitle:"",errorTitle:"",serverError:"An error occurred processing this request.",commError:"An error occurred while attempting to retrieve data.",commError404:"The requested data was not found.",maxRetriesReached:"The maximum number of retries have been attempted.",newLoadWhileInProgress:"A new load request canceled this one.",invalidSymbolMessage:"The requested symbol is invalid or not found."}),$scope.message=!1,$scope.$watch("message",function(val){val&&!1!==$scope.defer&&$scope.defer.notify(val)}),$scope.setMessage=function(message){$scope.message=message},$scope.warning=!1,$scope.$watch("warning",function(val){val&&!1!==$scope.defer&&$scope.defer.notify(val)}),$scope.setWarning=function(warning){$scope.warning=warning},$scope.error=!1,$scope.$watch("error",function(val){val&&!1!==$scope.defer&&$scope.defer.notify(val)}),$scope.setError=function(error){$scope.error=error},$scope.onSuccessCallbacks=[],$scope.addOnSuccess=function(fn){angular.isFunction(fn)&&$scope.onSuccessCallbacks.push(fn)},$scope.clearOnSuccess=function(){$scope.onSuccessCallbacks=[]},$scope.clearAllMessages=function(){return $scope.error=!1,$scope.warning=!1,$scope.message=!1,$scope.ariaMsg="",$scope},$scope.shouldShowMessages=function(){return!$scope.showSpinner&&($scope.error||$scope.warning||$scope.message||$scope.retrying)},$scope.showSpinner=!1,$scope.retrying=!1,$scope.$watch("retrying",function(val){val&&!1!==$scope.defer&&$scope.defer.notify($scope.labels.retry1+" "+val+" "+$scope.labels.retry2)}),$scope.retryCount=0,$scope.defer=!1,$scope.requestId=!1,$scope.pauseWhileHidden=!1,$scope.loadHandler=!1,$scope.arguments=[],$scope.loadStartTime=0,$scope.ariaMsg="",$scope.wsUris=[],$scope.setEventId=function(eventId){return $scope.eventId=eventId,$scope},$scope.setLoadHandler=function(loadHandler){return angular.isFunction(loadHandler)&&($scope.loadHandler=loadHandler),$scope},$scope.load=function(){return $scope.retryCount=0,$scope.arguments=arguments,!1!==$scope.defer&&($scope.pauseWhileHidden?$timeout.cancel($scope.pauseWhileHidden):triggerLoadCanceledEvent("NEW_LOAD_WHILE_IN_PROGRESS"),$scope.defer.reject({message:$scope.labels.newLoadWhileInProgress,shouldShowError:!1,_loaderMetadata:{elapsedTime:getTiming(),id:$scope.requestId}}),$scope.defer=!1),internalLoad()};var internalLoad=function(){return!1===$scope.defer&&($scope.defer=$q.defer()),angular.isFunction($scope.loadHandler)?checkVisible():($timeout(function(){!1!==$scope.defer&&$scope.defer.reject({message:"loadHandler must be set to a function",shouldShowError:!0}),$scope.defer=!1}),$scope.defer.promise)},checkVisible=function(){return $scope.ignoreInvisible||$element.is(":visible")?($scope.pauseWhileHidden=!1,internalLoadContinue()):($scope.pauseWhileHidden&&$timeout.cancel($scope.pauseWhileHidden),$scope.pauseWhileHidden=$timeout(checkVisible,1e3),$scope.defer.promise)},getTiming=function(){return(new Date-$scope.loadStartTime)/1e3},triggerLoadCanceledEvent=function(reason){eventDispatcher.trigger("LOADER.CANCELED",{id:$scope.requestId,eventId:$scope.eventId,reason:reason,retrying:"NEW_LOAD_WHILE_IN_PROGRESS"==reason})},triggerLoadDoneEvent=function(success){eventDispatcher.trigger("LOADER.DONE",{id:$scope.requestId,eventId:$scope.eventId,success:success,retrying:!1!==$scope.retrying})},focusOnErrorBox=function(){$timeout(function(){var closeButton,firstErrorBox=$(".alert.alert-danger:not(:hidden)")[0];firstErrorBox&&(firstErrorBox.childNodes.forEach(function(child){"button"===child.nodeName.toLowerCase()&&Object.values(child.classList).includes("close")&&(closeButton=child)}),closeButton?closeButton.focus():firstErrorBox.focus())},1500)},internalLoadContinue=function(){$scope.showSpinner=!0,$scope.clearAllMessages(),$scope.retrying=!1,$scope.loadStartTime=new Date;var requestId=$scope.requestId=php.uniqid();eventDispatcher.trigger("LOADER.IN_PROGRESS",{id:$scope.requestId,eventId:$scope.eventId});var httpPromise=$scope.loadHandler.apply($scope,$scope.arguments);return angular.isObject(httpPromise)&&angular.isFunction(httpPromise.then)&&!angular.isFunction(httpPromise.success)&&(httpPromise.success=function(fn){if(!angular.isFunction(fn))throw"callback function must be passed";return httpPromise.then(function(response){angular.isObject(response)&&response.hasOwnProperty("data")?(response.hasOwnProperty("status")||(response.status=200),fn(response.data,response.status,response.headers,response.config)):fn(response,200)}),httpPromise}),angular.isObject(httpPromise)&&angular.isFunction(httpPromise.then)&&!angular.isFunction(httpPromise.error)&&(httpPromise.error=function(fn){if(!angular.isFunction(fn))throw"callback function must be passed";return httpPromise.then(null,function(response){angular.isObject(response)&&response.hasOwnProperty("data")?(response.hasOwnProperty("status")||(response.status=500),fn(response.data,response.status,response.headers,response.config)):fn(response,500)}),httpPromise}),angular.isObject(httpPromise)&&angular.isFunction(httpPromise.success)&&angular.isFunction(httpPromise.error)?httpPromise.success(function(data,status,headers,config){if(requestId==$scope.requestId){var metadata,response=data.data||data,time=getTiming();for(var key in $scope.showSpinner=!1,$scope.clearAllMessages(),$scope.retrying=!1,data)data.hasOwnProperty(key)&&data[key]&&data[key].meta&&data[key].meta.uri&&$scope.wsUris.push(data[key].meta.uri);if(data.hasOwnProperty("success")&&!1===data.success)if(data.hasOwnProperty("fatal")&&!0===data.fatal)data.hasOwnProperty("invalidSymbol")&&data.invalidSymbol?($scope.warning=$scope.labels.invalidSymbolMessage,focusOnErrorBox()):data.hasOwnProperty("errorMessage")&&""!==data.errorMessage?$scope.error=data.errorMessage:data.hasOwnProperty("error")&&""!==data.error?$scope.error=data.error:data.hasOwnProperty("status")&&angular.isObject(data.status)&&data.status.hasOwnProperty("statusMessage")&&""!==data.status.statusMessage?$scope.error=data.status.statusMessage:$scope.error=$scope.labels.serverError,angular.isArray($scope.error)&&($scope.error=$scope.error.join("\n")),metadata={message:$scope.error+$scope.warning,shouldShowError:!0,status:status,headers:headers,config:config,elapsedTime:time},.05<time&&$log.fatal(metadata),response._loaderMetadata=metadata,triggerLoadDoneEvent(!1),$scope.defer.reject(response),focusOnErrorBox();else if($log.warn({message:"Loader: success parameter is false",status:status,data:data,headers:headers,config:config,elapsedTime:time}),$scope.customError){var type=$scope.customError.type,message=$scope.customError.message,resObject=$scope.customError.resObject,statusCodeToCompare=$scope.customError.statusCodeToCompare;resObject&&data[resObject].status.statusCode===statusCodeToCompare&&!data[resObject].status.fatal&&($scope[type]=message,focusOnErrorBox())}else $scope.message=$scope.labels.serverError,$cacheFactory.get("$http").remove(config.url),$scope.retry(data,status,config);else{metadata={message:"Loader: successful",status:status,headers:headers,config:config,elapsedTime:time},.05<time&&$log.debug(metadata),response._loaderMetadata=metadata,$scope.message=!1;for(var i=0,l=$scope.onSuccessCallbacks.length;i<l;i++)$scope.onSuccessCallbacks[i](response);$scope.ariaSuccessMsg&&($scope.ariaMsg=$scope.ariaSuccessMsg),triggerLoadDoneEvent(!0),$scope.eventId&&eventDispatcher.trigger($scope.eventId+".LOADED",response),$scope.defer&&$scope.defer.resolve(response)}}}).error(function(data,status,headers,config){requestId==$scope.requestId&&($scope.showSpinner=!1,404==status?($log.error({message:"Loader: 404 error returned",status:status,data:data,headers:headers,config:config,elapsedTime:getTiming()}),$scope.message=!1,$scope.error=$scope.labels.commError404,!1!==$scope.defer&&(triggerLoadDoneEvent(!1),$scope.defer.reject({status:status,message:$scope.error,data:data,shouldShowError:!0,_loaderMetadata:{elapsedTime:getTiming()}}))):($log.error({message:"Loader: Error retrieving data",status:status,data:data,headers:headers,config:config,elapsedTime:getTiming()}),$scope.message=$scope.labels.commError,$scope.retry(data,status,config)),focusOnErrorBox())}):$timeout(function(){!1!==$scope.defer&&(triggerLoadCanceledEvent("INVALID_LOAD_HANDLER"),$scope.defer.reject({message:"loadHandler must return a promise object",shouldShowError:!0})),$scope.defer=!1,$scope.showSpinner=!1}),$scope.defer.promise};$scope.retry=function(lastData,lastStatus,lastConfig){if($scope.retryCount>=$scope.maxRetries)return $scope.error=$scope.labels.maxRetriesReached,!1===$scope.defer&&($scope.defer=$q.defer()),triggerLoadDoneEvent(!1),$timeout(function(){$log.fatal({message:"Loader: Retries exceeded",status:lastStatus,data:lastData,config:lastConfig}),!1!==$scope.defer&&$scope.defer.reject({status:lastStatus,message:$scope.error,data:lastData,shouldShowError:!0,_loaderMetadata:{elapsedTime:getTiming()}}),$scope.defer=!1,focusOnErrorBox()}),$scope.defer.promise;if(!1===$scope.retrying)$scope.retrying=$scope.waitSeconds,triggerLoadDoneEvent(!1);else if(1==$scope.retrying--)return $scope.retrying=!1,$scope.retryCount++,internalLoad();return $timeout($scope.retry,1e3),$scope.defer.promise},$timeout(function(){"function"==typeof $scope.callback&&$scope.callback($scope)}),this.getScope=function(){return $scope},svi.ng.addCommWatch($scope)}]}}]),angular.module("directives").directive("sviModal",["$templateCache","APP_CONFIG","eventDispatcher","labels",function($templateCache,APP_CONFIG,eventDispatcher,labels){return{replace:!1,transclude:{modalBody:"sviModalBody",modalHeader:"?sviModalHeader",modalFooter:"?sviModalFooter"},scope:{eventName:"@",title:"@",id:"@",size:"@",cls:"@",modalOptions:"@",hideFooter:"@"},template:$templateCache.get("modal/sviModal.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"eventName",""),svi.ng.defaultString($scope,$attrs,"title"," "),svi.ng.defaultString($scope,$attrs,"id",php.uniqid("modal")),svi.ng.defaultValidString($scope,$attrs,"size",["sm","md","lg"],"md"),svi.ng.defaultString($scope,$attrs,"cls",""),svi.ng.defaultString($scope,$attrs,"modalOptions","{}"),svi.ng.defaultFalse($scope,$attrs,"hideFooter")}catch(e){throw"sviModal: "+e}try{svi.ng.parseJSON($scope,$attrs,"modalOptions")}catch(e){$scope.modalOptions=$attrs.modalOptions={}}$scope.active=!1,$scope.callback=!1,$scope.api=this,labels.setupLabels($scope,["general"]),this.getId=function(){return $scope.id},this.isActive=function(){return $scope.active},this.setCallback=function(cb){return angular.isFunction(cb)&&($scope.callback=cb),$scope.api};var modalElement=!(this.setTitle=function(title){return $scope.title=title,$scope.api});this.showModal=function(data){return $scope.$applyAsync("active = true"),angular.isFunction($scope.callback)&&$scope.callback(!0,data),modalElement?modalElement.modal("show"):($scope.modalOptions.show=!0,modalElement=$element.find("#"+$scope.id).modal($scope.modalOptions)),$scope.api},this.hideModal=function(data){return $scope.active&&(modalElement?modalElement.modal("hide"):$element.find("#"+$scope.id).modal("hide"),$scope.$applyAsync("active = false"),angular.isFunction($scope.callback)&&$scope.callback(!1,data)),$scope.api},$scope.eventName&&(eventDispatcher.on($scope.eventName+".SHOW",function(e,data){$scope.api.showModal(data)},null,$element),eventDispatcher.on($scope.eventName+".HIDE",function(e,data){$scope.api.hideModal(data)},null,$element))}]}}]),angular.module("svi.core").directive("sviMoreContainer",["$templateCache","$timeout",function($templateCache,$timeout){return{replace:!1,transclude:!0,scope:{moreText:"@",lessText:"@",cls:"@",expanded:"@"},template:$templateCache.get("moreContainer/moreContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"moreText","Show More"),svi.ng.defaultString($scope,$attrs,"lessText","Show Less"),svi.ng.defaultString($scope,$attrs,"cls",""),svi.ng.defaultFalse($scope,$attrs,"expanded")}catch(e){throw"sviMoreContainer: "+e}$scope.id=php.uniqid("more"),this.toggle=function(){$scope.expanded=!$scope.expanded,$element.find("#"+$scope.id).collapse($scope.expanded?"show":"hide")},$scope.api=this}],link:function($scope,$element,$attrs){$timeout(function(){$element.find("#"+$scope.id).collapse({toggle:$scope.expanded})},200)}}}]),angular.module("ui.multiselect",[]).factory("optionParser",["$parse",function($parse){var TYPEAHEAD_REGEXP=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(input){var match=input.match(TYPEAHEAD_REGEXP);if(!match)throw new Error("Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_' but got '"+input+"'.");return{itemName:match[3],source:$parse(match[4]),viewMapper:$parse(match[2]||match[1]),modelMapper:$parse(match[1])}}}}]).directive("multiselect",["$parse","$compile","optionParser","$timeout","$filter","eventDispatcher",function($parse,$compile,optionParser,$timeout,$filter,eventDispatcher){return{require:"ngModel",link:function(originalScope,element,attrs,modelCtrl){var exp=attrs.options,parsedResult=optionParser.parse(exp),isMultiple="false"!==attrs.multiple,showFilter="false"!==attrs.filter,showSelectAll="false"!==attrs.selectAll,title=attrs.title||"",required=!1,eventId=attrs.eventId||"",scope=originalScope.$new(),changeHandler=attrs.change||angular.noop;scope.items=[],scope.header=title||"Select",scope.selectedLabel=attrs.selectedLabel=attrs.selectedLabel||"Selected",scope.multiple=isMultiple,scope.filter=showFilter,scope.selectAll=showSelectAll,scope.selectedItemNames="None selected",scope.ariaLabel=attrs.ariaLabel,scope.buttonId=attrs.buttonId,scope.eventId=eventId,scope.disabled=!1,scope.id=php.uniqid(),originalScope.$on("$destroy",function(){scope.$destroy()});var popUpEl=angular.element("<div data-multiselect-popup></div>");function parseModel(){scope.items.length=0;var model=parsedResult.source(originalScope);if(null!==model&&angular.isDefined(model))for(var i=0;i<model.length;i++){var local={};local[parsedResult.itemName]=model[i],scope.items.push({label:parsedResult.viewMapper(local),model:model[i],checked:!1})}}(attrs.required||attrs.ngRequired)&&(required=!0),attrs.$observe("required",function(newVal){required=newVal}),scope.$watch(function(){return $parse(attrs.multiple)(originalScope)},function(newVal){isMultiple=newVal||!1}),scope.$watch(function(){return parsedResult.source(originalScope)},function(newVal){angular.isDefined(newVal)&&parseModel()},!0),scope.$watch(function(){return modelCtrl.$modelValue},function(newVal,oldVal){angular.isDefined(newVal)&&function(newVal){angular.isArray(newVal)?angular.forEach(newVal,function(i){angular.forEach(scope.items,function(item){angular.equals(item.model,i)&&(item.checked=!0)})}):angular.forEach(scope.items,function(item){if(angular.equals(item.model,newVal))return!(item.checked=!0)})}(newVal),function(){if(isEmpty(modelCtrl.$modelValue)||isMultiple&&0===modelCtrl.$modelValue.length)return scope.selectedItemNames="None selected",scope.header=title;var local={};if(isMultiple)if(1===modelCtrl.$modelValue.length)local[parsedResult.itemName]=modelCtrl.$modelValue[0],scope.header=parsedResult.viewMapper(local),scope.selectedItemNames=scope.header;else{scope.header=modelCtrl.$modelValue.length+" "+scope.selectedLabel;var model=modelCtrl.$modelValue;scope.selectedItemNames="";for(var i=0;i<model.length;i++)0<i&&(scope.selectedItemNames+=","),scope.selectedItemNames+=model[i].display}else local[parsedResult.itemName]=modelCtrl.$modelValue,scope.header=parsedResult.viewMapper(local)}(),modelCtrl.$setValidity("required",scope.valid())},!0),scope.$watch("isVisible",function(newVal,oldVal,scope){angular.isDefined(newVal)&&!newVal&&scope.$eval(changeHandler)}),parseModel(),element.append($compile(popUpEl)(scope));var isEmpty=function(obj){if(!obj)return!0;if(obj.length&&0<obj.length)return!1;for(var prop in obj)if(obj[prop])return!1;return!0};scope.valid=function(){if(!required)return!0;var value=modelCtrl.$modelValue;return angular.isArray(value)&&0<value.length||!angular.isArray(value)&&null!=value};function setModelValue(isMultiple){var value;isMultiple?(value=[],angular.forEach(scope.items,function(item){item.checked&&value.push(item.model)})):angular.forEach(scope.items,function(item){if(item.checked)return value=item.model,!1}),modelCtrl.$setViewValue(value)}scope.checkAll=function(ignoreFilters){isMultiple&&(!ignoreFilters&&scope.filter&&scope.searchText&&""!==scope.searchText.label?angular.forEach($filter("filter")(scope.items,scope.searchText),function(item){item.checked=!0}):angular.forEach(scope.items,function(item){item.checked=!0}),setModelValue(!0))},scope.uncheckAll=function(ignoreFilters){!ignoreFilters&&scope.filter&&scope.searchText&&""!==scope.searchText.label?angular.forEach($filter("filter")(scope.items,scope.searchText),function(item){item.checked=!1}):angular.forEach(scope.items,function(item){item.checked=!1}),setModelValue(!0)},eventDispatcher.on(scope.eventId+".FILTER.CLEARED",function(){scope.uncheckAll(!0)},!0),eventDispatcher.on(scope.eventId+".INPUT.DISABLE",function(e,data){data.value&&scope.uncheckAll(),scope.disabled=data.value}),scope.select=function(item,$event){!1===isMultiple?(!function(item){item.checked?scope.uncheckAll(!0):(scope.uncheckAll(!0),item.checked=!item.checked),setModelValue(!1)}(item),scope.toggleSelect(!1)):(!function(item){item.checked=!item.checked,setModelValue(!0)}(item),$timeout(function(){scope.toggleSelect(!0)})),void 0!==$event&&$($event.target).is("input")&&$timeout(function(){$($event.target).prop("checked",item.checked)})}}}}]).directive("multiselectPopup",["$document","$templateCache",function($document,$templateCache){return{scope:!1,replace:!0,template:$templateCache.get("multiselect/multiselect.tpl.html"),link:function(scope,element){function clickHandler(event){elementMatchesAnyInArray(event.target,element.find(event.target.tagName))||(scope.toggleSelect(!1),scope.$apply())}scope.isVisible=!1,scope.toggleSelect=function(visibility){scope.isVisible=void 0!==visibility?visibility:!scope.isVisible,scope.isVisible?(element.hasClass("open")||element.addClass("open"),$document.bind("click",clickHandler),scope.focus()):$document.unbind("click",clickHandler)},scope.focus=function(){scope.filter&&element.find("input")[0].focus()};var elementMatchesAnyInArray=function(element,elementArray){for(var i=0;i<elementArray.length;i++)if(element==elementArray[i])return!0;return!1}}}}]),angular.module("directives").directive("sviMultiSelectDropdown",["APP_CONFIG","$templateCache","labels","$document","$timeout","eventDispatcher",function(APP_CONFIG,$templateCache,labels,$document,$timeout,eventDispatcher){return{replace:!1,template:$templateCache.get("multiSelectDropdown/multiSelectDropdown.tpl.html"),scope:{options:"@",ariaLabel:"@",dropdownMenuLabel:"@",eventId:"@",description:"@",filterInputPlaceholder:"@",disabled:"@",errorMessage:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="multiSelectDropdown",this.friendlyName="Multi Select Dropdown";try{svi.ng.parseJSON($scope,$attrs,"options"),svi.ng.defaultString($scope,$attrs,"dropdownMenuLabel",""),svi.ng.defaultString($scope,$attrs,"description",""),svi.ng.defaultString($scope,$attrs,"ariaLabel",""),svi.ng.defaultString($scope,$attrs,"filterInputPlaceholder",""),svi.ng.defaultString($scope,$attrs,"eventId",""),svi.ng.defaultFalse($scope,$attrs,"disabled"),svi.ng.defaultString($scope,$attrs,"errorMessage","")}catch(e){throw"sviMultiSelectDropdown:"+e}$scope.isError=!1,labels.setupLabels($scope,["multiSelectDropdown"],{selectAll:"Select All",deselectAll:"Deselect All",filter:"Filter",accountsSelected:" Accounts Selected",accountSelected:" Account Selected"}),$scope.filterInputPlaceholder=$scope.filterInputPlaceholder||$scope.labels.filter,$scope.isVisible=!1,$scope.buttonId=php.uniqid(),$scope.buttonTitle="",$scope.selectedItemName="",$scope.localOptions=[];var getButtonTitle=function(options){var optionsAmount=options.filter(function(option){return option.checked}).length;return 1===optionsAmount?optionsAmount+$scope.labels.accountSelected:optionsAmount+$scope.labels.accountsSelected},clickHandler=function(event){(function(event){var altTarget=$element.find(event.target)[0];return event.target===$element.find(event.target.tagName)[0]||event.target===altTarget})(event)||($scope.toggleSelect(!1),$scope.$apply())};$scope.checkOrUncheckAll=function(checkAll){$scope.localOptions=$scope.localOptions.map(function(option){return{value:option.value,label:option.label,checked:!!checkAll}}),$scope.buttonTitle=getButtonTitle($scope.localOptions),eventDispatcher.trigger($scope.eventId+".ACCOUNT.CHANGED",$scope.localOptions)},$scope.focus=function(){$element.find("input")[0].focus()},$scope.onOptionClick=function(option){var options,selectedOption;$scope.localOptions=(options=$scope.localOptions,selectedOption=option,options.map(function(option){return option.value===selectedOption.value&&(option.checked=!option.checked),option})),$scope.buttonTitle=getButtonTitle($scope.localOptions),eventDispatcher.trigger($scope.eventId+".ACCOUNT.CHANGED",$scope.localOptions)},$scope.toggleSelect=function(visibility){$scope.isVisible=void 0!==visibility?visibility:!$scope.isVisible,$scope.isVisible?($element.hasClass("open")||$element.addClass("open"),$document.bind("click",clickHandler),$scope.focus()):$document.unbind("click",clickHandler)},$scope.$watch("options",function(newVal){newVal&&($scope.localOptions=newVal,$scope.buttonTitle=getButtonTitle(newVal))}),$scope.$watch("dropdownMenuLabel",function(newVal){$scope.dropdownMenuLabel=newVal}),eventDispatcher.on($scope.eventId+".MULTI.SELECT.CHECK.ALL",function(){$timeout(function(){$scope.checkOrUncheckAll(!0)})}),eventDispatcher.on($scope.eventId+".MULTI.SELECT.UNCHECK.ALL",function(){$timeout(function(){$scope.checkOrUncheckAll()})}),eventDispatcher.on($scope.eventId+".ITEMS.UPDATED",function(evt,data){data&&"string"==typeof data&&($scope.localOptions=JSON.parse(data))}),eventDispatcher.on($scope.eventId+".SUBMENU.TITLE.UPDATED",function(evt,data){data&&($scope.dropdownMenuLabel=data)}),eventDispatcher.on($scope.eventId+".VALIDATION.ERROR",function(evt,data){null!==data&&($scope.hasError=data)})}]}}]),angular.module("svi.research").directive("sviOptionSearchControls",["APP_CONFIG","$templateCache","labels","bloodhound","eventDispatcher","symbol","$timeout",function(APP_CONFIG,$templateCache,labels,bloodhound,eventDispatcher,symbol,$timeout){var DROPDOWN_SELECTORS_optionChains=".svi-option-chains-dropdown",DROPDOWN_SELECTORS_optionPrice=".svi-option-price-dropdown",DROPDOWN_SELECTORS_optionDate=".svi-option-date-dropdown",CONSTANTS_disabled="disabled",CONSTANTS_price="Strike",CONSTANTS_date="Exp Date",CONSTANTS_call="CALL",CONSTANTS_put="PUT",CONSTANTS_open="open";return{scope:{controlsLabel:"@",lastPrice:"@"},template:$templateCache.get("optionSearchControls/optionSearchControls.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="optionSearchControls",this.friendlyName="Option Search Controls";try{svi.ng.defaultString($scope,$attrs,"controlsLabel",""),svi.ng.defaultString($scope,$attrs,"lastPrice","")}catch(e){throw"sviOptionSearchControls:"+e}labels.setupLabels($scope,["general","optionSearchControls"]),$scope.optionChainsTitle=CONSTANTS_call,$scope.optionChainsOptions=[{display:CONSTANTS_call,value:CONSTANTS_call},{display:CONSTANTS_put,value:CONSTANTS_put}],$scope.optionPriceTitle=CONSTANTS_price,$scope.optionPriceData=null,$scope.isSymbolInputDisabled=!0,$scope.optionDateDropdownButtonClass=$scope.optionPriceDropdownButtonClass=$scope.submitButtonClass=CONSTANTS_disabled,$scope.optionDateTitle=CONSTANTS_date,$scope.optionDateData=null,$scope.initialSymbol=null,$scope.symbolToSubmit=null,$scope.isOptionSearchSymbol=null,$scope.pricePositionInDropdown=0,$scope.getDropdownDetails=function(dropdownEl,option){var details={};return dropdownEl===DROPDOWN_SELECTORS_optionChains?($scope.optionChainsTitle=option.display,details={title:option.display,query:$scope.initialSymbol+" "+option.value}):dropdownEl===DROPDOWN_SELECTORS_optionPrice?($scope.optionPriceTitle=option.display,details={title:option.display,query:option.value}):dropdownEl===DROPDOWN_SELECTORS_optionDate&&($scope.optionDateTitle=option.display,details={title:option.display,query:option.value}),details};var clearDropdownsOnChange=function(dropdownEl){dropdownEl===DROPDOWN_SELECTORS_optionChains?($scope.optionPriceTitle=CONSTANTS_price,$scope.optionDateTitle=CONSTANTS_date,$scope.optionDateDropdownButtonClass=$scope.submitButtonClass=CONSTANTS_disabled):dropdownEl===DROPDOWN_SELECTORS_optionPrice&&($scope.optionDateTitle=CONSTANTS_date,$scope.submitButtonClass=CONSTANTS_disabled)},getLastPricePositionInDropdown=function(lastPrice,prices){if(lastPrice&&prices)return"p"+prices.reduce(function(prev,curr){return Math.abs(curr-lastPrice)<Math.abs(prev-lastPrice)?curr:prev})};$scope.onDropdownItemClick=function(option,dropdownEl){if(option&&dropdownEl){var details=$scope.getDropdownDetails(dropdownEl,option);if(""===details.title||""===details.query)return $scope.handleDropdownState($element.find(dropdownEl)),$scope.optionPriceDropdownButtonClass=CONSTANTS_disabled,void clearDropdownsOnChange(dropdownEl);$scope.selectedItemNames=details.title,clearDropdownsOnChange(dropdownEl);var searchQuery=details.query;dropdownEl!==DROPDOWN_SELECTORS_optionDate?getSymbolData(searchQuery).then(function(res){if(dropdownEl===DROPDOWN_SELECTORS_optionChains){$scope.optionPriceData=mapData(res.data,2);var prices=getPricesFromData($scope.optionPriceData);$scope.pricePositionInDropdown=getLastPricePositionInDropdown($scope.lastPrice,prices),$scope.optionPriceDropdownButtonClass=null}else dropdownEl===DROPDOWN_SELECTORS_optionPrice&&($scope.optionDateData=mapData(res.data,3),$scope.optionDateDropdownButtonClass=null)}):($scope.symbolToSubmit=option.value,$scope.submitButtonClass="");var dropdown=$element.find(dropdownEl);$scope.handleDropdownState(dropdown)}};var getPricesFromData=function(data){return data.map(function(i){return i.display})};$scope.symbolSubmit=function(){$scope.submitButtonClass!==CONSTANTS_disabled&&$scope.symbolToSubmit&&""!==$scope.symbolToSubmit&&eventDispatcher.trigger("OPTION.SEARCH.SYMBOL.SUBMITTED",{symbol:$scope.symbolToSubmit})};var mapData=function(data,wordsToRemove){return data.map(function(i){return{value:i[0],display:function(text,wordsToRemove){return text.split(" ").slice(wordsToRemove).join(" ")}(i[0],wordsToRemove)}})},getSymbolData=function(searchQuery){try{return symbol.getSymbolOSIInfo(searchQuery)}catch(e){throw"Unable to get symbol data: "+e}};eventDispatcher.on("OPTION.SEARCH.ACTION",function(e,data){if(data&&data.symbol)if(1<data.symbol.split(" ").length?$scope.initialSymbol=data.symbol.split(" ")[0]:$scope.initialSymbol=data.symbol,$scope.isOptionSearchSymbol=data.isOptionSearch,$scope.isOptionSearchSymbol){$scope.optionPriceDropdownButtonClass=$scope.optionDateDropdownButtonClass=CONSTANTS_disabled;var parsedSymbol=data.symbol.split(" ");$scope.initialSymbol=parsedSymbol[0],$scope.optionChainsTitle=parsedSymbol[1],$scope.optionPriceTitle=CONSTANTS_price,$scope.lastPriceOption=parsedSymbol[2],getSymbolData($scope.initialSymbol+" "+$scope.optionChainsTitle).then(function(res){$scope.optionPriceData=mapData(res.data,2),$scope.optionPriceDropdownButtonClass=""})}else getSymbolData($scope.initialSymbol+" "+CONSTANTS_call).then(function(res){$scope.optionPriceData=mapData(res.data,2),$scope.optionPriceDropdownButtonClass=""})}),$scope.onBlur=function(){$(".open").removeClass(CONSTANTS_open)},$scope.scrollToLastPrice=function(){var prices=getPricesFromData($scope.optionPriceData);$scope.pricePositionInDropdown=getLastPricePositionInDropdown($scope.isOptionSearchSymbol?$scope.lastPriceOption:$scope.lastPrice,prices),$timeout(function(){$("#option-price-menu").animate({scrollTop:document.getElementById($scope.pricePositionInDropdown).offsetTop-100},10)})},$scope.handleDropdownState=function(dropdownSelector){var dropdownEl=$element.find(dropdownSelector),isDisabled=dropdownEl[0].children[0].classList.contains(CONSTANTS_disabled);!dropdownEl||dropdownEl&&isDisabled||($(dropdownSelector).find(".dropdown-menu").is(":hidden")&&$(".dropdown-toggle").dropdown("toggle"),dropdownSelector===DROPDOWN_SELECTORS_optionPrice&&$scope.scrollToLastPrice(dropdownSelector))}}]}}]),angular.module("directives").directive("sviPagingControl",["$templateCache","eventDispatcher","labels","$window",function($templateCache,eventDispatcher,labels,$window){return{replace:!1,scope:{eventId:"@",currentPage:"=",totalPages:"=",maxButtons:"@"},template:$templateCache.get("pagingControl/pagingControl.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"eventId"),svi.ng.defaultInt($scope,$attrs,"maxButtons",12)}catch(e){throw"sviPagingControl: "+e}$scope.realMaxButtons=$scope.maxButtons,labels.setupLabels($scope,["paging"],{previousPage:"Previous",nextPage:"Next"}),$scope.$watch("currentPage",function(newVal){var val=parseInt(newVal);isNaN(val)||val<1?val=1:0<$scope.totalPages&&val>$scope.totalPages&&(val=$scope.totalPages),$scope.currentPage=val}),$scope.getOffset=function(){return Math.floor(Math.max(0,$scope.realMaxButtons-5)/2)},$scope.onClick=function(page){$scope.currentPage!==page&&0<page&&page<=$scope.totalPages&&($scope.currentPage=page,eventDispatcher.trigger($scope.eventId+".PAGE.CHANGED",$scope.currentPage))},$scope.range=function(){var start,end,output=[],offset=$scope.getOffset();for($scope.showAll()?(start=2,end=$scope.totalPages-1):(start=$scope.currentPage-offset,end=$scope.currentPage+offset,$scope.showCurrent()||end--,start<2&&(start=2),end>=$scope.totalPages&&(end=$scope.totalPages-1),$scope.showFill()&&(3==start&&start--,end==$scope.totalPages-2&&end++));start<=end;start++)output.push(start);return output},$scope.showCurrent=function(){return 0<$scope.realMaxButtons},$scope.showFirst=function(){return 2<$scope.realMaxButtons||1===$scope.currentPage&&$scope.showCurrent()},$scope.showLast=function(){return 2<$scope.realMaxButtons||$scope.currentPage===$scope.totalPages&&$scope.showCurrent()},$scope.showAll=function(){return $scope.totalPages<=$scope.realMaxButtons},$scope.showFill=function(){return!$scope.showAll()&&4<$scope.realMaxButtons},$scope.showStartEllipsis=function(){return $scope.showFill()&&3<$scope.currentPage-$scope.getOffset()},$scope.showEndEllipsis=function(){return $scope.showFill()&&$scope.currentPage+$scope.getOffset()<$scope.totalPages-2},$scope.setWindowWidth=function(width){var windowMaxButtons=Math.floor((width-200)/50);$scope.realMaxButtons=Math.min($scope.maxButtons,windowMaxButtons)},eventDispatcher.on($scope.eventId+".PAGE.CHANGED",function(evt,data){if(!angular.isNumber(data)&&(data=parseInt(data),isNaN(data)))return!1;$scope.currentPage!=data&&data<=$scope.totalPages&&0<data&&($scope.currentPage=data)})}],link:function($scope,$element,$attrs){$scope.setWindowWidth($window.innerWidth),angular.element($window).on("resize",$.debounce(100,function(e){$scope.setWindowWidth($window.innerWidth)}))}}}]),angular.module("directives").directive("sviProductTypeBadge",["$templateCache","$timeout","eventDispatcher","accountList","config","session",function($templateCache,$timeout,eventDispatcher,accountList,config,session){return{replace:!1,template:$templateCache.get("productTypeBadge/productTypeBadge.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.badgeColor=null,$scope.badgeText="",$scope.helpIconText="",$scope.showBadge=!1,$scope.selfDirectedAccounts=[];var refreshBadge=function(){isAccountSelfDirected()?showBadge():hideBadge()},showBadge=function(){$scope.showBadge=!0},hideBadge=function(){$scope.showBadge=!1},loadSessionCallback=function(){return session.get("accountProductTypeList")},loadConfigCallback=function(){return config.getConfig(["account"])},isAccountSelfDirected=function(){if(0===$scope.selfDirectedAccounts.length)return!1;var accountGroups=accountList.getCurrentGroup();if(null!=accountGroups&&0!==accountGroups.accounts.length){var accounts=accountList.getAccounts();if(accountGroups.accounts.some(function(accountIndex){return-1!==$scope.selfDirectedAccounts.indexOf(accounts[accountIndex])}))return!0}else if(-1!==$scope.selfDirectedAccounts.indexOf(accountList.getCurrentAccount()))return!0;return!1};this.getLoader=svi.ng.getLoaderFactory($element,$scope),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",refreshBadge,null,$element),$scope.$watch("selfDirectedAccounts",refreshBadge);var onSessionSuccess=function(data){var accounts=accountList.getAccounts(),productTypes=data.hasOwnProperty("accountProductTypeList")?data.accountProductTypeList.split("|"):[];$scope.selfDirectedAccounts=[],0<accounts.length&&productTypes.forEach(function(productType,i){"SELF_DIRECTED"===productType&&$scope.selfDirectedAccounts.push(accounts[i])})},onConfigSuccess=function(data){if(data.hasOwnProperty("config")){var config=data.config;if(config.hasOwnProperty("helpIconText")&&($scope.helpIconText=config.helpIconText),config.hasOwnProperty("badges")){var badges=config.badges;badges.hasOwnProperty("selfDirected")&&($scope.badgeColor=badges.selfDirected.backgroundColor,$scope.badgeText=badges.selfDirected.text,$scope.api.loadSession())}}},onError=function(reason){};this.load=function(){$scope.api.loadConfig()},this.loadSession=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadSessionCallback).load().then(onSessionSuccess,onError):$timeout($scope.api.loadSession,400)},this.loadConfig=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadConfigCallback).load().then(onConfigSuccess,onError):$timeout($scope.api.loadConfig,400)},$scope.api=this,$timeout(function(){$scope.api.load()},400)}]}}]),angular.module("directives").directive("sviProductTypeMgr",function(){var HIDE_CLS="svi-product-hidden";return{replace:!1,scope:{disabled:"@",listenEvent:"@"},controller:["$element","$scope","$attrs","eventDispatcher","permissions","$timeout",function($element,$scope,$attrs,eventDispatcher,permissions,$timeout){if(svi.ng.defaultFalse($scope,$attrs,"productTypeMgrDisabled"),!$scope.productTypeMgrDisabled){$scope.productId=!1,$scope.productName=null,$scope.permissions=null,svi.ng.defaultString($scope,$attrs,"listenEvent",""),$scope.$watch("productId",function(newVal,oldVal){newVal!==oldVal&&($element.removeClass("svi-product-type-"+oldVal),$element.addClass("svi-product-type-"+newVal),$scope.listenEvent||eventDispatcher.trigger("PRODUCT_TYPE.CHANGED",{productId:$scope.productId,productName:$scope.productName}),$scope.load())}),$scope.processDirectiveDisplay=function(){if($scope.permissions){var pattern=/^(data-)?(svi-.*)$/;$element.findExclude(".svi-directive",".svi-product-type-mgr").each(function(){for(var parent=$(this).parent(),attributes=parent[0].attributes,match=null,directive=null,shouldHide=!1,i=0,l=attributes.length;i<l;i++)if((match=pattern.exec(attributes[i].name))&&3<=match.length&&(directive=match[2],-1==$scope.permissions.indexOf(directive))){shouldHide=!0;break}shouldHide?parent.addClass(HIDE_CLS):parent.removeClass(HIDE_CLS)}),$element.findExclude(".svi-container",".svi-product-type-mgr").each(function(){var container=$(this);if(0!==container.find(".svi-directive").length){for(var directives=container.find(".svi-directive:not("+HIDE_CLS+")").toArray(),childDirectives=container.find(".svi-directive .svi-directive").toArray(),parentDirectives=directives.diff(childDirectives),i=0,l=parentDirectives.length;i<l;i++)if(!$(parentDirectives[i]).parent().hasClass(HIDE_CLS))return void container.removeClass(HIDE_CLS);container.addClass(HIDE_CLS)}else container.removeClass(HIDE_CLS)})}else $element.find("."+HIDE_CLS).removeClass(HIDE_CLS)},eventDispatcher.on($scope.listenEvent?$scope.listenEvent:"ACCOUNT.CONTEXT.CHANGED",function(e,data){e&&(data.hasOwnProperty("productId")&&"NULL"!=data.productId?$scope.productId=data.productId:$scope.productId=null,data.hasOwnProperty("productName")?$scope.productName=data.productName:$scope.productName=null)},!0,$element),$scope.listenEvent||eventDispatcher.on("ACCOUNT.DATA.CHANGED",function(e,data){data.hasOwnProperty("mode")&&"group"==data.mode&&data.hasOwnProperty("currentGroup")?(data.currentGroup.hasOwnProperty("productId")&&"NULL"!=data.currentGroup.productId?$scope.productId=data.currentGroup.productId:$scope.productId=null,data.currentGroup.hasOwnProperty("productName")?$scope.productName=data.currentGroup.productName:$scope.productName=null):data.hasOwnProperty("combinedAccountData")&&(data.combinedAccountData.hasOwnProperty("productId")&&"NULL"!=data.combinedAccountData.productId&&"multiple"!=data.combinedAccountData.productId?$scope.productId=data.combinedAccountData.productId:$scope.productId=null,data.combinedAccountData.hasOwnProperty("productName")&&"multiple"!=data.combinedAccountData.productName?$scope.productName=data.combinedAccountData.productName:$scope.productName=null)},!0,$element),eventDispatcher.on("EXPANDER.*",function(e,data){$timeout($scope.processDirectiveDisplay)},!1,$element),eventDispatcher.on("PRODUCT_TYPE.REFRESH",function(e,data){$timeout($scope.processDirectiveDisplay)},!1,$element);var successCallback=function(response){response&&angular.isObject(response)&&200==response.status&&response.data.success&&($scope.permissions=response.data.widgets),$scope.processDirectiveDisplay()};$scope.load=function(){$scope.permissions=null,permissions.getProductType(null!==$scope.productId?$scope.productId:"NULL").then(successCallback)}}}],link:function($scope,$element,$attrs){$scope.productTypeMgrDisabled||$element.addClass("svi-product-type-mgr")}}}),angular.module("directives").directive("sviRepeatComplete",["$timeout","$parse",function($timeout,$parse){return{replace:!1,controller:["$scope","$element","$attrs",function($scope,$element,$attrs){if($scope.$last)try{if($scope.$parent.$parent[$attrs.callback]===undefined)throw $attrs.callback+" does not exist in scope";$scope.$parent.$parent[$attrs.callback]()}catch(e){throw"No callback set on scope"}}]}}]),angular.module("directives").directive("sviScreenText",["$templateCache","$compile","$timeout","$sce","screenText","piwik",function($templateCache,$compile,$timeout,$sce,screenText,piwik){return{replace:!1,scope:{template:"@",identifier:"@",modal:"@",refId:"@",title:"@",eventName:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.id=php.uniqid("screenText"),svi.ng.defaultString($scope,$attrs,"template",""),svi.ng.defaultString($scope,$attrs,"identifier",""),svi.ng.defaultFalse($scope,$attrs,"modal"),svi.ng.defaultString($scope,$attrs,"refId",$scope.id),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"eventName",""),$scope.text=!1,this.getLoader=svi.ng.getLoaderFactory($element,$scope),this.load=function(){if(!$scope.template||!$scope.identifier)return!1;var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)};var loadCallback=function(){return $scope.text=!1,screenText.getText($scope.template,$scope.identifier)},onSuccess=function(response){piwik.trackPage("screenText","Screen Text",1e3*response._loaderMetadata.elapsedTime,[{name:"template",value:$scope.template},{name:"identifier",value:$scope.identifier}]),angular.isString(response.screenText)&&($scope.text=$sce.trustAsHtml(response.screenText))},onError=function(reason){piwik.trackPage("screenText/error","Error: Screen Text",!1,[{name:"template",value:$scope.template},{name:"identifier",value:$scope.identifier}])};$scope.api=this,$timeout(function(){$scope.api.load()},200)}],link:function($scope,$element,$attrs){var template=$templateCache.get("screenText/screenText"+($scope.modal?"Modal":"")+".tpl.html");$element.html(template).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviShowInputErrors",["$timeout",function($timeout){return{restrict:"A",require:"^form",scope:{name:"@sviShowInputErrors",showSuccess:"@",addFeedback:"@",additionalScope:"=",showImmediately:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"name",!1),svi.ng.defaultFalse($scope,$attrs,"showSuccess"),svi.ng.defaultTrue($scope,$attrs,"addFeedback"),svi.ng.defaultFalse($scope,$attrs,"showImmediately"),$scope.errors={errorCount:0}}],link:function($scope,$element,$attrs,formCtrl){var inputEl;$scope.formCtrl=formCtrl,!1!==$scope.name?(inputEl=$element.find("input[name="+$scope.name+"]").first()).length||(inputEl=$element.find("select[name="+$scope.name+"]").first()):(inputEl=$element.find("input[name]").first()).length||(inputEl=$element.find("select[name]").first());var inputNgEl=angular.element(inputEl);$scope.modelCtrl=inputNgEl.controller("ngModel");var inputName=inputNgEl.attr("name");$scope.modelCtrl&&!$scope.modelCtrl.$name&&($scope.modelCtrl.$name=inputName),$timeout(function(){for(var x in $element.toggleClass("has-error has-warning"+($scope.addFeedback?" has-feedback":"")+($scope.showSuccess?" has-success":""),!1),$element.find(".on-error").toggle(!1),$element.find(".on-warning").toggle(!1),formCtrl[inputName].$error)formCtrl[inputName].$error.hasOwnProperty(x)&&$element.find(".on-error-"+x).toggle(!1)});var evaluateErrorExpression=function(expression){try{var value=$scope.$eval(expression);return!(!angular.isDefined(value)||!value)}catch(e){return!1}};$scope.checkErrors=function(newValue,oldValue){if(!angular.isDefined(oldValue)||newValue!==oldValue){var isDirty=$scope.showImmediately||formCtrl[inputName].$dirty,isTouched=$scope.showImmediately||formCtrl[inputName].$touched,hasError=formCtrl[inputName].$invalid,hasWarning=!1;for(var x in $scope.errors={errorCount:0},formCtrl[inputName].$error)formCtrl[inputName].$error.hasOwnProperty(x)&&($scope.errors[x]=formCtrl[inputName].$error[x],$scope.errors[x]&&$scope.errors.errorCount++);$element.find(".on-error").each(function(i){var attr=$(this).attr("data-on-error");attr?$(this).toggle((isDirty||isTouched)&&evaluateErrorExpression(attr)):$(this).toggle((isDirty||isTouched)&&hasError)}),hasError?$element.find(".on-warning").toggle(!1):$element.find(".on-warning").each(function(i){var attr=$(this).attr("data-on-warning");if(attr){var showWarning=(isDirty||isTouched)&&evaluateErrorExpression(attr);$(this).toggle(showWarning),showWarning&&(hasWarning=!0)}}),$element.toggleClass("has-error",(isDirty||isTouched)&&hasError),$element.toggleClass("has-warning",(isDirty||isTouched)&&hasWarning),$element.toggleClass("has-success",(isDirty||isTouched)&&!hasWarning&&!hasError),$scope.addFeedback&&$element.toggleClass("has-feedback",(isDirty||isTouched)&&(hasError||hasWarning))}},$scope.formCtrl.hasOwnProperty(inputName)||$scope.modelCtrl?($scope.formCtrl.hasOwnProperty(inputName)&&$scope.$watchGroup(["formCtrl."+inputName+".$valid","formCtrl."+inputName+".$dirty","formCtrl."+inputName+".$touched"],$scope.checkErrors),$scope.modelCtrl&&($scope.modelCtrl.$viewChangeListeners.push($scope.checkErrors),$scope.modelCtrl.$validators.showInputErrors=function(modelValue,viewValue){return $timeout($scope.checkErrors),!0})):(inputNgEl.on("keyup",$scope.checkErrors),inputNgEl.on("change",$scope.checkErrors),inputNgEl.on("blur",$scope.checkErrors)),$timeout($scope.checkErrors),$scope.$watch("additionalScope",function(newVal){if(angular.isObject(newVal)){for(var x in newVal)newVal.hasOwnProperty(x)&&($scope[x]=newVal[x]);$timeout($scope.checkErrors)}})}}}]),angular.module("directives").directive("sviSkipLink",["$timeout",function($timeout){return{replace:!1,scope:{target:"@sviSkipLink",backupTarget:"@",tabindex:"@",callback:"="},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"sviSkipLink"),svi.ng.defaultString($scope,$attrs,"backupTarget",""),svi.ng.defaultString($scope,$attrs,"tabindex","0")}catch(e){throw"sviSkipLink: "+e}$scope.onActivate=function(evt){"keypress"==evt.type&&13!=evt.which&&32!=evt.which||(evt.stopPropagation(),evt.preventDefault(),angular.isFunction($scope.callback)&&!1===$scope.callback()||$timeout(function(){var target=svi.$($scope.target).first();!target.length&&$scope.backupTarget&&(target=svi.$($scope.backupTarget).first()),target.length&&(target.attr("tabindex")||target.attr("tabindex",-1),target.first().focus())}))}}],link:function($scope,$element,$attrs){$element.on("click",$scope.onActivate),$element.on("keypress",$scope.onActivate),$element.addClass("svi-skip-link"),$element.attr("tabindex")||$element.attr("tabindex",$scope.tabindex),$element.is("a")&&!$element.attr("href")&&$element.attr("href","")}}}]),angular.module("directives").directive("sviStateSet",["state",function(state){return{replace:!1,scope:{stateId:"@",value:"@",onlyIfEmpty:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"stateId"),svi.ng.required($attrs,"value",!0),svi.ng.defaultTrue($scope,$attrs,"onlyIfEmpty")}catch(e){throw"sviStateSet: "+e}if(!$attrs.onlyIfEmpty||null===state.get($attrs.stateId)){var value=$attrs.value;try{value=JSON.parse($attrs.value)}catch(e){}state.set($attrs.stateId,value)}}]}}]),angular.module("directives").directive("sviSymbol",["$templateCache","APP_CONFIG","$popover","$tooltip","labels","eventDispatcher","$filter","$timeout",function($templateCache,APP_CONFIG,$popover,$tooltip,labels,eventDispatcher,$filter,$timeout){return{replace:!1,scope:{instrument:"=?",instrumentJson:"@",symbol:"<?",symbolString:"@",displayLength:"@",placement:"@",container:"@",isUnitPrice:"@",manualPopoverPositionUpdate:"@"},template:$templateCache.get("symbol/symbol.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.id=php.uniqid("symbol");try{svi.ng.defaultString($scope,$attrs,"symbolString",""),svi.ng.defaultInt($scope,$attrs,"displayLength",10),svi.ng.defaultString($scope,$attrs,"placement","top"),svi.ng.defaultString($scope,$attrs,"container",".svi-bs .modals-section"),svi.ng.defaultTrue($scope,$attrs,"manualPopoverPositionUpdate"),svi.ng.defaultFalse($scope,$attrs,"isUnitPrice")}catch(e){throw"sviSymbol: "+e}if(""===$scope.symbolString||!angular.isUndefined($scope.symbol)&&angular.isString($scope.symbol)&&""!==$scope.symbol||($scope.symbol=$scope.symbolString),angular.isUndefined($scope.symbol)||!angular.isString($scope.symbol)||""===$scope.symbol){if(!$scope.instrument&&angular.isString($attrs.instrumentJson)&&""!==$attrs.instrumentJson){try{$scope.instrumentJson=$attrs.instrumentJson=JSON.parse($attrs.instrumentJson)}catch(e){throw"sviSymbol: Error parsing instrumentJson: "+e}$scope.instrument=$scope.instrumentJson}$scope.instrument||($scope.instrument={symbol:$scope.symbol,investmentType:angular.isString($scope.symbol)&&5==$scope.symbol.length&&"X"==$scope.symbol[4]?"MutualFund":"Stock",canQuote:angular.isString($scope.symbol)&&""!==$scope.symbol}),!$scope.instrument.investmentType&&$scope.instrument.securityType&&($scope.instrument.investmentType=$scope.instrument.securityType),"CommonStock"==$scope.instrument.investmentType&&($scope.instrument.investmentType="Stock")}else{var updateInstrument=function(){$scope.instrument={symbol:$scope.symbol,investmentType:5==$scope.symbol.length&&"X"==$scope.symbol[4]?"MutualFund":"Stock",canQuote:!0}};updateInstrument(),$scope.$watch("symbol",updateInstrument)}var isCusip=!1,isSecNbr=!1,isShortName=!1;if(null===$scope.instrument.symbol||angular.isString($scope.instrument.symbol)&&""===$scope.instrument.symbol.trim()?!$scope.instrument.cusip||angular.isString($scope.instrument.cusip)&&!$scope.instrument.cusip.trim()?!$scope.instrument.secNbr||angular.isString($scope.instrument.secNbr)&&!$scope.instrument.secNbr.trim()?!$scope.instrument.shortName||angular.isString($scope.instrument.shortName)&&!$scope.instrument.shortName.trim()||($scope.instrument.symbol=$filter("sviTitleCase")($scope.instrument.shortName),isShortName=!0):($scope.instrument.symbol=$scope.instrument.secNbr,isSecNbr=!0):($scope.instrument.symbol=$scope.instrument.cusip,isCusip=!0):(isCusip=$scope.instrument.cusip==$scope.instrument.symbol||svi.ng.symbol.isCUSIP($scope.instrument.symbol),isSecNbr=$scope.instrument.secNbr==$scope.instrument.symbol),$scope.showHover=$scope.instrument.canQuote&&""!==$scope.instrument.symbol&&!isCusip&&!isSecNbr&&!isShortName,$scope.showHover?$scope.cls="marketHoverOver":$scope.cls="",$scope.showHover&&"popover"==APP_CONFIG.hoverQuote){$scope.cls="";var getQuoteCtrl=svi.ng.getControllerFactory("#"+$scope.id+"-popover",$scope,"svi-detailed-quote");labels.setupLabels($scope,["general"],{}),$scope.isQuoteShown=!1,this.showQuote=function(){eventDispatcher.trigger("POPOVER.HIDE","ALL"),$scope.isQuoteShown?$scope.api.hideQuote():$scope.api.getPopover().$promise.then(function(){$scope.popover.show();var ctrl=getQuoteCtrl();ctrl&&ctrl.setSymbol($scope.instrument.symbol),$timeout(function(){$scope.popover.$element.find(".aria-quote-target").focus()},1e3),$timeout(function(){$scope.popover.$applyPlacement()})})},this.hideQuote=function(){$scope.api.getPopover().$promise.then($scope.popover.hide)},eventDispatcher.on("POPOVER.QUOTE.LOADED",function(){$timeout(function(){$scope.popover&&$scope.popover.$applyPlacement()})}),$scope.popover=null,this.getPopover=function(){if($scope.popover)$scope.popover.$scope.title=$scope.instrument.symbol;else{var el=$element.find(".svi-symbol");$scope.popover=$popover(el,{container:"false"!==$scope.container&&$scope.container,placement:$scope.placement,trigger:"manual",autoClose:!1,title:$scope.instrument.symbol,templateUrl:"symbol/popover.tpl.html",id:$scope.id+"-popover",parentId:$scope.id,onShow:function(){$scope.isQuoteShown=!0},onHide:function(){$scope.isQuoteShown=!1}}),$scope.popover.$scope.id=$scope.id+"-popover",$scope.popover.$scope.parentId=$scope.id,$scope.popover.$scope.title=$scope.instrument.symbol,$scope.popover.$scope.api=$scope.api,$scope.popover.$scope.labels=$scope.labels}return $scope.popover}}else this.showQuote=function(){},this.hideQuote=function(){};$scope.isUnitPrice&&($scope.cls=$scope.cls+" label label-info"),$scope.api=this,eventDispatcher.on("POPOVER.HIDE",function(e,data){angular.isString(data)&&$scope.popover&&("ALL"==data||$scope.popover.$scope.id==data)&&$scope.api.hideQuote()})}]}}]),angular.module("directives").directive("sviTabs",["$timeout","$window","$templateCache","bsBreakpoint","eventDispatcher",function($timeout,$window,$templateCache,bsBreakpoint,eventDispatcher){return{replace:!1,transclude:!0,scope:{minHeight:"@",watch:"=?",arrowsEnabled:"@",indicatorsEnabled:"@",tabClass:"@",autoHeight:"@"},template:$templateCache.get("tabs/tabs.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultInt($scope,$attrs,"minHeight",0,null,0),svi.ng.defaultTrue($scope,$attrs,"arrowsEnabled"),svi.ng.defaultFalse($scope,$attrs,"indicatorsEnabled"),svi.ng.defaultString($scope,$attrs,"tabClass",""),svi.ng.defaultFalse($scope,$attrs,"autoHeight"),$scope.tabs=[],$scope.active=0,$scope.maxHeight=0,$scope.isMobile=bsBreakpoint.isMobile,$scope.api=this}],link:function($scope,$element,$attrs,ctrl){var items=$element.find(".carousel-inner").children();$scope.api.updateTabs=function(){$scope.tabs=[];var firstTab=!0;(items=$element.find(".carousel-inner").children()).each(function(index,item){item=angular.element(item);items.length;var title=item.attr("data-tab-title");title||(title="Tab "+index);var tabId=item.attr("data-tab-id");tabId||(tabId=title);var hiddenDesktop=item.attr("data-hidden-desktop"),hiddenMobile=item.attr("data-hidden-mobile"),tab={title:title,id:tabId,hidden:bsBreakpoint.isMobile()&&svi.ng.strToBoolean(hiddenMobile,!1)||!bsBreakpoint.isMobile()&&svi.ng.strToBoolean(hiddenDesktop,!1)||item.hasClass("hidden")||item.hasClass("ng-hide")};$scope.tabs.push(tab),!$scope.arrowsEnabled||tab.hidden?item.removeClass("control-padding-left"):firstTab?(firstTab=!1,item.removeClass("control-padding-left")):item.addClass("control-padding-left"),index===$scope.active&&(tab.hidden?$scope.selectTab(index+1):item.addClass("active"))});for(var lastTab=!0,i=items.length-1;0<=i;i--){var item=angular.element(items[i]),tab=$scope.tabs[i];!$scope.arrowsEnabled||tab.hidden?item.removeClass("control-padding-right"):lastTab?(lastTab=!1,item.removeClass("control-padding-right")):item.addClass("control-padding-right")}$scope.$applyAsync()};var delayUpdateTabs=function(){$timeout($scope.api.updateTabs)};$timeout(function(){$element.addClass("slide"),$element.carousel({interval:!1,wrap:!1,keyboard:!1}),$scope.api.updateTabs(),$scope.$watch("isMobile()",delayUpdateTabs),$scope.$watch("watch",delayUpdateTabs)}),$scope.api.calculateHeight=function(){var maxHeight;$scope.autoHeight?$scope.carouselInnerStyle={height:"auto !important"}:($scope.maxHeight=(maxHeight=$scope.minHeight,items.each(function(index,item){var height=(item=angular.element(item)).height();maxHeight<height&&(maxHeight=height)}),maxHeight+($scope.indicatorsEnabled?20:0)),$scope.carouselInnerStyle={height:$scope.maxHeight+"px"})},eventDispatcher.on("LOADER.ALL_DONE",$scope.api.calculateHeight,null,$element),eventDispatcher.on("RESIZE",$scope.api.calculateHeight,null,$element),$scope.api.selectTab=$scope.selectTab=function(tabIndex){try{tabIndex!==$scope.active&&0<=tabIndex&&tabIndex<=$scope.tabs.length&&($scope.active=tabIndex,eventDispatcher.trigger("ACTIVE.TAB.CHANGED",{tabs:$scope.tabs[$scope.active]}),$element.carousel(tabIndex),$window.dispatchEvent(new Event("resize"))),$timeout($scope.api.calculateHeight)}catch(err){}},$scope.isAtBeginning=function(){if(0===$scope.active)return!0;for(var i=0,l=$scope.tabs.length;i<l;i++)if(!$scope.tabs[i].hidden)return $scope.active===i},$scope.isAtEnd=function(){if($scope.active===$scope.tabs.length-1)return!0;for(var i=$scope.tabs.length-1;0<=i;i--)if(!$scope.tabs[i].hidden)return $scope.active===i},$scope.previous=function(){eventDispatcher.trigger("TAB.CHANGED.PREVIOUS",{}),$scope.active&&$scope.selectTab($scope.active-1)},$scope.next=function(){eventDispatcher.trigger("TAB.CHANGED.NEXT",{}),$scope.active<$scope.tabs.length-1&&$scope.selectTab($scope.active+1)},$timeout($scope.selectTab,200)}}}]),angular.module("directives").directive("sviTags",["$templateCache","$timeout","labels","tags","bloodhound","$sce",function($templateCache,$timeout,labels,tags,bloodhound,$sce){return{replace:!1,scope:{symbol:"@",displayInline:"@",tags:"=?"},template:$templateCache.get("tags/tags.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultFalse($scope,$attrs,"displayInline"),$scope.editable=!1,$scope.queryTags=angular.noop,labels.setupLabels($scope,["tags"],{addTag:"Add Tag",clickToEditTags:"Click to Edit Tags",saveAndEndEditTooltip:"Save Current Entry and Close Tag Editor",endEditTooltip:"Close Tag Editor"}),$scope.resumeWatch=function(){$scope.pauseWatch=$scope.$watch("tags",function(newValue,oldValue){var tag;angular.isArray(newValue)||($scope.tags=newValue=[]),angular.isArray(oldValue)||(oldValue=[]),newValue.length>oldValue.length?(tag=php.array_values(php.array_diff(newValue,oldValue))[0],tags.addSymbol(tag,$scope.symbol)):newValue.length<oldValue.length&&(tag=php.array_values(php.array_diff(oldValue,newValue))[0],tags.removeSymbol(tag,$scope.symbol))},!0)},$scope.resumeWatch(),$scope.tags&&angular.isArray($scope.tags)||($scope.tags=[],$scope.symbol&&tags.getBySymbol($scope.symbol).then(function(data){200==data.status&&data.data.success&&($scope.pauseWatch(),$scope.tags=data.data.tags,$scope.resumeWatch())})),$scope.getValue=function(item){return item.toLowerCase()},$scope.getText=function(item){return item},$scope.getTagClass=function(tag){return"label label-info"},$scope.tagsToHtml=function(){var output="&nbsp;";return angular.isArray($scope.tags)&&$scope.tags.length&&(output=$scope.tags.join(", ")),$sce.trustAsHtml(output),output},$scope.updateTooltip=function(){var tooltip,elements=$element.find(".tags-button");elements.tooltip("destroy"),tooltip=angular.isArray($scope.tags)&&0<$scope.tags.length?"<strong>"+$scope.tagsToHtml()+"</strong><br/><br/>"+$scope.labels.clickToEditTags:$scope.labels.clickToEditTags,elements.tooltip({title:tooltip,trigger:"hover",html:!0})},$scope.startEdit=function($event){$event.stopPropagation();var engine=bloodhound.create({prefetch:{url:"/Web/util/tags",thumbprint:php.uniqid(),filter:function(data){return data.success?data.tags:[]},ajax:{dataType:"json"}}});$scope.queryTags=engine.ttAdapter(),$scope.editable=!0,$scope.displayInline||($element.find(".svi-popover").show(),$timeout(function(){$element.find(".svi-popover").position({my:"right bottom",at:"right top",of:$element.find("button")[0]}),$element.find("select").tagsinput("focus")},100))},$scope.saveAndEndEdit=function($event){try{var el=$element.find("select"),value=el.tagsinput("input")[0].value;value&&el.tagsinput("add",value)}catch(e){}$scope.endEdit($event)},$scope.endEdit=function($event){$event.stopPropagation(),$scope.editable=!1,$scope.displayInline||$element.find(".svi-popover").hide(),$scope.updateTooltip()}}],link:function($scope,$element,$attrs){$scope.displayInline||($scope.$watch("tags",$scope.updateTooltip),$timeout($scope.updateTooltip))}}}]),angular.module("directives").directive("sviTypeahead",["$templateCache","$timeout",function($templateCache,$timeout){return{replace:!1,scope:{source:"=",placeholder:"@",value:"@",highlight:"@",hint:"@",minLength:"@",id:"@",name:"@",dataName:"@",displayKey:"@",templates:"=?",showOnFocus:"@",capitalize:"@",cls:"@",required:"@",comm:"=?",ariaLabel:"@",type:"@",disabled:"@"},require:"?ngModel",template:$templateCache.get("typeahead/sviTypeahead.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"source"),svi.ng.defaultString($scope,$attrs,"placeholder",""),svi.ng.defaultString($scope,$attrs,"value",""),svi.ng.defaultFalse($scope,$attrs,"highlight"),svi.ng.defaultTrue($scope,$attrs,"hint"),svi.ng.defaultInt($scope,$attrs,"minLength",1),svi.ng.defaultString($scope,$attrs,"id",php.uniqid("typeahead")),svi.ng.defaultString($scope,$attrs,"name",$scope.id),svi.ng.defaultString($scope,$attrs,"dataName",$scope.id),svi.ng.defaultString($scope,$attrs,"displayKey","value"),svi.ng.defaultFalse($scope,$attrs,"showOnFocus"),svi.ng.defaultFalse($scope,$attrs,"capitalize"),svi.ng.defaultString($scope,$attrs,"cls","scrollable-dropdown"),svi.ng.defaultFalse($scope,$attrs,"required"),svi.ng.defaultString($scope,$attrs,"ariaLabel",$scope.placeholder),svi.ng.defaultString($scope,$attrs,"type","text"),svi.ng.defaultFalse($scope,$attrs,"disabled")}catch(e){throw"sviTypeahead: "+e}this.getId=function(){return $scope.id},this.getValue=function(){return $scope.value},this.setValue=function(value){$scope.capitalize&&angular.isString(value)?$scope.value=value.toUpperCase():$scope.value=value,this.typeahead("val",$scope.value)},this.typeahead=function(){var el=$element.find("#"+$scope.id);el.typeahead.apply(el,arguments)},this.showTypeahead=function(){if(angular.isString($scope.value)&&$scope.value.length>$scope.minLength&&$element.find(".tt-dropdown-menu").is(":hidden")){var ev=$.Event("keydown");ev.keyCode=ev.which=40,$element.find("#"+$scope.id).trigger(ev)}},this.hideTypeahead=function(){$element.find("#"+$scope.id).typeahead("close")},$scope.api=this,svi.ng.addCommWatch($scope),$timeout(function(){var datasets={name:$scope.displayName,displayKey:$scope.displayKey,source:$scope.source};$scope.templates&&(datasets.templates=$scope.templates),$element.find("#"+$scope.id).typeahead({hint:$scope.hint,highlight:$scope.highlight,minLength:$scope.minLength},datasets),$element.on("typeahead:opened",function(evt){var dropdown=$element.find(".tt-dropdown-menu");dropdown&&evt&&evt.currentTarget&&"fixed"==dropdown.css("position")&&dropdown.css("left",$(evt.currentTarget).offset().left)}),$element.on("typeahead:autocompleted typeahead:selected",function(evt,suggest,dataset){var value=$element.find("#"+$scope.id).typeahead("val");$scope.capitalize&&angular.isString(value)&&(value=value.toUpperCase()),$scope.$applyAsync(function(){$scope.value=value})}),$scope.showOnFocus&&$element.find("#"+$scope.id).on("focus",$scope.api.showTypeahead),$scope.ariaLabel&&$element.find("#"+$scope.id).attr("aria-label",$scope.ariaLabel)},200)}],link:function($scope,$element,$attrs,modelCtrl){$element.find("input:not(.tt-hint)").attr("name",$scope.name),modelCtrl&&(modelCtrl.$name=$scope.name,$scope.$watch("value",function(newValue,oldValue){newValue!==oldValue&&($scope.capitalize&&angular.isString($scope.value)&&$scope.api.setValue($scope.value.toUpperCase()),modelCtrl.$setViewValue($scope.value,"input"))}),modelCtrl.$render=function(){$scope.api.setValue(modelCtrl.$modelValue)})}}}]),angular.module("directives").directive("sviValidInteger",function(){return{require:"ngModel",link:function(scope,elm,attrs,ctrl){var INTEGER_REGEXP=/^\-?\d+$/,validator=function(value){return INTEGER_REGEXP.test(value)?(ctrl.$setValidity("integer",!0),!0):(ctrl.$setValidity("integer",!1),!1)};ctrl.$parsers.unshift(function(value){return validator(value)?value:undefined}),ctrl.$formatters.push(function(value){return validator(value),value})}}}),angular.module("directives").directive("sviVisibilityGroup",["$animate","eventDispatcher",function($animate,eventDispatcher){return{restrict:"A",multiElement:!0,link:function(scope,element,attr){var id=attr.sviVisibilityGroup,localId=php.uniqid(id),internalHide=!1,update=function(){$animate[internalHide?"addClass":"removeClass"](element,"ng-hide",{tempClasses:"ng-hide-animate"})},sviHideWatchAction=function(value){internalHide=value,id&&eventDispatcher.trigger("VIS_GROUP."+id+".UPDATE",{hide:value,source:localId}),update()};attr.hasOwnProperty("sviHide")&&(scope.$watch(attr.sviHide,sviHideWatchAction),sviHideWatchAction(attr.sviHide)),id&&eventDispatcher.on("VIS_GROUP."+id+".UPDATE",function(evt,data){angular.isObject(data)&&data.hasOwnProperty("hide")&&data.hasOwnProperty("source")&&data.source!=localId&&data.hide!=internalHide&&(internalHide=data.hide,update())},!0,element)}}}]),angular.module("directives").directive("sviDashboard",["$templateCache","$timeout","eventDispatcher","$filter","labels","dashboard","$window","$location","piwik","APP_CONFIG",function($templateCache,$timeout,eventDispatcher,$filter,labels,dashboard,$window,$location,piwik,APP_CONFIG){return{replace:!1,scope:{type:"@",id:"@",resource:"@",sections:"@",panelsEnabled:"@",maxColumns:"@",minColumns:"@"},template:$templateCache.get("dashboard/dashboard.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{for(var x in svi.ng.defaultString($scope,$attrs,"type","default"),svi.ng.defaultString($scope,$attrs,"id","1"),svi.ng.defaultTrue($scope,$attrs,"panelsEnabled"),svi.ng.defaultInt($scope,$attrs,"maxColumns",3),svi.ng.defaultInt($scope,$attrs,"minColumns",1),svi.ng.parseJSON($scope,$attrs,"resource"),svi.ng.parseJSON($scope,$attrs,"sections"),$scope.sections)$scope.sections.hasOwnProperty(x)&&($scope.sections[x].content=$filter("objectToHTML")($scope.sections[x].content))}catch(e){throw"sviDashboard: "+e}$scope.initComplete=!1,$scope.dragging=!1,labels.setupLabels($scope,["dashboard"],{}),$scope.sortableConfig={connectWith:".dashboard-"+$scope.type+"-"+$scope.id,"ui-floating":!1,handle:".drag-handle",containment:"body",placeholder:"sortable-placeholder",forcePlaceholderSize:!0,opacity:.4,tolerance:"pointer",scrollSensitivity:100,disabled:APP_CONFIG.viewMode,start:function(evt){$scope.$applyAsync("dragging = true"),$scope.resource.layout.length<$scope.maxColumns&&$scope.$applyAsync("resource.layout.push([])"),eventDispatcher.trigger("DASHBOARD.DRAGGING.START",evt)},stop:function(evt){$scope.$applyAsync("dragging = false"),eventDispatcher.trigger("DASHBOARD.DRAGGING.STOP",evt)}},$scope.getColumnClass=function(index){return $scope.resource.hasOwnProperty("classes")&&angular.isArray($scope.resource.classes)?$scope.resource.classes[index]:"col-sm-12 col-md-"+Math.floor(12/$scope.resource.layout.length)},$scope.getSectionClass=function(section){if(!section)return"hidden";var cls="";return section.hasOwnProperty("class")&&(cls+=section.class+" "),1==$scope.minColumns&&1==$scope.maxColumns&&section.hasOwnProperty("size")?cls+=section.size+" ":cls+="col-md-12 ",cls.trim()},$scope.setLoader=function(loader){$scope.loader=loader};var load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout(load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}},loadCallback=function(invalidateCache){return $("html,body").animate({scrollTop:0},0),dashboard.get($scope.type,$scope.id,invalidateCache)},onSuccess=function(response){$scope.resource=response.resource,piwik.trackPage("dashboard","Dashboard",1e3*response._loaderMetadata.elapsedTime)},onError=function(reason){piwik.trackPage("dashboard/error","Error: Dashboard")},insertZIndex=function(newValue){for(var currentSection=null,maxZIndex=0,i=newValue.layout.length-1;0<=i;i--){maxZIndex=newValue.layout[i].length;for(var j=0;j<newValue.layout[i].length;j++)null!=(currentSection=$("div[class*='"+newValue.layout[i][j]+"-outerContainer']"))&&0<currentSection.length&&currentSection.css("z-index",maxZIndex-j)}},dashboardUpdate=$.throttle(3e3,function(){dashboard.update($scope.type,$scope.id,$scope.resource)}),watchResourceTimeout=null,watchResource=function(newValue,oldValue){if(watchResourceTimeout&&($timeout.cancel(watchResourceTimeout),watchResourceTimeout=null),$timeout(function(){$element.find($scope.sortableConfig.handle).attr("tabindex",0).off("keydown").on("keydown",$scope.onKeypress)},100),$scope.dragging)return watchResourceTimeout=$timeout(watchResource,500);if(angular.isUndefined(newValue))newValue=$scope.resource,insertZIndex(newValue);else if(angular.equals(newValue,oldValue))return;for(var changed=!1,i=newValue.layout.length-1;0<=i;i--){for(var j=0;j<newValue.layout[i].length;j++)$scope.sections.hasOwnProperty(newValue.layout[i][j])||(changed=!0,newValue.layout[i].splice(j--,1));0===newValue.layout[i].length&&newValue.layout.length>$scope.minColumns&&(changed=!0,newValue.layout.splice(i,1))}if(changed)return $scope.resource=newValue,watchResourceTimeout=$timeout(watchResource,500);dashboardUpdate()};$scope.$watch("resource",watchResource,!0),$timeout(function(){$scope.initComplete=!0,$scope.resource||load(),insertZIndex($scope.resource)},400),eventDispatcher.on("DASHBOARD.REFRESH",function(){load(!0)}),eventDispatcher.on("DASHBOARD.RESET",function(){$window.location="?reset=true"});var findSection=function(section){var l,i=0,j=0,n=0;for(i=0,l=$scope.resource.layout.length;i<l;i++)for(j=0,n=$scope.resource.layout[i].length;j<n;j++)if($scope.resource.layout[i][j]==section)return[i,j];return!1},swap=function(a,b){var temp=$scope.resource.layout[a[0]][a[1]];$scope.resource.layout[a[0]][a[1]]=$scope.resource.layout[b[0]][b[1]],$scope.resource.layout[b[0]][b[1]]=temp},focusSection=function(section){$timeout(function(){var el=$element.find('[data-section="'+section+'"] '+$scope.sortableConfig.handle);el.scrollIntoView(-APP_CONFIG.navHeight,100,function(){$element.find('[data-section="'+section+'"] '+$scope.sortableConfig.handle).first().focus(),$timeout(function(){$element.find('[data-section="'+section+'"] '+$scope.sortableConfig.handle).first().focus()},100)}),el.first().focus()})};$scope.onKeypress=function(evt){var location,section=$(this).parents("[data-section]").attr("data-section");section?38==evt.which||87==evt.which?(evt.stopPropagation(),evt.preventDefault(),(location=findSection(section))&&$scope.$applyAsync(function(){if(0<location[1])swap(location,[location[0],location[1]-1]);else{var temp=$scope.resource.layout[location[0]].shift();$scope.resource.layout[location[0]].push(temp)}focusSection(section)})):40==evt.which||83==evt.which?(evt.stopPropagation(),evt.preventDefault(),(location=findSection(section))&&$scope.$applyAsync(function(){if(location[1]+1<$scope.resource.layout[location[0]].length)swap(location,[location[0],location[1]+1]);else{var temp=$scope.resource.layout[location[0]].pop();$scope.resource.layout[location[0]].unshift(temp)}focusSection(section)})):37==evt.which||65==evt.which?(evt.stopPropagation(),evt.preventDefault(),(location=findSection(section))&&$scope.$applyAsync(function(){var temp=$scope.resource.layout[location[0]].splice(location[1],1);0<location[0]?$scope.resource.layout[location[0]-1].push(temp[0]):$scope.resource.layout[$scope.resource.layout.length-1].push(temp[0]),focusSection(section)})):39!=evt.which&&68!=evt.which||(evt.stopPropagation(),evt.preventDefault(),(location=findSection(section))&&$scope.$applyAsync(function(){var temp=$scope.resource.layout[location[0]].splice(location[1],1);location[0]+1<$scope.resource.layout.length?$scope.resource.layout[location[0]+1].push(temp[0]):$scope.resource.layout[0].push(temp[0]),focusSection(section)})):console.warn("section not found")}}]}}]),angular.module("directives").directive("sviDisplayWidget",["APP_CONFIG","$templateCache","$filter","labels","sviUrl","eventDispatcher","$timeout","widget",function(APP_CONFIG,$templateCache,$filter,labels,sviUrl,eventDispatcher,$timeout,widget){return{replace:!1,transclude:{shortcuts:"?sviWidgetShortcuts"},scope:{titleText:"=?",titleTextPositive:"=?",titleTextNegative:"=?",titleTextUnchanged:"=?",titleTextMixed:"=?",heroLabel:"=?",heroValue:"=?",heroFilter:"@",leftLabel:"=?",leftValue:"=?",leftFilter:"@",rightLabel:"=?",rightValue:"=?",rightFilter:"@",defaultWidgetSize:"@",maxWidgetSize:"@",moreInfo:"=?",wrapContent:"@",comm:"=?"},template:$templateCache.get("displayWidget/base/displayWidget.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"heroFilter",""),svi.ng.defaultString($scope,$attrs,"leftFilter",""),svi.ng.defaultString($scope,$attrs,"rightFilter",""),svi.ng.defaultInt($scope,$attrs,"maxWidgetSize",APP_CONFIG.maxWidgetSize),svi.ng.parseJSON($scope,$attrs,"wrapContent"),$scope.wrapContent&&($scope.wrapContent=$attrs.wrapContent=$filter("objectToHTML")($scope.wrapContent),$timeout(function(){new MutationObserver($.debounce(1e3,function(){$scope.checkWidgetSize(),$scope.$applyAsync()})).observe($element.find(".list-group-item").get(0),{childList:!0,subtree:!0})})),$scope.leftShow=angular.isDefined($attrs.leftValue)&&""!==$attrs.leftValue&&null!==$attrs.leftValue,$scope.rightShow=angular.isDefined($attrs.rightValue)&&""!==$attrs.rightValue&&null!==$attrs.rightValue;var size=APP_CONFIG.defaultWidgetSize;($scope.leftShow||$scope.rightShow)&&(size+=2),svi.ng.defaultInt($scope,$attrs,"defaultWidgetSize",size)}catch(e){throw"sviDisplayWidget: "+e}labels.setupLabels($scope,["displayWidget"]),$scope.loader=null,widget.initSize($scope,$element),$scope.applyFilter=function(field){var filter=$scope[field+"Filter"],value=$scope[field+"Value"];return filter?$filter(filter)(value):value},$scope.overallStatus="unchanged";$scope.flipped=!1,this.flip=function(flipped){flipped=svi.ng.strToBoolean(flipped,!$scope.flipped),$scope.flipped=flipped},$scope.hideFront=!1,$scope.hideBack=!1,$scope.$watch("flipped",function(newVal){$scope.hideFront=!1,$scope.hideBack=!1,$timeout(function(){newVal?($scope.hideFront=!0,$scope.hideBack=!1):($scope.hideFront=!1,$scope.hideBack=!0)},600)}),$scope.toggleMoreInfo=function(){if("string"==typeof $scope.moreInfo)$scope.api.flip();else if("object"==typeof $scope.moreInfo&&$scope.moreInfo.hasOwnProperty("type"))switch($scope.moreInfo.type){case"link":if(!$scope.moreInfo.url)throw"sviDisplayWidget: MoreInfo link requires url";sviUrl.href($scope.moreInfo.url,$scope.moreInfo.target,$scope.moreInfo.specs);break;case"event":if(!$scope.moreInfo.event||!$scope.moreInfo.data)throw"sviDisplayWidget: MoreInfo event requires event and data";eventDispatcher.trigger($scope.moreInfo.event,$scope.moreInfo.data);break;default:throw"sviDisplayWidget: Invalid MoreInfo Type"}},$scope.listMode=!1,$scope.$watchGroup(["heroValue","leftValue","rightValue"],function(newVal,oldVal){$scope.listMode=angular.isArray($scope.heroValue)||$scope.wrapContent,0<$scope.heroValue?$scope.leftShow&&$scope.leftValue<0||$scope.rightShow&&$scope.rightValue<0?$scope.overallStatus="mixed":$scope.overallStatus="positive":$scope.heroValue<0?$scope.leftShow&&0<$scope.leftValue||$scope.rightShow&&0<$scope.rightValue?$scope.overallStatus="mixed":$scope.overallStatus="negative":$scope.overallStatus="unchanged",$scope.overallStatus,$scope.checkWidgetSize(100)}),$scope.handleListClick=function(item){$scope.$parent.hasOwnProperty("handleListClick")&&angular.isFunction($scope.$parent.handleListClick)&&$scope.$parent.handleListClick(item)},this.getTitleText=function(){return $scope.titleText},this.setTitleText=function(text){return $scope.$applyAsync(function(){$scope.titleText=text}),this},this.getHeroValue=function(){return $scope.heroValue},this.setHeroValue=function(value){return $scope.$applyAsync(function(){$scope.heroValue=value}),this},this.getHeroFilter=function(){return $scope.heroFilter},this.setHeroFilter=function(filter){return $scope.$applyAsync(function(){$scope.heroFilter=filter}),this},this.getLeftValue=function(){return $scope.leftValue},this.setLeftValue=function(value){return $scope.$applyAsync(function(){$scope.leftValue=value}),this},this.getLeftFilter=function(){return $scope.leftFilter},this.seLeftFilter=function(filter){return $scope.$applyAsync(function(){$scope.leftFilter=filter}),this},this.getLeftShow=function(){return $scope.leftShow},this.setLeftShow=function(show){return $scope.$applyAsync(function(){$scope.leftShow=show}),this},this.getRightValue=function(){return $scope.rightValue},this.setRightValue=function(value){return $scope.$applyAsync(function(){$scope.rightValue=value}),this},this.getRightFilter=function(){return $scope.rightFilter},this.setRightFilter=function(filter){return $scope.$applyAsync(function(){$scope.rightFilter=filter}),this},this.getRightShow=function(){return $scope.rightShow},this.setRightShow=function(show){return $scope.$applyAsync(function(){$scope.rightShow=show}),this},this.getLoader=svi.ng.getLoaderFactory($element,$scope),$scope.api=this,svi.ng.addCommWatch($scope)}]}}]),angular.module("directives").directive("sviCompanyLinksDisplayWidget",["$templateCache","$timeout","labels","siteMessages","$sce","piwik",function($templateCache,$timeout,labels,siteMessages,$sce,piwik){return{replace:!1,scope:{},template:$templateCache.get("displayWidget/companyLinks/companyLinks.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.messages=null,$scope.list=!1,labels.setupLabels($scope,["companyLinksDisplayWidget"]);var loadCallback=function(){return siteMessages.getMessages("links")},onSuccess=function(response){if(piwik.trackPage("companyLinks","Company Links",1e3*response._loaderMetadata.elapsedTime),$scope.messages=response.messages,angular.isArray($scope.messages)){$scope.list=[];for(var i=0;i<$scope.messages.length;i++)$sce.trustAsHtml($scope.messages[i]),$scope.list.push({value:$scope.messages[i],cls:""})}},onError=function(reason){};this.getLoader=svi.ng.getLoaderFactory($element.find(".svi-display-widget"),$scope,"loader"),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)},$scope.api=this,$timeout(function(){$scope.messages||$scope.api.load()},400)}]}}]),angular.module("directives").directive("sviCompanyNewsDisplayWidget",["$templateCache","$timeout","labels","siteMessages","$sce","piwik",function($templateCache,$timeout,labels,siteMessages,$sce,piwik){return{replace:!1,scope:{},template:$templateCache.get("displayWidget/companyNews/companyNews.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.messages=null,$scope.list=!1,labels.setupLabels($scope,["companyNewsDisplayWidget"]);var loadCallback=function(){return siteMessages.getMessages("news")},onSuccess=function(response){if(piwik.trackPage("companyNews","Company News",1e3*response._loaderMetadata.elapsedTime),$scope.messages=response.messages,angular.isArray($scope.messages)){$scope.list=[];for(var i=0;i<$scope.messages.length;i++)$sce.trustAsHtml($scope.messages[i]),$scope.list.push({value:$scope.messages[i],cls:""})}},onError=function(reason){};this.getLoader=svi.ng.getLoaderFactory($element.find(".svi-display-widget"),$scope,"loader"),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)},$scope.api=this,$timeout(function(){$scope.messages||$scope.api.load()},400)}]}}]),angular.module("directives").directive("sviCompanyResearchDisplayWidget",["$templateCache","$timeout","labels","$sce","config","accountList","piwik",function($templateCache,$timeout,labels,$sce,config,accountList,piwik){return{replace:!1,scope:{},template:$templateCache.get("displayWidget/companyResearch/companyResearch.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.list=!1,labels.setupLabels($scope,["companyResearchDisplayWidget"]);var loadCallback=function(){return config.getConfigWithSubs(["dashboard","companyResearchLinks"],{ACCOUNT:accountList.getCurrentAccount()})},onSuccess=function(data){if(piwik.trackPage("companyResearch","Company Research",1e3*data._loaderMetadata.elapsedTime),$scope.list=[],angular.isObject(data.config)&&0!==data.config.length)for(var key in data.config)$sce.trustAsHtml(data.config[key].url),$scope.list.push({value:data.config[key].url,cls:"companyResearch"})},onError=function(reason){};this.getLoader=svi.ng.getLoaderFactory($element.find(".svi-display-widget"),$scope,"loader"),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)},$scope.api=this,$timeout(function(){$scope.messages||$scope.api.load()},400)}]}}]),angular.module("directives").directive("sviMarketHeadlinesDisplayWidget",["$templateCache","$timeout","labels","exchange","$sce","piwik",function($templateCache,$timeout,labels,exchange,$sce,piwik){return{replace:!1,scope:{limit:"@"},template:$templateCache.get("displayWidget/marketHeadlines/marketHeadlines.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultInt($scope,$attrs,"limit",0,null,0),$scope.news=null,$scope.newsStoryId=!1,$scope.newsStoryHeadline="",$scope.newsStory=null,$scope.list=!1,$scope.moreInfo=!1,labels.setupLabels($scope,["marketHeadlinesDisplayWidget"]),$scope.handleListClick=function(item){if(angular.isDefined(item)&&($scope.api.showModal(),$scope.newsStoryId=item.storyID,$scope.newsStoryHeadline=item.value,$scope.newsStory=null),$scope.newsStoryId){var loader=$scope.api.getModalLoader();loader?loader.setLoadHandler(loadModalCallback).load().then(onModalSuccess,onError):$timeout($scope.handleListClick,400)}};var loadCallback=function(){return exchange.getNews($scope.limit)},onSuccess=function(response){piwik.trackPage("marketHeadlines","Market Headlines",1e3*response._loaderMetadata.elapsedTime),$scope.news=response.news;var news=$scope.news.newsItems;if(angular.isArray(news)){$scope.list=[];for(var i=0;i<news.length;i++)news[i].value=news[i].headline,news[i].cls="pointer",$scope.list.push(news[i])}},onError=function(reason){},loadModalCallback=function(){return exchange.getNewsStory($scope.newsStoryId)},onModalSuccess=function(data){try{$scope.newsStory=data.newsStory.newsItems[0].story}catch(e){$scope.newsStory='<div class="alert alert-danger">'+labels.marketHeadlinesStoryError+"</div>"}$sce.trustAsHtml($scope.newsStory)};this.getLoader=svi.ng.getLoaderFactory($element.find(".svi-display-widget"),$scope,"loader"),this.getModalLoader=svi.ng.getLoaderFactory($element.find(".modal"),$scope,"modalLoader"),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)},this.showModal=function(){$element.find(".modal").modal("show")},this.hideModal=function(){$element.find(".modal").modal("hide")},$scope.api=this,$timeout(function(){$scope.news||$scope.api.load()},400)}]}}]),angular.module("directives").directive("sviMarketsDisplayWidget",["APP_CONFIG","$templateCache","$compile","$timeout","labels","symbol","navigation","eventDispatcher","piwik","calendar",function(APP_CONFIG,$templateCache,$compile,$timeout,labels,symbol,navigation,eventDispatcher,piwik,calendar){return{replace:!1,scope:{template:"@",reloadEvery:"@",openTime:"@",closeTime:"@",marketClockActive:"@",showFuturesLabel:"@",showDji:"@",symbolFormat:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"template",""),svi.ng.defaultInt($scope,$attrs,"reloadEvery",0),svi.ng.defaultString($scope,$attrs,"openTime","09:30"),svi.ng.defaultString($scope,$attrs,"closeTime","16:00"),svi.ng.defaultTrue($scope,$attrs,"showDji"),svi.ng.defaultTrue($scope,$attrs,"marketClockActive"),svi.ng.defaultTrue($scope,$attrs,"showFuturesLabel"),svi.ng.defaultValidString($scope,$attrs,"symbolFormat",["ticker","ric"],"ric")}catch(e){throw"sviMarketsDisplayWidget: "+e}piwik.trackPage("marketsDisplayWidget","Markets Display Widget"),$scope.reloadTimeout=null,$scope.quotes=[],$scope.dji=!1,$scope.nasdaq=!1,$scope.sp=!1,$scope.delayed=!APP_CONFIG.rtqEnabled;var date=moment().format("YYYY-MM-DD");$scope.isClosed=calendar.isPreMarketHours($scope.openTime)||calendar.isWeekend(date)||calendar.isHoliday(date,!0);var futures=["1MYMc1","EScv1","NQc1"],indexes=[".DJI",".INX",".IXIC"],indexMapping=["dji","sp","nasdaq"];labels.setupLabels($scope,["general","marketsDisplayWidget"]);var loadCallback=function(invalidateCache){return $scope.isClosed?symbol.getQuote(futures,$scope.delayed,$scope.symbolFormat,invalidateCache,!0):symbol.getQuote(indexes,$scope.delayed,$scope.symbolFormat,invalidateCache)};this.scheduleReload=function(delay){null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout),$scope.reloadTimeout=$timeout(function(){$scope.api.load(!0)},delay)},$element.on("$destroy",function(){$scope.reloadEvery=!1,null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout)});var onSuccess=function(data){$scope.reloadEvery&&$scope.api.scheduleReload(1e3*$scope.reloadEvery),data.symbolQuote&&data.symbolQuote.instrumentQuotes&&($scope.quotes=data.symbolQuote.instrumentQuotes,$scope.quotes.forEach(function(item,index){$scope[indexMapping[index]]=item.quote}))},onError=function(reason){};this.getLoader=svi.ng.getLoaderFactory($element,$scope),this.load=function(invalidateCache){angular.isUndefined(invalidateCache)&&(invalidateCache=!1);var loader=$scope.api.getLoader();if(loader){if(loader.showSpinner)return;$scope.reloadTimeout=null,loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}else $scope.api.scheduleReload(400)},eventDispatcher.on("MARKETS.RELOAD.DATA",function(){$scope.api.scheduleReload(400),$scope.isClosed=calendar.isPreMarketHours($scope.openTime)||calendar.isWeekend(date)||calendar.isHoliday(date,!0)},!0),$scope.api=this,$timeout(function(){$scope.quotes.length||$scope.api.load()},400)}],link:function($scope,$element){$element.html($templateCache.get("displayWidget/markets/markets"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviPortfolioPctChangeDisplayWidget",["$templateCache","$timeout","labels","totalPortfolioMovers","navigation","piwik",function($templateCache,$timeout,labels,totalPortfolioMovers,navigation,piwik){return{replace:!1,scope:{},template:$templateCache.get("displayWidget/portfolioPctChange/portfolioPctChange.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.summary=null,$scope.heroValue=!1,$scope.moreInfo={type:"link",url:""};var moreInfoCallback=function(response){response.data.success?$scope.moreInfo.url=svi.url.getHost()+response.data.url:getMoreInfoUrl()},getMoreInfoUrl=function(){navigation.getLaminasUrl(["multiAccountPortfolioSummary",{action:"index"}]).then(moreInfoCallback)};getMoreInfoUrl(),labels.setupLabels($scope,["portfolioPctChangeDisplayWidget"]);var loadCallback=function(){return totalPortfolioMovers.getAllAccountsSummary("all",{switchAccounts:"N"})},onSuccess=function(response){piwik.trackPage("portfolioPctChangeDisplayWidget","Portfolio % Change Display Widget",1e3*response._loaderMetadata.elapsedTime),$scope.summary=response.totalPortfolioMovers,$scope.heroValue=$scope.summary.percentChange},onError=function(reason){};this.getLoader=svi.ng.getLoaderFactory($element,$scope),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)},$scope.api=this,$timeout(function(){$scope.summary||$scope.api.load()},400)}]}}]),angular.module("directives").directive("sviWidget",["APP_CONFIG","$templateCache","$timeout","widget",function(APP_CONFIG,$templateCache,$timeout,widget){return{replace:!1,transclude:{frontBody:"sviWidgetFront",backBody:"?sviWidgetBack",shortcuts:"?sviWidgetShortcuts"},scope:{title:"<",mode:"@",selector:"@",minSize:"@",maxSize:"@",unitSize:"@",includeLoader:"@",widgetClasses:"@",observeChanges:"@",message:"<?",hidden:"<?"},template:$templateCache.get("widget/widget.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultValidString($scope,$attrs,"mode",["body","wrapper"],"body"),svi.ng.defaultString($scope,$attrs,"selector","*FLIPPED*"),svi.ng.defaultInt($scope,$attrs,"minSize",APP_CONFIG.defaultWidgetSize),svi.ng.defaultInt($scope,$attrs,"maxSize",APP_CONFIG.maxWidgetSize),svi.ng.defaultInt($scope,$attrs,"unitSize",APP_CONFIG.widgetUnitSize),svi.ng.defaultTrue($scope,$attrs,"includeLoader"),svi.ng.defaultString($scope,$attrs,"widgetClasses","list-style"),svi.ng.defaultString($scope,$attrs,"message",""),svi.ng.defaultFalse($scope,$attrs,"observeChanges")}catch(e){throw"sviWidget: "+e}$scope.hidden=!1,widget.initSize($scope,$element,function(){var selector=$scope.selector.replace("*FLIPPED*",$scope.flipped?".back":".front");return $element.find(selector).height()},$scope.minSize,$scope.maxSize,$scope.unitSize),this.checkWidgetSize=$scope.checkWidgetSize;var checkSizeFn=function(){$scope.checkWidgetSize(100)};$scope.loader=null,this.setLoader=function(loader){$scope.loader=loader,$scope.loader.addOnSuccess(checkSizeFn)},this.getLoader=function(){return $scope.loader},$scope.$watch("loader.showSpinner",checkSizeFn),this.addWatch=function(expression){$scope.$watch(expression,checkSizeFn)},this.setScopeVar=function(key,value){$scope[key]=value},$scope.flipped=!1,this.flip=function(flipped){flipped=svi.ng.strToBoolean(flipped,!$scope.flipped),$scope.flipped=flipped,$scope.checkWidgetSize(600)},this.getFlipped=function(){return $scope.flipped},$scope.hideFront=!1,$scope.hideBack=!1,$scope.$watch("flipped",function(newVal){$scope.hideFront=!1,$scope.hideBack=!1,$timeout(function(){newVal?($scope.hideFront=!0,$scope.hideBack=!1):($scope.hideFront=!1,$scope.hideBack=!0)},600)}),$scope.api=this}]}}]),angular.module("directives").directive("sviDocShareContainer",["$templateCache","$log","$timeout","docShare","accountList","eventDispatcher","state","labels","tags","piwik",function($templateCache,$log,$timeout,docShare,accountList,eventDispatcher,state,labels,tags,piwik){return{replace:!1,scope:{account:"@",columns:"@",pageSize:"@",isModal:"@",isAdvisor:"@"},template:$templateCache.get("docShareContainer/docShareContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["name","account","uploadedBy","size","createDate","lastAccessDate","isShared","delete"]'),svi.ng.defaultInt($scope,$attrs,"pageSize",0),svi.ng.defaultFalse($scope,$attrs,"isModal"),svi.ng.defaultFalse($scope,$attrs,"isAdvisor")}catch(e){throw"sviDocShareContainer: "+e}$scope.isModal=!1,$scope.initComplete=!1,$scope.refocus=null,$scope.sortDir=state.get("docShare-sortDir","desc"),$scope.sortField=state.get("docShare-sortField","createDate"),$scope.currentPage=0,$scope.pageSize&&($scope.currentPage=1),$scope.totalPages=0,$scope.pageCacheID="";var modalInit=!1;$scope.showUploadForm=function(){modalInit?$($element.find(".svi-doc-share-upload-modal")).modal("show"):(modalInit=!0,$($element.find(".svi-doc-share-upload-modal")).modal({backdrop:!0,show:!0}))},$scope.hideUploadForm=function(){eventDispatcher.trigger("DOCSHAREFILE.FORMRESET",{}),$(".svi-doc-share-upload-modal").modal("hide")},$scope.docShare=null;try{$attrs.columns=JSON.parse($attrs.columns)}catch(e){$log.error("sviDocShareContainer: Error parsing columns: ",e,$attrs.columns),$attrs.columns=[]}$scope.columns=$attrs.columns,$scope.setLoader=function(loader){$scope.loader=loader},labels.setupLabels($scope,["docShare"],{}),$scope.$watch("sortField",function(val){state.set("docShare-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("docShare-sortDir",val).save()}),$scope.getLoadParameters=function(){var data={sortField:$scope.sortField,sortDir:$scope.sortDir};return $scope.pageSize&&(data.pageSize=$scope.pageSize,data.pageNum=$scope.currentPage),data},$scope.deleteFile=function(documentId){var params={documentId:documentId};$scope.loader.showSpinner=!0,docShare.deleteFile($scope.account,params).then(onSaveSuccess,onSaveError)};var onSaveSuccess=function(data){$scope.loader.showSpinner=!1;var response=data.data.data||data.data||data;response.success?($scope.loader.setMessage(response.statusMessage),eventDispatcher.trigger("DOCSHAREFILE.DELETED",{docShareDeleteResponse:response})):$scope.loader.setError(response.statusMessage)},onSaveError=function(data){}}],link:function($scope,$element,$attrs){var load=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),$scope.initComplete)return $scope.loader?void $scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError):$timeout(load,200)},loadCallback=function(invalidateCache){$("html,body").animate({scrollTop:0},0);var data=$scope.getLoadParameters();return docShare.getDocShareFilesList($scope.account,data,invalidateCache)},onSuccess=function(response){piwik.trackPage("docShareContainer","Doc Share",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.docShare=response.docShareFilesData,$scope.currentPage=$scope.docShare.pageNum,$scope.totalPages=$scope.docShare.pageCount,0===$scope.docShare.docShareFilesList.length?$scope.loader.setMessage($scope.labels.noDocShareData):$timeout(function(){svi.ui.pulse(".doc-share-grid, .doc-share-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)})},onError=function(reason){piwik.trackPage("docShareContainer/error","Error: Doc Share",!1,[{name:"numAccounts",index:1,value:1}])};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.pageSize&&($scope.currentPage=1),$scope.account=data.currentAccount,$scope.docShare=!1,load())},!0),eventDispatcher.on("DOCSHARE.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.refocus='.svi-column-header[data-event="DOCSHARE.'+data.field+'"]',load())},!0),eventDispatcher.on("DOCSHARE.PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.currentPage=data,load())},!0),eventDispatcher.on("DOCSHARE.REFRESH",function(){$scope.pageSize&&($scope.currentPage=1),$scope.docShare=null,load(!0)}),eventDispatcher.on("ACCOUNT.DOCSHAREFILE.UPLOADED",function(){$scope.pageSize&&($scope.currentPage=1),$scope.docShare=null,load(!0)}),eventDispatcher.on("ACCOUNT.DOCSHAREFILE.COMMERR",function(){$scope.pageSize&&($scope.currentPage=1),$scope.docShare=null,load(!0)}),eventDispatcher.on("DOCSHAREFILE.DELETE.TRIGGERED",function(e,data){angular.isObject(data)&&data.hasOwnProperty("documentId")&&($scope.docShare=null,$scope.deleteFile(data.documentId)),$scope.pageSize&&($scope.currentPage=1)}),eventDispatcher.on("DOCSHAREFILE.DELETED",function(){$scope.pageSize&&($scope.currentPage=1),$scope.docShare=null,load(!0)}),$timeout(function(){$scope.initComplete=!0,$scope.docShare||load()},400)}}}]),angular.module("directives").directive("sviDocShareGrid",["$templateRequest","$compile","$filter","labels","eventDispatcher","$popover","floatThead",function($templateRequest,$compile,$filter,labels,eventDispatcher,$popover,floatThead){return{replace:!1,scope:{title:"@",columns:"=",docShare:"=",sortField:"=?",sortDir:"=?",isAdvisor:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultFalse($scope,$attrs,"isAdvisor")}catch(e){throw"sviDocShareGrid: "+e}labels.setupLabels($scope,["docShare"],{}),$scope.docShareUrl=svi.url.addHost("/Web/account/docShare/"),$scope.deleteDocSharePopover=null;var getDeleteDocSharePopover=function(documentId){if(!$scope.deleteDocSharePopover){var el=$element.find(".docshare-delete-"+documentId);$scope.deleteDocSharePopover=$popover(el,{container:".svi-bs",placement:"bottom",target:el,trigger:"manual",autoClose:!0,title:$scope.labels.confirmDeleteDocshare,templateUrl:"docShareGrid/deleteDocSharePopover.tpl.html"}),($scope.deleteDocSharePopover.$scope=$scope).deleteDocSharePopover.$scope.documentId=documentId,$scope.deleteDocSharePopover.$scope.labels=$scope.labels}return $scope.deleteDocSharePopover};$scope.showDeleteDocSharePopover=function(documentId){$scope.deleteDocSharePopover=null,getDeleteDocSharePopover(documentId).$promise.then($scope.deleteDocSharePopover.show)},$scope.hideDeleteDocSharePopover=function(documentId){getDeleteDocSharePopover(documentId).$promise.then($scope.deleteDocSharePopover.hide)},$scope.deleteFile=function(documentId){$scope.hideDeleteDocSharePopover(),eventDispatcher.trigger("DOCSHAREFILE.DELETE.TRIGGERED",{documentId:documentId})},floatThead.init($scope,$element)}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("docShare/docShareGrid/docShareGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviDocShareLauncher",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","session","labels","$log","$tooltip",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,session,labels,$log,$tooltip){return{replace:!1,scope:{loginId:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"loginId",""),labels.setupLabels($scope,["docShare"],{errorSwitchingUser:"An error occurred while switching users"}),$scope.setLoader=function(loader){$scope.loader=loader};var triggerEvent=function(){eventDispatcher.trigger("DOCSHARE.BUTTON.CLICKED",{})},invalidTooltip=null;this.showInvalidTooltip=function(){var msg=$scope.labels.errorSwitchingUser;invalidTooltip||(invalidTooltip=$tooltip($element,{placement:"right",trigger:"manual",autoClose:!0,type:"danger",title:msg}));invalidTooltip.$scope.title=msg,invalidTooltip.$promise.then(invalidTooltip.show)},this.hideInvalidTooltip=function(){invalidTooltip&&invalidTooltip.$promise.then(invalidTooltip.hide)},this.launchDocShare=function(){$scope.loginId?session.switchUser($scope.loginId,!0).then(function(result){200==result.status&&result.data.success?triggerEvent():$scope.api.showInvalidTooltip()}):triggerEvent()},$scope.api=this}],link:function($scope,$element,$attrs){$timeout(function(){$element.bind("click",function($event){$scope.api.launchDocShare()})})}}}]),angular.module("directives").directive("sviDocShareModal",["$templateCache","$parse","APP_CONFIG","eventDispatcher","$timeout","$log",function($templateCache,$parse,APP_CONFIG,eventDispatcher,$timeout,$log){return{replace:!1,scope:{config:"@",columns:"@",pageSize:"@",isAdvisor:"@"},template:$templateCache.get("docShareModal/docShareModal.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{var config=JSON.parse($attrs.config);svi.ng.defaultString($scope,$attrs,"columns",config&&config.hasOwnProperty("columns")?config.columns:'["name","account","uploadedBy","size","createDate","lastAccessDate","isShared","delete"]'),svi.ng.defaultInt($scope,$attrs,"pageSize",config&&config.hasOwnProperty("pageSize")?config.pageSize:0),config&&config.hasOwnProperty("isAdvisor")?$scope.isAdvisor=$attrs.isAdvisor=svi.ng.strToBoolean(config.isAdvisor,!0):svi.ng.defaultTrue($scope,$attrs,"isAdvisor")}catch(e){throw"sviDocShareModal: "+e}var modalInit=!1;eventDispatcher.on("DOCSHARE.BUTTON.CLICKED",function(e,data){modalInit?$(".docShareModal").modal("show"):(modalInit=!0,$(".docShareModal").modal({backdrop:!0,show:!0})),eventDispatcher.trigger("DOCSHARE.REFRESH",{})},!0),$scope.close=function(){$(".docShareModal").modal("hide"),$scope.reset()},$scope.reset=function(clearParams){}}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviDocShareUpload",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","docShare","config","$parse","$filter","$popover",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,docShare,config,$parse,$filter,$popover){return{replace:!1,scope:{isAdvisor:"@"},require:"?ngModel",template:$templateCache.get("docShareUpload/docShareUpload.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultFalse($scope,$attrs,"isAdvisor")}catch(e){throw"sviDocShareUpload: "+e}$scope.warnings=[],$scope.errors=[],$scope.account=accountList.getCurrentAccountIndex(),$scope.uploadForm={},$scope.uploadForm.docShareFile={},$scope.uploadForm.isShared=!1,$scope.uploadForm.allowOverwrite=!1,$scope.uploadForm.loginId="",$scope.files=[],$scope.fileUploadSuccess=!1,$scope.config=[],labels.setupLabels($scope,["docShare"],{}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.setFiles=function(files){$scope.files=files||[]},$scope.upload=function(overwriteFile){if($scope.hideOverwritePopover(),$scope.validateFileInput(),$scope.uploadForm.allowOverwrite=overwriteFile,!($scope.files[0]&&$scope.validateFileSize($scope.files[0].size)&&$scope.validateFileMimeType($scope.files[0].type)))return!1;$scope.uploadForm.docShareFile=$scope.files[0];var formData=new FormData;formData.append("file",$scope.uploadForm.docShareFile),formData.append("isShared",$scope.uploadForm.isShared),formData.append("isAdvisor",$scope.isAdvisor),formData.append("allowOverwrite",$scope.uploadForm.allowOverwrite),formData.append("account",$scope.account),formData.append("loginId",$scope.uploadForm.loginId),$scope.loader.showSpinner=!0,docShare.uploadFile($scope.account,formData).then(onSaveSuccess,onSaveError)},$scope.btnCancel=function(){$scope.resetDocShareUpload(),$element.find(".docShareUploadForm").find(".has-error").removeClass("has-error"),$(".svi-doc-share-upload-modal").modal("hide")};var onSaveSuccess=function(data){$scope.loader.showSpinner=!1;var response=data.data.data||data.data||data;response.formSuccess?"fileExists"==response.formSuccess?($scope.loader.clearAllMessages(),$scope.loader.setWarning(response.statusMessage),$scope.showOverwriteFilePopover(response.statusMessage)):($scope.loader.clearAllMessages(),$scope.loader.setMessage("File "+response.name+" with size of "+$filter("fileSize")(response.size)+" was successfully uploaded!"),$scope.fileUploadSuccess=!0,eventDispatcher.trigger("ACCOUNT.DOCSHAREFILE.UPLOADED",{docShareUploadFormResponse:response})):($scope.fileUploadSuccess=!1,$scope.loader.setError(response.statusMessage))};$scope.overwriteFilePopover=null,$scope.getOverwriteFilePopover=function(message){$scope.overwriteFilePopover&&$scope.overwriteFilePopover.destroy(),$scope.message=message;var el=$element.find(".docShareUploadForm .fileInput");return $scope.overwriteFilePopover=$popover(el,{container:".svi-bs",placement:"bottom",trigger:"manual",autoClose:!0,title:$scope.message,templateUrl:"docShareUpload/docShareFileOverwitePopover.tpl.html",scope:$scope}),($scope.overwriteFilePopover.$scope=$scope).overwriteFilePopover},$scope.showOverwriteFilePopover=function(message){$scope.overwriteFilePopover=null,$scope.getOverwriteFilePopover(message).$promise.then($scope.overwriteFilePopover.show)},$scope.hideOverwritePopover=function(){$scope.getOverwriteFilePopover().$promise.then($scope.overwriteFilePopover.hide)};var onSaveError=function(response){$scope.loader.showSpinner=!1,$scope.loader.setError("An exception occurred while uploading your file. Please try again.")};$scope.validateFileInput=function(){$element.find(".docShareUploadForm").find(".has-error").removeClass("has-error"),""===$element.find(".docShareUploadForm .fileInput input[type=file]").val()?$scope.loader.setWarning("Please select a File."):$scope.loader.clearAllMessages()},$scope.validateFileSize=function(fileSize){if($scope.config.allowedFileSize&&$scope.config.allowedFileSize.max&&""!==$scope.config.allowedFileSize.max){var validSizeValue=parseInt($scope.config.allowedFileSize.max.slice(0,-2));switch($scope.config.allowedFileSize.max.slice(-2).toUpperCase()){case"KB":validSizeValue*=1024;break;case"MB":validSizeValue*=1048576;break;case"GB":validSizeValue*=1073741824;break;case"TB":validSizeValue*=1099511627776}return validSizeValue<fileSize?($scope.loader.setWarning($scope.config.uploadFileSizeError),!1):($scope.loader.clearAllMessages(),!0)}},$scope.validateFileMimeType=function(fileMimeType){if($scope.config.allowedMimeTypes&&0<$scope.config.allowedMimeTypes.length)return php.in_array(fileMimeType,$scope.config.allowedMimeTypes)?($scope.loader.clearAllMessages(),!0):($scope.loader.setWarning($scope.config.uploadFileTypeError),!1)},$scope.resetDocShareUpload=function(){$scope.fileUploadSuccess=!1,$scope.loader&&($scope.loader.showSpinner=!1,$scope.loader.clearAllMessages()),$scope.files=[],$scope.uploadForm={docShareFile:null,account:$scope.account,isShared:!1,loginId:"",isAdvisor:$scope.isAdvisor},$element.find(".docShareUploadForm .fileInput input[type=file]").val(null)},$scope.load=function(){$scope.loader?$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.load,400)};var loadCallback=function(invalidateCache){return config.getConfig(["docShare"])},onSuccess=function(data){$scope.config=[],angular.isObject(data.config)&&0!==data.config.length&&($scope.config.allowedMimeTypes=data.config["valid.fileAllowedMimeTypes"]||[],$scope.config.allowedFileSize=data.config["valid.fileSizes"]||"",$scope.config.uploadFileTypeError=data.config.uploadFileTypeError||"",$scope.config.uploadFileSizeError=data.config.uploadFileSizeError||"")},onError=function(response){if(404==response.status){$scope.loader.setError("There was comunnication error. Upload file window will be closed and refresh will happen."),$scope.fileUploadSuccess=!0;$timeout(function(){eventDispatcher.trigger("ACCOUNT.DOCSHAREFILE.COMMERR",{docShareUploadFormResponse:response})},1e4)}};this.getScope=function(){return $scope},$timeout(function(){$scope.resetDocShareUpload(),$scope.load()},300)}],link:function($scope,$element,$attrs){var fileInput=$element.find(".docShareUploadForm .fileInput input[type=file]");fileInput.bind("change",function(event){var files=fileInput[0].files;$scope.setFiles(files)});eventDispatcher.on("DOCSHAREFILE.FORMRESET",function(e,data){$scope.resetDocShareUpload()},!0),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.load())},!0),$timeout(function(){})}}}]),angular.module("directives").directive("sviGainLossFilterControls",["APP_CONFIG","$templateCache","$document","accountList","eventDispatcher","labels","$timeout","$log",function(APP_CONFIG,$templateCache,$document,accountList,eventDispatcher,labels,$timeout,$log){var VIEW={UGL:"UGL",RGL:"RGL"},CONSTANTS_ACCOUNT_CHANGED_EVENT=".ACCOUNT.CHANGED",CONSTANTS_FILTER_CHANGED_EVENT=".FILTER.CHANGED",CONSTANTS_FILTER_CLEARED_EVENT=".FILTER.CLEARED",CONSTANTS_INPUT_DISABLED=".INPUT.DISABLE",CONSTANTS_FILTER_UPDATED_EVENT=".FILTER.UPDATED",GROUP_BY_ACCOUNT="account",GROUP_BY_DEFAULT="",YEAR_TYPE_CURRENT="false",YEAR_TYPE_CUSTOM="Custom",FILTER_EVENTS={investmentType:".MULTI.ACCOUNT.ASSET.TYPE",termType:".MULTI.ACCOUNT.TERM.TYPE",groupByOptions:".MULTI.ACCOUNT.GROUP.BY",yearType:".MULTI.ACCOUNT.YEAR.TYPE"},FILTER_MAPPING={investmentType:"assetTypes",termType:"termType",groupByOptions:"groupBy"};return{scope:{assetTypes:"@",termTypes:"@",yearTypes:"@",groupByOptions:"@",currentView:"@",accountDropdownEventId:"@",symbolInputEventId:"@",assetTypeEventId:"@",termTypeEventId:"@",yearTypeEventId:"@",dateRangeEventId:"@",groupByEventId:"@",isAccountDropdownDisabled:"@",isSingleAccountSelected:"=?",isGroupByDisabled:"@",groupBy:"@",options:"@"},template:$templateCache.get("gainLossFilterControls/gainLossFilterControls.tpl.html"),controller:["$scope","$attrs",function($scope,$attrs){($scope.api=this).name="gainLossFilterControls",this.friendlyName="Gain Loss Filter Controls";try{svi.ng.defaultValidString($scope,$attrs,"currentView",Object.values(VIEW),""),svi.ng.defaultString($scope,$attrs,"accountDropdownEventId",""),svi.ng.defaultString($scope,$attrs,"symbolInputEventId",""),svi.ng.defaultString($scope,$attrs,"assetTypeEventId",""),svi.ng.defaultString($scope,$attrs,"termTypeEventId",""),svi.ng.defaultString($scope,$attrs,"dateRangeEventId",""),svi.ng.defaultFalse($scope,$attrs,"isAccountDropdownDisabled"),svi.ng.defaultFalse($scope,$attrs,"isSingleAccountSelected"),svi.ng.defaultTrue($scope,$attrs,"isGroupByDisabled"),svi.ng.defaultString($scope,$attrs,"groupBy",""),svi.ng.defaultString($scope,$attrs,"options","")}catch(e){console.error(this.name+": "+e)}$scope.accountDropdownTitle="",$scope.isUGL=$scope.currentView===VIEW.UGL,$scope.isRGL=$scope.currentView===VIEW.RGL,$scope.accountDropdownItems=[],$scope.accountDropdownMenuTitle="",$scope.isSymbolInputDisabled=!1;var initialized=!($scope.filtersModel={accounts:"",symbols:"",assetTypes:"",termType:"",dateRange:{},groupBy:""});labels.setupLabels($scope,["costBasis"],{account:"Account",accountsDropdownLabel:"Refine Account Selection",assetTypes:"Asset Type",allAssetTypes:"All Asset Types",termTypes:"Term Type",allTermTypes:"All Term Types",clear:"Clear",apply:"Apply",allAccounts:"All Accounts",accountsSelected:"Accounts Selected",filterYearType:"Current Year",fromDate:"From Date",untilDate:"Until Date",groupByTitle:"Group By",symbolInputTitle:"Symbol",yearDropdownTitle:"Year",termTypesDropdownTitle:"Term Type",accountDropdownDescription:"Adjust selected accounts here",group:"Group: ",filterAccountsInputPlaceholder:"Filter Accounts",accountsErrorValidationText:"At least one account must be selected."});try{svi.ng.parseJSON($scope,$attrs,"options")}catch(e){$log.error("sviGainLossFilterControls: Error parsing options: ",e,$attrs.options),$scope.options=$attrs.options={}}$scope.isCustomView=function(){return Boolean($scope.options)};var prepareAccountList=function(accounts){if(accounts)return accounts.map(function(account){return{label:account.account,value:account.index}})};$scope.onApplyButtonClick=function(){angular.isArray($scope.filtersModel.accounts)&&0===$scope.filtersModel.accounts.length?eventDispatcher.trigger($scope.accountDropdownEventId+".VALIDATION.ERROR",!0):($scope.isCustomView()||($scope.filtersModel.groupBy=$scope.groupBy),eventDispatcher.trigger("APPLY."+$scope.currentView+".FILTERS.ADVANCED",$scope.filtersModel))},$scope.onResetButtonClick=function(){$scope.isSingleAccountSelected||eventDispatcher.trigger($scope.accountDropdownEventId+".MULTI.SELECT.CHECK.ALL"),clearFilters();var currentAccountsGroup,accounts=(currentAccountsGroup=accountList.getCurrentGroup())&&currentAccountsGroup.accounts?accountList.getCurrentGroupIndexes():accountList.getCurrentAccountIndex();$scope.filtersModel={accounts:accounts,symbols:"",assetTypes:"",termType:"",yearType:"",dateRange:{},groupBy:""},$timeout(function(){$scope.accountDropdownTitle=$scope.filtersModel.accounts.length+" "+$scope.labels.accountsSelected,eventDispatcher.trigger("APPLY."+$scope.currentView+".FILTERS.ADVANCED",$scope.filtersModel)},800)},eventDispatcher.on($scope.accountDropdownEventId+CONSTANTS_ACCOUNT_CHANGED_EVENT,function(evt,data){$scope.isSingleAccountSelected||($scope.filtersModel.accounts=function(accountList){if(angular.isArray(accountList)&&accountList.length){var values=[];return accountList.forEach(function(account){account.checked&&values.push(account.value)}),values}}(data),0!==$scope.filtersModel.accounts.length&&eventDispatcher.trigger($scope.accountDropdownEventId+".VALIDATION.ERROR",!1))}),eventDispatcher.on($scope.symbolInputEventId+CONSTANTS_FILTER_CHANGED_EVENT,function(evt,data){$scope.filtersModel.symbols=data}),eventDispatcher.on($scope.assetTypeEventId+CONSTANTS_FILTER_UPDATED_EVENT,function(evt,data){$scope.filtersModel.assetTypes=data}),eventDispatcher.on($scope.termTypeEventId+CONSTANTS_FILTER_CHANGED_EVENT,function(evt,data){$scope.filtersModel.termType=data}),eventDispatcher.on($scope.yearTypeEventId+CONSTANTS_FILTER_CHANGED_EVENT,function(evt,data){($scope.filtersModel.yearType=data).value!==YEAR_TYPE_CUSTOM&&($scope.filtersModel.dateRange.startDate||$scope.filtersModel.dateRange.endDate)&&eventDispatcher.trigger($scope.dateRangeEventId+CONSTANTS_FILTER_CHANGED_EVENT,{from:"",to:""})}),eventDispatcher.on($scope.dateRangeEventId+CONSTANTS_FILTER_CHANGED_EVENT,function(evt,data){data&&($scope.filtersModel.dateRange={startDate:data.from,endDate:data.to},(data.from||data.to)&&$scope.filtersModel.yearType!==YEAR_TYPE_CUSTOM&&eventDispatcher.trigger($scope.yearTypeEventId+CONSTANTS_FILTER_CHANGED_EVENT,{value:YEAR_TYPE_CUSTOM}))});var disableInputs=function(groupByData){groupByData.value===GROUP_BY_ACCOUNT&&$scope.isUGL?($scope.filtersModel.symbols="",eventDispatcher.trigger($scope.symbolInputEventId+CONSTANTS_INPUT_DISABLED,!0)):eventDispatcher.trigger($scope.symbolInputEventId+CONSTANTS_INPUT_DISABLED,!1);var disable={value:""!==groupByData.value};eventDispatcher.trigger($scope.termTypeEventId+CONSTANTS_INPUT_DISABLED,disable),eventDispatcher.trigger($scope.assetTypeEventId+CONSTANTS_INPUT_DISABLED,disable),disable.value&&($scope.filtersModel.assetTypes=[],$scope.filtersModel.termType="")};eventDispatcher.on($scope.groupByEventId+CONSTANTS_FILTER_CHANGED_EVENT,function(evt,data){$scope.isCustomView()&&data&&null!==data.value&&($scope.filtersModel.groupBy=data.value,disableInputs(data))});var clearFilters=function(){eventDispatcher.trigger($scope.symbolInputEventId+CONSTANTS_FILTER_CHANGED_EVENT,""),eventDispatcher.trigger($scope.assetTypeEventId+CONSTANTS_FILTER_CLEARED_EVENT),eventDispatcher.trigger($scope.termTypeEventId+CONSTANTS_FILTER_CHANGED_EVENT,{value:""}),eventDispatcher.trigger($scope.groupByEventId+CONSTANTS_FILTER_CHANGED_EVENT,{value:GROUP_BY_DEFAULT}),$scope.isRGL&&(eventDispatcher.trigger($scope.yearTypeEventId+CONSTANTS_FILTER_CHANGED_EVENT,{value:YEAR_TYPE_CURRENT}),eventDispatcher.trigger($scope.dateRangeEventId+CONSTANTS_FILTER_CHANGED_EVENT,{from:"",to:""}))};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(evt,accountsData){if(accountsData){if(accountsData.group){var currentGroup=accountsData.group;$scope.filtersModel.accounts=accountsData.currentAccount.length?accountsData.currentAccount:currentGroup.accountIndexes;var preparedAccountList=prepareAccountList(currentGroup.accounts);$scope.accountDropdownItems=JSON.stringify(preparedAccountList),$scope.accountDropdownTitle=preparedAccountList.length+" "+$scope.labels.accountsSelected,$scope.accountDropdownMenuTitle=$scope.labels.group+currentGroup.nickname}else if(accountsData.accountData&&accountsData.accountData.length){$scope.filtersModel.accounts=accountsData.currentAccount;var preparedAllAccountList=prepareAccountList(accountsData.accountData);$scope.accountDropdownItems=JSON.stringify(preparedAllAccountList),$scope.accountDropdownMenuTitle=$scope.accountDropdownTitle=$scope.labels.group+$scope.labels.allAccounts}else $scope.filtersModel.accounts=accountsData.index||accountsData.currentAccount,$scope.accountDropdownItems=$scope.accountDropdownTitle=$scope.accountDropdownMenuTitle=null;var isSingleAccountSelected=!accountsData.hasOwnProperty("group")&&accountsData.currentAccount.length<=1;$scope.isCustomView()&&(initialized||function(){var options=$scope.options;if(angular.isObject(options))for(var key in delete options.pageSize,options){var option=options[key],value="multiselect"===option.type?option.value:{value:option.value};$scope.filtersModel[FILTER_MAPPING[key]]=option.value,eventDispatcher.trigger($scope.currentView+FILTER_EVENTS[key]+CONSTANTS_FILTER_CHANGED_EVENT,value)}}(),disableInputs({value:isSingleAccountSelected?"":$scope.filtersModel.groupBy}),$scope.onApplyButtonClick()),initialized=!0}}),$scope.$watch("accountDropdownItems",function(newVal){if(newVal){if(angular.isArray(newVal)&&!newVal.length)return;eventDispatcher.trigger($scope.accountDropdownEventId+".ITEMS.UPDATED",newVal)}}),$scope.$watch("accountDropdownMenuTitle",function(newVal){newVal&&eventDispatcher.trigger($scope.accountDropdownEventId+".SUBMENU.TITLE.UPDATED",newVal)})}]}}]),angular.module("directives").directive("sviGainLossOverview",["$templateCache","$timeout","labels","accountList","costbasis","eventDispatcher","piwik",function($templateCache,$timeout,labels,accountList,costbasis,eventDispatcher,piwik){return{replace:!1,scope:{account:"@"},template:$templateCache.get("gainLossOverview/gainLossOverview.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex())}catch(e){throw"sviGainLossOverview: "+e}$scope.glOverview=null,labels.setupLabels($scope,["gainLossOverview"]);var loadCallback=function(){return costbasis.getGainLossOverview($scope.account)},onSuccess=function(response){piwik.trackPage("gainLossOverview","Gain Loss Overview",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.glOverview=response.gainLossOverview},onError=function(reason){piwik.trackPage("gainLossOverview/error","Error: Gain Loss Overview",!1,[{name:"numAccounts",index:1,value:1}])};this.getLoader=svi.ng.getLoaderFactory($element,$scope,"loader"),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,200)},$scope.api=this,$timeout(function(){!$scope.glOverview&&$scope.api&&$scope.api.load()},200),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&data.hasOwnProperty("currentAccount")&&($scope.account=data.currentAccount,$scope.glOverview=null,$scope.api&&$scope.api.load())},!0)}]}}]),angular.module("directives").directive("sviRealizedGainLossContainer",["APP_CONFIG","$templateCache","$timeout","$log","costbasis","config","accountList","eventDispatcher","state","labels","actionMenu","tags","piwik","bsBreakpoint","sviUrl",function(APP_CONFIG,$templateCache,$timeout,$log,costbasis,config,accountList,eventDispatcher,state,labels,actionMenu,tags,piwik,bsBreakpoint,sviUrl){var TEMPLATE_DEFAULT="",TEMPLATE_ADVANCED="Advanced";return{replace:!1,scope:{account:"@",columns:"@",totalsConfig:"@",columnPriority:"@",groupByColumnPriority:"@",responsiveColumns:"@",pageSize:"@",startDate:"@",endDate:"@",assetClassificationEnabled:"@",gridTemplate:"@",assetTypes:"@",termTypes:"@",yearTypes:"@",groupByOptions:"@",sortingOptions:"@",isGroupByDisabled:"@",isAccountDropdownDisabled:"@",groupBy:"@",sortField:"=?",sortDir:"=?",areTotalsShown:"@",options:"@"},template:$templateCache.get("realizedGainLossContainer/realizedGainLossContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["expander", "account","investmentType","securityType","symbol","quantity","dateAcquired","closingDate","purchaseCost","closingValue","marketValue","gainLoss","pctGainLoss","term","event","covered","actionMenu"]'),svi.ng.defaultTrue($scope,$attrs,"totalsConfig"),svi.ng.defaultString($scope,$attrs,"columnPriority",'["symbol","quantity","gainLoss","investmentType","securityType","dateAcquired","closingDate","unitCost","marketPrice","dailyPriceChange","purchaseCost","purchasePrice","closingPrice","closingValue","marketValue","pctGainLoss","term","event","desc","dailyChange","expectedIncome","yield","covered","accountType","tags","actionMenu","expander"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultInt($scope,$attrs,"pageSize",50),svi.ng.defaultFalse($scope,$attrs,"assetClassificationEnabled"),svi.ng.defaultValidString($scope,$attrs,"gridTemplate",[TEMPLATE_DEFAULT,TEMPLATE_ADVANCED],TEMPLATE_DEFAULT),svi.ng.defaultString($scope,$attrs,"assetTypes",""),svi.ng.defaultString($scope,$attrs,"termTypes",""),svi.ng.defaultString($scope,$attrs,"groupByOptions",""),svi.ng.defaultString($scope,$attrs,"sortingOptions",""),svi.ng.defaultTrue($scope,$attrs,"isGroupByDisabled"),svi.ng.defaultFalse($scope,$attrs,"isAccountDropdownDisabled"),svi.ng.defaultString($scope,$attrs,"groupBy",""),svi.ng.defaultString($scope,$attrs,"sortField","closingDate"),svi.ng.defaultString($scope,$attrs,"sortField","desc"),svi.ng.defaultTrue($scope,$attrs,"areTotalsShown"),svi.ng.defaultString($scope,$attrs,"options","")}catch(e){throw"sviRealizedGainLossContainer: "+e}$scope.isAdvanced=$scope.gridTemplate===TEMPLATE_ADVANCED;var startDate=$attrs.startDate;startDate||(startDate=state.get("rgl-dateRangeFrom")),$scope.startDate=$attrs.startDate=startDate||"",$scope.filters={};var investmentType,endDate=$attrs.endDate;endDate||(endDate=state.get("rgl-dateRangeTo")),$scope.endDate=$attrs.endDate=endDate||"",$scope.sortDir||$scope.isAdvanced||($scope.sortDir=state.get("rgl-sortDir","desc")),$scope.sortField||$scope.isAdvanced||($scope.sortField=state.get("rgl-sortField","closingDate")),$scope.currentPage=0,$scope.pageSize&&($scope.currentPage=1),$scope.totalPages=0,$scope.pageCacheID="",$scope.refocus=null,labels.setupLabels($scope,["costBasisContainer"],{}).then(function(){$scope.technicalError=JSON.stringify({type:"message",message:$scope.labels.rglExceededAmountOfRecordsError,resObject:"costbasis",statusCodeToCompare:"100"})}),$scope.initComplete=!1,$scope.costbasis=!1;try{(investmentType=state.get("rgl-investmentType"))||(investmentType=[])}catch(e){investmentType=[]}$scope.filters={investmentType:investmentType,termType:state.get("rgl-termType"),yearType:state.get("rgl-yearType")},$scope.isSingleAccountSelected=!1;try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.error("sviRealizedGainLossContainer: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviRealizedGainLossContainer: Error parsing columnPriority: ",e,$attrs.columnPriority)}try{svi.ng.parseJSON($scope,$attrs,"groupByColumnPriority")}catch(e){$log.warn("sviRealizedGainLossContainer: Error parsing groupByColumnPriority: ",e,$attrs.groupByColumnPriority)}try{svi.ng.parseJSON($scope,$attrs,"sortingOptions")}catch(e){$log.warn("sviRealizedGainLossContainer: Error parsing sortingOptions: ",e,$attrs.sortingOptions)}$scope.currentColumnPriority=$scope.columnPriority,$scope.isCustomView=function(){return Boolean($scope.options)},$scope.$watch("sortField",function(val){state.set("rgl-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("rgl-sortDir",val).save()}),$scope.$watch("filters.investmentType",function(val){state.set("rgl-investmentType",val).save()}),$scope.$watch("filters.termType",function(val){state.set("rgl-termType",val).save()}),$scope.$watch("filters.yearType",function(val){state.set("rgl-yearType",val).save()}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.applySorting=function(){$scope.sortField=costbasis.getSortParam("sortField",$scope),$scope.sortDir=costbasis.getSortParam("sortDir",$scope),eventDispatcher.trigger("RGL.SORT.CHANGED",{field:$scope.sortField,dir:$scope.sortDir,shouldNotReload:!0})},$scope.getLoadParameters=function(){$scope.isSingleAccountSelected&&($scope.filters.groupBy=$scope.groupBy="");var priorYear=$scope.filters.yearType&&"true"===$scope.filters.yearType.value?"true":"false",data={sortField:$scope.sortField,sortDir:$scope.sortDir,priorYear:priorYear,startDate:$scope.startDate||"",endDate:$scope.endDate||"",switchAccounts:"N"};$scope.pageSize&&(data.pageSize=$scope.pageSize,data.pageNum=$scope.currentPage,data.pageCacheID=$scope.pageCacheID),data.filterField=[],data.filterValue=[];var it=$scope.filters.investmentType.length,index=0;if(it){$scope.assetClassificationEnabled?data.filterField[index]="assetClassification":data.filterField[index]="investmentType",data.filterValue[index]=[];for(var i=0;i<it;i++)angular.isArray($scope.filters.investmentType[i].value)?data.filterValue[index]=php.array_merge(data.filterValue[index],$scope.filters.investmentType[i].value):data.filterValue[index].push($scope.filters.investmentType[i].value);index++}return $scope.filters.termType&&$scope.filters.termType.value&&(data.filterField[index]="term",data.filterValue[index]=[$scope.filters.termType.value],index++),($scope.filters.groupBy&&""!==$scope.filters.groupBy||null!==$scope.groupBy.length)&&($scope.isCustomView()?data.groupBy=$scope.filters.groupBy:data.groupBy=$scope.filters.groupBy||$scope.groupBy),eventDispatcher.trigger("PARAMETER.CONTEXT.CHANGED",data),data}}],link:function($scope,$element){var load=function(){if($scope.initComplete)return $scope.loader?void $scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout(load,200)},trackPageAnalytics=function(action,message,loadTime){var id=action.length?"realizedGainLossContainer/"+action:"realizedGainLossContainer";piwik.trackPage(id,message,loadTime,[{name:"numAccounts",index:1,value:1}])},loadCallback=function(){if(null!==$scope.account&&$scope.account!==[]){if($scope.groupBy&&$scope.isSingleAccountSelected&&!$scope.isCustomView())return eventDispatcher.trigger("ACCOUNT.CONTEXT.CHANGED",{currentAccount:$scope.account}),void $timeout(function(){sviUrl.href(window.location.origin+"/Web/account/realizedGainLoss/realizedGainLoss")},700);var invalidateCache=$scope.isAdvanced;$("html,body").animate({scrollTop:0},0),$scope.costbasis=null,$scope.totals=null;var data=$scope.getLoadParameters();return costbasis.getRGL($scope.account,data,invalidateCache)}},onSuccess=function(response){trackPageAnalytics("","Realized Gain Loss Container",1e3*response._loaderMetadata.elapsedTime),$scope.costbasis=response.costbasis;var totals=response.costbasis.totals;$scope.isAdvanced&&(totals.gainLossPerPage=costbasis.getGainLossTotal($scope.costbasis.gainLoss)),$scope.totals=totals,$scope.currentPage=$scope.costbasis.pageNum,$scope.totalPages=$scope.costbasis.pageCount,$scope.pageCacheID=$scope.costbasis.pageCacheID,$scope.costbasis.gainLoss?(-1!==$scope.columns.indexOf("tags")&&$scope.costbasis.symbolList&&tags.getBySymbol($scope.costbasis.symbolList).success(function(response){if(response.success){tags.ignoreUpdates(!0);for(var symbol="",i=0,l=$scope.costbasis.gainLoss.length;i<l;i++)try{symbol=$scope.costbasis.gainLoss[i].instrument.symbol,$scope.costbasis.gainLoss[i].tags=response.tags[symbol]}catch(e){$scope.costbasis.gainLoss[i].tags=[]}$timeout(function(){tags.ignoreUpdates(!1)})}}),$scope.isAdvanced&&($scope.currentColumnPriority=costbasis.getGroupByColumnPriority($scope.filters.groupBy||$scope.groupBy,$scope.groupByColumnPriority,$scope.columnPriority,$scope.isSingleAccountSelected,$scope.isCustomView())),$timeout(function(){void 0!==svi.marketHoverOver&&$element.get()&&svi.marketHoverOver.attachTooltips($element.get()[0]),svi.ui.pulse(".realized-gain-loss-grid, .realized-gain-loss-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)})):$scope.loader.setMessage($scope.labels.noRGLData)},onError=function(){trackPageAnalytics("error","Error: Realized Gain Loss Container",!1)};eventDispatcher.on("APPLY.RGL.FILTERS.ADVANCED",function(evt,data){if(data){if(angular.isArray(data.accounts)){if(!data.accounts.length)return}else if(null===data.accounts||data.accounts===[])return;$scope.account=data.accounts,$scope.filters.investmentType=data.assetTypes,$scope.filters.termType=data.termType,$scope.filters.symbol=data.symbols,$scope.filters.yearType=data.yearType,$scope.startDate=data.dateRange.startDate,$scope.endDate=data.dateRange.endDate,$scope.filters.groupBy=data.groupBy,$scope.isAdvanced&&$scope.isCustomView()&&($scope.groupBy=$scope.filters.groupBy),$scope.applySorting(),$scope.pageSize&&($scope.currentPage=1,eventDispatcher.trigger("RGL.PAGE.CHANGED",1)),load()}}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){if(($scope.isAdvanced||$scope.account!==data.currentAccount)&&(1!==Object.keys(data).length||"currentAccount"!==Object.keys(data)[0])){var currentAccount=data.currentAccount;$scope.isSingleAccountSelected=!data.hasOwnProperty("group")&&currentAccount.length<=1,$scope.account=currentAccount,$scope.costbasis=!1,$scope.pageSize&&($scope.currentPage=1,eventDispatcher.trigger("RGL.PAGE.CHANGED",1)),angular.isArray($scope.account)&&1<=$scope.account.length&&eventDispatcher.trigger("RGL.MULTI.ACCOUNTS.MULTI.SELECT.CHECK.ALL"),$scope.applySorting(),load()}},!0),eventDispatcher.on("RGL.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,data.shouldNotReload||($scope.refocus='.svi-column-header[data-event="RGL.'+data.field+'"]',load()))},!0),eventDispatcher.on("RGL.PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.currentPage=data,load())},!0),eventDispatcher.on("RGL.YEAR_TYPE.FILTER.CHANGED",function(e,data){$scope.filters.yearType!==data&&($scope.filters.yearType=data,$scope.filters.yearType&&"Custom"===$scope.filters.yearType.value||($scope.startDate=null,$scope.endDate=null,eventDispatcher.trigger("RGL.DATE_RANGE.FILTER.CHANGED",{from:$scope.startDate,to:$scope.endDate})),$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("RGL.INVESTMENT_TYPE.FILTER.CHANGED",function(e,data){if(!data||0===data.length)return 0===$scope.filters.investmentType.length?void 0:($scope.filters.investmentType=[],load());if($scope.filters.investmentType!==data){if($scope.filters.investmentType.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.filters.investmentType[i].value!==data[i].value){same=!1;break}if(same)return}$scope.filters.investmentType=data,$scope.pageSize&&($scope.currentPage=1),load()}},!0),eventDispatcher.on("RGL.TERM_TYPE.FILTER.CHANGED",function(e,data){$scope.filters.termType!==data&&($scope.filters.termType=data,$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("RGL.DATE_RANGE.FILTER.CHANGED",function(e,data){$scope.startDate===data.from&&$scope.endDate===data.to||($scope.startDate=data.from,$scope.endDate=data.to,($scope.startDate||$scope.endDate)&&eventDispatcher.trigger("RGL.YEAR_TYPE.FILTER.CHANGED",{value:"Custom"}),$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("RGL.ACTION.ZOOM",function(e,data){actionMenu.startHoldingZoom(data)},!1),eventDispatcher.on("RGL.ACTION.TRADE",function(e,data){actionMenu.startTradeWidget(data)},!1),eventDispatcher.on("RGL.REFRESH",function(){load()}),eventDispatcher.on("RGL.EXPORT",function(){var data=$scope.getLoadParameters();data.columns=JSON.stringify($scope.columns),costbasis.exportRGL($scope.account,data)}),eventDispatcher.on("WINDOW.BREAKPOINT",function(e,data){data&&$scope.isAdvanced&&($scope.currentColumnPriority=costbasis.getGroupByColumnPriority($scope.filters.groupBy||$scope.groupBy,$scope.groupByColumnPriority,$scope.columnPriority,$scope.isSingleAccountSelected,$scope.isCustomView()))}),$timeout(function(){$scope.initComplete=!0,$scope.costbasis||load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviRealizedGainLossGrid",["$templateRequest","$compile","$filter","labels","$sce","expander","floatThead",function($templateRequest,$compile,$filter,labels,$sce,expander,floatThead){return{replace:!1,scope:{title:"@",columns:"=",totalsConfig:"=",columnPriority:"=",groupByColumnPriority:"=",responsiveColumns:"@",costbasis:"=",sortField:"=?",sortDir:"=?",gridTemplate:"@",assetTypes:"@",termTypes:"@",yearTypes:"@",groupByOptions:"@",isGroupByDisabled:"@",isAccountDropdownDisabled:"@",groupBy:"=",isSingleAccountSelected:"=?",areTotalsShown:"@",options:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultValidString($scope,$element,"gridTemplate",["","Advanced"],""),svi.ng.defaultString($scope,$attrs,"assetTypes",""),svi.ng.defaultString($scope,$attrs,"termTypes",""),svi.ng.defaultString($scope,$attrs,"yearTypes",""),svi.ng.defaultString($scope,$attrs,"groupByOptions",""),svi.ng.defaultFalse($scope,$attrs,"isAccountDropdownDisabled"),svi.ng.defaultFalse($scope,$attrs,"isSingleAccountSelected"),svi.ng.defaultTrue($scope,$attrs,"isGroupByDisabled"),svi.ng.defaultString($scope,$attrs,"groupBy",""),svi.ng.defaultTrue($scope,$attrs,"areTotalsShown"),svi.ng.defaultString($scope,$attrs,"options","")}catch(e){throw"sviRealizedGainLossGrid: "+e}$scope.isAdvanced="Advanced"===$scope.gridTemplate,$scope.groupedByAccount=!1,$scope.$parent.$watchGroup(["filters.groupBy","groupBy"],function(newVal){$scope.groupedByAccount=newVal.includes("account")}),labels.setupLabels($scope,["assetTypes","costBasisRGL"],{}),$scope.mapEvent=function(item){var mappedEvent=$filter("ellipsis")(item.eventDesc,4,!0);return item.displayEventDetail?(mappedEvent=item.eventDesc+"<br>"+$scope.labels.washSaleAmount+": "+$filter("sviCurrency")(item.washSaleAmount),mappedEvent+="<br>"+$scope.labels.washSaleDate+": "+$filter("sviDate")(item.washSaleDate),mappedEvent+="<br>"+$scope.labels.disallowedLoss+": "+$filter("sviCurrency")(item.disallowedLoss),mappedEvent=$filter("ellipsis")(mappedEvent,4,!0)):item.displayWashSaleDetail&&(mappedEvent=item.eventDesc,"Multiple"!==item.eventDesc&&(mappedEvent+="<br>"+$scope.labels.disallowedLoss+": "+$filter("sviCurrency")(item.disallowedLoss)),mappedEvent=$filter("ellipsis")(mappedEvent,4,!0)),$sce.trustAsHtml(mappedEvent),mappedEvent},floatThead.init($scope,$element),expander.init($scope,"RGLGRID",$element),$scope.$watch("costbasis",function(){expander.reset($scope)});var defaultBreakpoints={account:{xs:3,sm:5,md:10},symbol:{xs:3,sm:7,md:10},default:{xs:3,sm:8,md:10}},setColumnSettings=function(breakpoints){$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{actionMenu:!1,expander:!1,dailyPriceChange:"currencyIndicator",gainLoss:"currencyIndicator",pctGainLoss:"percentIndicator",mutualFundGL:"currencyIndicator",dailyChange:"currencyChange"},breakpoints:breakpoints}};setColumnSettings($scope.groupBy?defaultBreakpoints[$scope.groupBy]:defaultBreakpoints.default),$scope.$watch("isSingleAccountSelected",function(newVal){var bs=defaultBreakpoints;bs.default.sm=newVal?8:7,setColumnSettings($scope.groupBy?bs[$scope.groupBy]:bs.default)}),$scope.$watch("columnPriority",function(){setColumnSettings($scope.groupBy?defaultBreakpoints[$scope.groupBy]:defaultBreakpoints.default)})}],link:function($scope,$element){var config={columns:$scope.columns};$templateRequest("gainLoss/realizedGainLossGrid/realizedGainLossGrid"+$scope.gridTemplate+".tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviRglSummary",["APP_CONFIG","$templateCache","$timeout","costbasis","accountList","eventDispatcher","labels","state","piwik","$modal",function(APP_CONFIG,$templateCache,$timeout,costbasis,accountList,eventDispatcher,labels,state,piwik,$modal){return{replace:!1,scope:{account:"@",priorYear:"@",priorYearDropdown:"@",modalShowDropdown:"@"},template:'<div><div data-svi-loader data-callback="setLoader" data-hidden="true"></div></div>',controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultValidString($scope,$attrs,"priorYear",["false","true"],"false"),svi.ng.defaultString($scope,$attrs,"priorYearDropdown",'[{"display":"Current Year","value":"false"},{"display":"Prior Year","value":"true"}]'),svi.ng.defaultFalse($scope,$attrs,"modalShowDropdown"),"false"===$scope.priorYearDropdown.toLowerCase()&&($scope.priorYearDropdown=$attrs.priorYearDropdown=!1)}catch(e){throw"sviRglSummary: "+e}$scope.initComplete=!1,$scope.costbasis=!1,$scope.paramData=!1,$scope.priorYear=state.get("rglSummary-priorYear","false"),labels.setupLabels($scope,["general","rglSummary"],{}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.showMore=function(){$scope.modal.show()},$scope.getLoadParameters=function(){var data;return $scope.modalShowDropdown?data={priorYear:$scope.priorYear}:(delete(data=$scope.paramData).filterField,delete data.filterValue),data.switchAccounts="N",data},$scope.hideMore=function(){$scope.modal&&$scope.modal.$isShown&&($("body").removeClass("modal-open"),$scope.modal.hide())},$scope.$watch("priorYear",function(val){state.set("rglSummary-priorYear",val).save()}),$scope.load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}};var loadCallback=function(invalidateCache){$("html,body").animate({scrollTop:0},0);var data=$scope.getLoadParameters();return costbasis.getRGL($scope.account,data,invalidateCache)},onSuccess=function(response){piwik.trackPage("rglSummary","Realized Gain Loss Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.costbasis=response.costbasis,$scope.costbasis.length||$scope.loader.setMessage($scope.labels.noRGLSummaryData)},onError=function(reason){piwik.trackPage("rglSummary/error","Error: Realized Gain Loss Summary",!1,[{name:"numAccounts",index:1,value:1}])};eventDispatcher.on("PARAMETER.CONTEXT.CHANGED",function(e,data){$scope.paramData=data,$scope.load()},!0),eventDispatcher.on("RGL_SUMMARY.YEAR_TYPE.FILTER.CHANGED",function(e,data){$scope.priorYear!==data&&($scope.priorYear=data.value,$scope.load())},!0),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.costbasis=!1,$scope.load())},!0),eventDispatcher.on("RGL_SUMMARY.REFRESH",function(){$scope.load(!0)}),eventDispatcher.on("RGL_SUMMARY.MODAL.SHOW",function(){$scope.showMore()}),eventDispatcher.on("RGL_SUMMARY.MODAL.HIDE",function(){$scope.hideMore()})}],link:function($scope,$element,$attrs){$scope.modal||($scope.modal=$modal({scope:$scope,templateUrl:"rglSummary/rglSummary.tpl.html",container:".modals-section",backdrop:!1,animation:"",show:!1})),$timeout(function(){$scope.initComplete=!0,$scope.costbasis||$scope.load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviUnrealizedGainLossContainer",["APP_CONFIG","$templateCache","$timeout","$log","costbasis","config","accountList","eventDispatcher","state","labels","actionMenu","tags","piwik","bsBreakpoint","sviUrl",function(APP_CONFIG,$templateCache,$timeout,$log,costbasis,config,accountList,eventDispatcher,state,labels,actionMenu,tags,piwik,bsBreakpoint,sviUrl){var TEMPLATE_DEFAULT="",TEMPLATE_ADVANCED="Advanced",AVAILABLE_TEMPLATES=[TEMPLATE_DEFAULT,TEMPLATE_ADVANCED];return{replace:!1,scope:{account:"@",columns:"@",totalsConfig:"@",columnPriority:"@",groupByColumnPriority:"@",responsiveColumns:"@",pageSize:"@",showTotalDailyChange:"@",showTotalGainLoss:"@",showTotalPurchaseCost:"@",assetClassificationEnabled:"@",gridTemplate:"@",assetTypes:"@",termTypes:"@",groupByOptions:"@",sortingOptions:"@",isAccountDropdownDisabled:"@",isGroupByDisabled:"@",groupBy:"@",sortField:"=?",sortDir:"=?",areTotalsShown:"@",options:"@"},template:$templateCache.get("unrealizedGainLossContainer/unrealizedGainLossContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["expander","investmentType","quantity","symbol", "account", "dateAcquired","unitCost","marketPrice","dailyPriceChange","purchaseCost","marketValue","gainLoss","pctGainLoss","term","event","desc","dailyChange","expectedIncome","yield","accountType","covered","actionMenu"]'),svi.ng.defaultString($scope,$attrs,"totalsConfig",JSON.stringify({dailyChange:!1,expectedIncome:!1,purchaseCost:!1})),svi.ng.defaultString($scope,$attrs,"columnPriority",'["symbol", "account","quantity","gainLoss","investmentType","desc","marketValue","unitCost","dateAcquired","marketPrice","dailyPriceChange","purchaseCost","pctGainLoss","mutualFundGL","term","event","dailyChange","expectedIncome","yield","covered","accountType","tags","actionMenu","expander"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultInt($scope,$attrs,"pageSize",0,1e3),svi.ng.defaultFalse($scope,$attrs,"assetClassificationEnabled"),svi.ng.defaultValidString($scope,$element,"gridTemplate",AVAILABLE_TEMPLATES,TEMPLATE_DEFAULT),svi.ng.defaultString($scope,$attrs,"assetTypes",""),svi.ng.defaultString($scope,$attrs,"termTypes",""),svi.ng.defaultString($scope,$attrs,"yearTypes",""),svi.ng.defaultString($scope,$attrs,"groupByOptions",""),svi.ng.defaultString($scope,$attrs,"sortingOptions",""),svi.ng.defaultFalse($scope,$attrs,"isAccountDropdownDisabled"),svi.ng.defaultTrue($scope,$attrs,"isGroupByDisabled"),svi.ng.defaultString($scope,$attrs,"groupBy",""),svi.ng.defaultString($scope,$attrs,"sortField","instrument.symbol"),svi.ng.defaultString($scope,$attrs,"sortField","asc"),svi.ng.defaultTrue($scope,$attrs,"areTotalsShown"),svi.ng.defaultString($scope,$attrs,"options","")}catch(e){throw"sviUnrealizedGainLossContainer: "+e}var investmentType;$scope.isAdvanced=$scope.gridTemplate===TEMPLATE_ADVANCED,$scope.sortField||$scope.isAdvanced||($scope.sortDir=state.get("ugl-sortDir","asc")),$scope.sortField||$scope.isAdvanced||($scope.sortField=state.get("ugl-sortField","instrument.symbol")),$scope.currentPage=0,$scope.pageSize&&($scope.currentPage=1),$scope.totalPages=0,$scope.pageCacheID="",$scope.refocus=null,labels.setupLabels($scope,["costBasisContainer"],{}).then(function(){$scope.technicalError=JSON.stringify({type:"message",message:$scope.labels.uglExceededAmountOfRecordsError,resObject:"costbasis",statusCodeToCompare:"100"})}),$scope.initComplete=!1,$scope.costbasis=!1,svi.ng.defaultTrue($scope,$attrs,"showTotalDailyChange"),svi.ng.defaultTrue($scope,$attrs,"showTotalGainLoss"),svi.ng.defaultTrue($scope,$attrs,"showTotalPurchaseCost");try{(investmentType=state.get("ugl-investmentType"))||(investmentType=[])}catch(e){investmentType=[]}$scope.filters={investmentType:investmentType,termType:state.get("ugl-termType"),symbol:state.get("ugl-symbol")};try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.error("sviUnrealizedGainLossContainer: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns={}}try{svi.ng.parseJSON($scope,$attrs,"totalsConfig")}catch(e){$log.error("sviUnrealizedGainLossContainer: Error parsing totalsConfig: ",e,$attrs.totalsConfig),$scope.totalsConfig=$attrs.totalsConfig={}}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviUnrealizedGainLossContainer: Error parsing columnPriority: ",e,$attrs.columnPriority)}try{svi.ng.parseJSON($scope,$attrs,"groupByColumnPriority")}catch(e){$log.warn("sviUnrealizedGainLossContainer: Error parsing groupByColumnPriority: ",e,$attrs.groupByColumnPriority)}try{svi.ng.parseJSON($scope,$attrs,"sortingOptions")}catch(e){$log.warn("sviUnrealizedGainLossContainer: Error parsing sortingOptions: ",e,$attrs.sortingOptions)}$scope.currentColumnPriority=$scope.columnPriority,$scope.isCustomView=function(){return Boolean($scope.options)},$scope.$watch("sortField",function(val){state.set("ugl-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("ugl-sortDir",val).save()}),$scope.$watch("filters.investmentType",function(val){state.set("ugl-investmentType",val).save()}),$scope.$watch("filters.termType",function(val){state.set("ugl-termType",val).save()}),$scope.$watch("filters.symbol",function(val){state.set("ugl-symbol",val).save()}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.applySorting=function(){$scope.sortField=costbasis.getSortParam("sortField",$scope),$scope.sortDir=costbasis.getSortParam("sortDir",$scope),eventDispatcher.trigger("UGL.SORT.CHANGED",{field:$scope.sortField,dir:$scope.sortDir,shouldNotReload:!0})},$scope.getLoadParameters=function(){$scope.isSingleAccountSelected&&($scope.filters.groupBy=$scope.groupBy="");var data={sortField:$scope.sortField,sortDir:$scope.sortDir,switchAccounts:"N",isAdvanced:!$scope.isAdvanced||$scope.isSingleAccountSelected?"N":"Y"};$scope.pageSize&&(data.pageSize=$scope.pageSize,data.pageNum=$scope.currentPage,data.pageCacheID=$scope.pageCacheID),data.filterField=[],data.filterValue=[];var it=$scope.filters.investmentType.length,index=0;if(it){$scope.assetClassificationEnabled?data.filterField[index]="assetClassification":data.filterField[index]="investmentType",data.filterValue[index]=[];for(var i=0;i<it;i++)angular.isArray($scope.filters.investmentType[i].value)?data.filterValue[index]=php.array_merge(data.filterValue[index],$scope.filters.investmentType[i].value):data.filterValue[index].push($scope.filters.investmentType[i].value);index++}return $scope.filters.termType&&$scope.filters.termType.value&&(data.filterField[index]="term",data.filterValue[index]=[$scope.filters.termType.value],index++),$scope.filters.symbol&&(data.filterField[index]="symbol",data.filterValue[index]=$scope.filters.symbol.split(/\s*,\s*/)),($scope.filters.groupBy&&""!==$scope.filters.groupBy||null!==$scope.groupBy.length)&&($scope.isCustomView()?data.groupBy=$scope.filters.groupBy:data.groupBy=$scope.filters.groupBy||$scope.groupBy),data}}],link:function($scope,$element){var load=function(){if($scope.initComplete)return $scope.loader?void $scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout(load,200)},trackPageAnalytics=function(action,message,loadTime){var id=action.length?"unrealizedGainLossContainer/"+action:"unrealizedGainLossContainer";piwik.trackPage(id,message,loadTime,[{name:"numAccounts",index:1,value:1}])},loadCallback=function(){if(null!==$scope.account&&$scope.account!==[]){if($scope.groupBy&&$scope.isSingleAccountSelected&&!$scope.isCustomView())return eventDispatcher.trigger("ACCOUNT.CONTEXT.CHANGED",{currentAccount:$scope.account}),void $timeout(function(){sviUrl.href(window.location.origin+"/Web/account/unrealizedGainLoss/unrealizedGainLoss")},700);var invalidateCache=$scope.isAdvanced;$("html,body").animate({scrollTop:0},0);var data=$scope.getLoadParameters();return $scope.costbasis=null,$scope.totals=null,costbasis.getUGL($scope.account,data,!$scope.isAdvanced||$scope.isSingleAccountSelected?"N":"Y",invalidateCache)}},onSuccess=function(response){trackPageAnalytics("","Unrealized Gain Loss Container",1e3*response._loaderMetadata.elapsedTime),response.costbasis.gainLoss=response.costbasis.gainLoss?Object.values(response.costbasis.gainLoss):null,$scope.costbasis=response.costbasis,$scope.filters.groupBy&&""!==$scope.filters.groupBy&&($scope.costbasis.gainLoss=response.costbasis.gainLoss);var totals=response.costbasis.totals;$scope.isAdvanced&&(totals.gainLossPerPage=costbasis.getGainLossTotal($scope.costbasis.gainLoss,"UGL")),$scope.totals=totals,$scope.currentPage=$scope.costbasis.pageNum,$scope.totalPages=$scope.costbasis.pageCount,$scope.pageCacheID=$scope.costbasis.pageCacheID,!$scope.costbasis.gainLoss||angular.isArray($scope.costbasis.gainLoss)&&!$scope.costbasis.gainLoss.length?$scope.loader.setMessage($scope.labels.noUGLData):(-1!==$scope.columns.indexOf("tags")&&$scope.costbasis.symbolList&&tags.getBySymbol($scope.costbasis.symbolList).success(function(response){if(response.success){tags.ignoreUpdates(!0);for(var symbol="",i=0,l=$scope.costbasis.gainLoss.length;i<l;i++)try{symbol=$scope.costbasis.gainLoss[i].instrument.symbol,$scope.costbasis.gainLoss[i].tags=response.tags[symbol]}catch(e){$scope.costbasis.gainLoss[i].tags=[]}$timeout(function(){tags.ignoreUpdates(!1)})}}),$scope.isAdvanced&&($scope.currentColumnPriority=costbasis.getGroupByColumnPriority($scope.filters.groupBy||$scope.groupBy,$scope.groupByColumnPriority,$scope.columnPriority,$scope.isSingleAccountSelected,$scope.isCustomView())),$timeout(function(){void 0!==svi.marketHoverOver&&$element.get()&&svi.marketHoverOver.attachTooltips($element.get()[0]),svi.ui.pulse(".unrealized-gain-loss-grid, .unrealized-gain-loss-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)}))},onError=function(){trackPageAnalytics("error","Error: Unrealized Gain Loss Container",!1)};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){if(($scope.isAdvanced||$scope.account!==data.currentAccount&&angular.toJson($scope.account)!==angular.toJson(data.currentAccount))&&(1!==Object.keys(data).length||"currentAccount"!==Object.keys(data)[0])){var currentAccounts=data.currentAccount;$scope.account=currentAccounts,$scope.costbasis=!1,$scope.pageSize&&($scope.currentPage=1,eventDispatcher.trigger("UGL.PAGE.CHANGED",1)),$scope.isSingleAccountSelected=!data.hasOwnProperty("group")&&currentAccounts.length<=1,angular.isArray(currentAccounts)&&1<=currentAccounts.length&&eventDispatcher.trigger("UGL.MULTI.ACCOUNTS.MULTI.SELECT.CHECK.ALL"),$scope.applySorting(),load()}},!0),eventDispatcher.on("UGL.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,data.shouldNotReload||($scope.refocus='.svi-column-header[data-event="UGL.'+data.field+'"]',load()))},!0),eventDispatcher.on("UGL.PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.currentPage=data,load())},!0),eventDispatcher.on("UGL.INVESTMENT_TYPE.FILTER.CHANGED",function(e,data){if(!data||0===data.length)return 0===$scope.filters.investmentType.length?void 0:($scope.filters.investmentType=[],load());if($scope.filters.investmentType!==data){if($scope.filters.investmentType.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.filters.investmentType[i].value!==data[i].value){same=!1;break}if(same)return}$scope.filters.investmentType=data,$scope.pageSize&&($scope.currentPage=1),load()}},!0),eventDispatcher.on("UGL.TERM_TYPE.FILTER.CHANGED",function(e,data){$scope.filters.termType!==data&&($scope.filters.termType=data,$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("UGL.SYMBOL.FILTER.CHANGED",function(e,data){$scope.filters.symbol!==data&&($scope.filters.symbol=data,$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("UGL.ACTION.ZOOM",function(e,data){actionMenu.startHoldingZoom(data)},!1),eventDispatcher.on("UGL.ACTION.TRADE",function(e,data){actionMenu.startTradeWidget(data)},!1),eventDispatcher.on("UGL.REFRESH",function(){load()}),eventDispatcher.on("UGL.EXPORT",function(){var data=$scope.getLoadParameters();data.columns=JSON.stringify($scope.columns),costbasis.exportUGL($scope.account,data)}),eventDispatcher.on("APPLY.UGL.FILTERS.ADVANCED",function(evt,data){if(data){if(angular.isArray(data.accounts)){if(!data.accounts.length)return}else if(null===data.accounts||data.accounts===[])return;$scope.account=data.accounts,$scope.filters.investmentType=data.assetTypes,$scope.filters.termType=data.termType,$scope.filters.symbol=data.symbols,$scope.filters.groupBy=data.groupBy,$scope.isAdvanced&&$scope.isCustomView()&&($scope.groupBy=$scope.filters.groupBy),$scope.applySorting(),$scope.pageSize&&($scope.currentPage=1,eventDispatcher.trigger("UGL.PAGE.CHANGED",1)),load()}}),eventDispatcher.on("WINDOW.BREAKPOINT",function(e,data){data&&$scope.isAdvanced&&($scope.currentColumnPriority=costbasis.getGroupByColumnPriority($scope.filters.groupBy||$scope.groupBy,$scope.groupByColumnPriority,$scope.columnPriority,$scope.isSingleAccountSelected,$scope.isCustomView()))}),$timeout(function(){$scope.initComplete=!0,$scope.costbasis||load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviUnrealizedGainLossGrid",["$templateRequest","$window","$compile","$filter","labels","$sce","expander","floatThead",function($templateRequest,$window,$compile,$filter,labels,$sce,expander,floatThead){return{replace:!1,scope:{title:"@",columns:"=",totalsConfig:"=",columnPriority:"=",responsiveColumns:"@",costbasis:"=",sortField:"=?",sortDir:"=?",gridTemplate:"@",assetTypes:"@",termTypes:"@",groupByOptions:"@",isGroupByDisabled:"@",isAccountDropdownDisabled:"@",groupBy:"=",isSingleAccountSelected:"=?",areTotalsShown:"@",options:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultValidString($scope,$element,"gridTemplate",["","Advanced"],""),svi.ng.defaultString($scope,$attrs,"assetTypes",""),svi.ng.defaultString($scope,$attrs,"termTypes",""),svi.ng.defaultString($scope,$attrs,"groupByOptions",""),svi.ng.defaultTrue($scope,$attrs,"isGroupByDisabled"),svi.ng.defaultFalse($scope,$attrs,"isAccountDropdownDisabled"),svi.ng.defaultString($scope,$attrs,"groupBy",""),svi.ng.defaultFalse($scope,$attrs,"isSingleAccountSelected"),svi.ng.defaultTrue($scope,$attrs,"areTotalsShown"),svi.ng.defaultString($scope,$attrs,"options","")}catch(e){throw"sviUnrealizedGainLossGrid: "+e}$scope.groupedBySymbol="symbol"===$scope.groupBy,$scope.groupedByAccount="account"===$scope.groupBy,$scope.isGrouped=""!==$scope.groupBy,$scope.isAdvanced="Advanced"===$scope.gridTemplate,labels.setupLabels($scope,["assetTypes","costBasis"],{totalDailyChange:"Total Daily Change",totalGainLoss:"Total Gain/Loss",totalPurchaseCost:"Total Cost"}),$scope.mapEvent=function(item){var mappedEvent=$filter("ellipsis")(item.eventDesc,4,!0);return item.displayEventDetail?(mappedEvent=item.eventDesc+"<br>"+$scope.labels.washSaleAmount+": "+$filter("sviCurrency")(item.washSaleAmount),mappedEvent+="<br>"+$scope.labels.washSaleDate+": "+$filter("sviDate")(item.washSaleDate),mappedEvent+="<br>"+$scope.labels.disallowedLoss+": "+$filter("sviCurrency")(item.disallowedLoss),mappedEvent=$filter("ellipsis")(mappedEvent,4,!0)):item.displayWashSaleDetail&&(mappedEvent=item.eventDesc,"Multiple"!==item.eventDesc&&(mappedEvent+="<br>"+$scope.labels.disallowedLoss+": "+$filter("sviCurrency")(item.disallowedLoss)),mappedEvent=$filter("ellipsis")(mappedEvent,4,!0)),$sce.trustAsHtml(mappedEvent),mappedEvent},floatThead.init($scope,$element),expander.init($scope,"UGLGRID",$element),$scope.$watch("costbasis",function(){expander.reset($scope)});var breakpoints={account:{xs:3,sm:5,md:10},symbol:{xs:3,sm:7,md:10},default:{xs:3,sm:8,md:10}},setColumnSettings=function(){$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{actionMenu:!1,expander:!1,dailyPriceChange:"currencyIndicator",gainLoss:"currencyIndicator",pctGainLoss:"percentIndicator",mutualFundGL:"currencyIndicator",dailyChange:"currencyChange"},breakpoints:$scope.groupBy?breakpoints[$scope.groupBy]:breakpoints.default}};setColumnSettings(),$scope.$watch("columnPriority",function(){setColumnSettings()})}],link:function($scope,$element){var config={columns:$scope.columns};$templateRequest("gainLoss/unrealizedGainLossGrid/unrealizedGainLossGrid"+$scope.gridTemplate+".tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviColumnHeader",["$templateCache","eventDispatcher","labels",function($templateCache,eventDispatcher,labels){var getSortClass=function(dir){return"desc"===dir?"fas fa-sort-amount-up":"asc"===dir?"fas fa-sort-amount-down-alt":""};return{replace:!1,scope:{sortable:"@",eventId:"@",sortField:"@",initDir:"@",sortedField:"=",sortedDir:"=",text:"=",hideLabel:"@"},template:$templateCache.get("columnHeader/columnHeader.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultTrue($scope,$attrs,"sortable"),$attrs.sortable&&(svi.ng.required($attrs,"eventId"),svi.ng.required($attrs,"sortField")),svi.ng.defaultValidString($scope,$attrs,"initDir",["asc","desc"],"asc"),svi.ng.defaultFalse($scope,$attrs,"hideLabel")}catch(e){throw"sviColumnHeader: "+e}$scope.sortedField===$scope.sortField?$scope.sortDir=$scope.sortedDir:$scope.sortDir="",labels.setupLabels($scope,["general"]),$scope.sortClass=getSortClass($scope.sortDir),$scope.toggleSort=function(){switch($scope.sortDir){case"up":case"asc":$scope.sortDir="desc";break;case"down":case"desc":$scope.sortDir="asc";break;default:$scope.sortDir=$scope.initDir}$scope.sortClass=getSortClass($scope.sortDir),eventDispatcher.trigger($scope.eventId+".SORT.CHANGED",{field:$scope.sortField,dir:$scope.sortDir})},$scope.onClick=function(){$scope.sortable&&$scope.toggleSort()},eventDispatcher.on($scope.eventId+".SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField===data.field?($scope.sortDir=data.dir,$scope.sortClass=getSortClass(data.dir)):($scope.sortDir="",$scope.sortClass=""))},null,$element),$scope.$watch("sortDir",function(newVal){var ariaSort="none";$scope.sortable&&("desc"===newVal?ariaSort="descending":"asc"===newVal&&(ariaSort="ascending"),$scope.sortIconAriaLabel="asc"===$scope.sortDir?"Ascending":"Descending"),$element.attr("aria-sort",ariaSort)})}],link:function($scope,$element){$element.attr("role","columnheader")}}}]),angular.module("directives").directive("sviCustomView",["$templateCache","$window","APP_CONFIG","$log","$timeout","customView","labels","sviUrl","piwik","preferences","$q","eventDispatcher",function($templateCache,$window,APP_CONFIG,$log,$timeout,customView,labels,sviUrl,piwik,preferences,$q,eventDispatcher){return{replace:!1,scope:{targetUrl:"@",targetDeleteUrl:"@",viewName:"@",viewType:"@",viewId:"@",assetType:"@",labelSets:"@",columns:"@",columnOrder:"@",lockedColumns:"@",options:"@",optionsValidation:"@",lockedOptions:"@",enableDefaultCustomView:"@",edit:"@"},template:$templateCache.get("customView/customView.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){var defaultViewPreferenceKeys,currentDefaultView;try{svi.ng.required($attrs,"targetUrl"),svi.ng.required($attrs,"viewType"),svi.ng.defaultString($scope,$attrs,"viewName",""),svi.ng.defaultString($scope,$attrs,"viewId",!1),svi.ng.defaultString($scope,$attrs,"assetType",""),svi.ng.defaultString($scope,$attrs,"targetDeleteUrl",!1),svi.ng.defaultTrue($scope,$attrs,"enableDefaultCustomView"),svi.ng.defaultFalse($scope,$attrs,"edit"),defaultViewPreferenceKeys=[$scope.viewType,"defaultView"],$scope.enableDefaultCustomView&&preferences.get(defaultViewPreferenceKeys).then(function(response){if($scope.defaultView=!1,angular.isObject(response)&&response.hasOwnProperty("data")){var data=response.data;angular.isObject(data)&&data.hasOwnProperty("success")&&data.success&&data.hasOwnProperty("resource")&&(currentDefaultView=data.resource,$scope.defaultView=currentDefaultView===$scope.viewId)}},function(){$scope.defaultView=!1})}catch(e){throw"sviCustomView: "+e}$scope.message=!1,$scope.error=!1,$scope.showSpinner=!1,$scope.confirmDelete=!1,$scope.$watch("confirmDelete",function(newValue){newValue&&$timeout(function(){$("html,body").animate({scrollTop:$element.find(".confirm-delete-section").offset().top-APP_CONFIG.navHeightMobile});var btnConfirm=document.getElementById("btnConfirm"+$scope.id);btnConfirm&&btnConfirm.focus()})}),$scope.id=php.uniqid();var labelSets=["customView"];$attrs.labelSets&&(labelSets=labelSets.concat($attrs.labelSets.split(",")));var labelsPromise=labels.setupLabels($scope,labelSets,{viewName:"Edit Name",defaultViewName:"My Custom View",columns:"Columns",save:"Save",saving:"Saving",cancel:"Cancel",delete:"Delete",confirmDelete:"Deleting a custom view is permanent. Do you still wish to delete this view?",confirmDeleteBtn:"Yes, remove this view",cancelDeleteBtn:"No, keep this view",enableAssetView:"Group By Asset Type",pageSize:"Records Per Page",defaultView:"Default View",groupByOptions:"Group By"});try{$attrs.columns=JSON.parse($attrs.columns)}catch(e){$log.error("sviCustomView: Error parsing columns",e,$attrs.columns),$attrs.columns={}}var x,overrides=!!$attrs.columns.hasOwnProperty("all")&&$attrs.columns.all;if($attrs.assetType&&$attrs.columns.hasOwnProperty($attrs.assetType)?$attrs.columns=$attrs.columns[$attrs.assetType]:$attrs.columns.hasOwnProperty("default")&&($attrs.columns=$attrs.columns.default),overrides)for(x in overrides)overrides.hasOwnProperty(x)&&null!==overrides[x]&&($attrs.columns[x]=overrides[x]);var columns=[];for(x in $attrs.columns)$attrs.columns.hasOwnProperty(x)&&columns.push({key:x,display:"",value:$attrs.columns[x]});$scope.columns=$attrs.columns=columns;try{svi.ng.defaultString($scope,$attrs,"columnOrder","[]"),svi.ng.parseJSON($scope,$attrs,"columnOrder")}catch(e){$log.error("sviCustomView: ",e)}labelsPromise.then(function(){for(var i=0,l=$scope.columns.length;i<l;i++)$scope.labels.hasOwnProperty($scope.columns[i].key)&&($scope.columns[i].display=$scope.labels[$scope.columns[i].key].trim());$scope.columns.sort(function(a,b){return a.display===b.display?0:a.display>b.display?1:-1})});try{$attrs.lockedColumns=JSON.parse($attrs.lockedColumns)}catch(e){$log.error("sviCustomView: Error parsing lockedColumns: ",e,$attrs.lockedColumns),$attrs.lockedColumns={}}if(overrides)for(x in overrides)overrides.hasOwnProperty(x)&&null!==overrides[x]&&($attrs.lockedColumns[x]=!0);if($scope.lockedColumns=$attrs.lockedColumns,$attrs.options)try{$attrs.options=JSON.parse($attrs.options)}catch(e){$log.error("sviCustomView: Error parsing options: ",e,$attrs.options),$attrs.options={}}else $attrs.options={};if($scope.options=$attrs.options,$attrs.optionsValidation)try{$attrs.optionsValidation=JSON.parse($attrs.optionsValidation)}catch(e){$log.error("sviCustomView: Error parsing optionsValidation: ",e,$attrs.optionsValidation),$attrs.optionsValidation={}}else $attrs.optionsValidation={};if($scope.optionsValidation=$attrs.optionsValidation,$attrs.lockedOptions)try{$attrs.lockedOptions=JSON.parse($attrs.lockedOptions)}catch(e){$log.error("sviCustomView: Error parsing lockedOptions: ",e,$attrs.lockedOptions),$attrs.lockedOptions={}}else $attrs.lockedOptions={};$scope.lockedOptions=$attrs.lockedOptions;var onSuccess=function(response){if(response.error||!response.resource.id)return $scope.showSpinner=!1,$scope.message="There was an error saving your settings.",void piwik.trackEvent("Custom View",$scope.viewId?"Error Saving":"Error Creating");var id,promise;piwik.trackEvent("Custom View",$scope.viewId?"Save":"Create"),(id=response.resource.id,$scope.enableDefaultCustomView?(promise=$scope.defaultView?preferences.set(defaultViewPreferenceKeys,id):$q.when(id===currentDefaultView?preferences.remove(defaultViewPreferenceKeys):null),piwik.trackEvent("Custom View",$scope.defaultView?"Set Default View":"Unset Default View")):promise=$q.when(),promise).then(function(){$scope.viewId=response.resource.id,sviUrl.href($scope.targetUrl.replace("*VIEWID*",$scope.viewId))})},onError=function(response){$scope.showSpinner=!1,response.hasOwnProperty("error")&&angular.isString(response.error)&&0<response.error.length?$scope.error=response.error:$scope.message="There was an error saving your settings.",piwik.trackEvent("Custom View","Error")};$scope.shouldShowColumnOption=function(column){return column.display&&php.in_array(column.key,$scope.columnOrder)&&(!$scope.lockedColumns.hasOwnProperty(column.key)||!$scope.lockedColumns[column.key]||!0===column.value)},$scope.save=function(){for(var columns={},i=0,l=$scope.columns.length;i<l;i++)columns[$scope.columns[i].key]=$scope.columns[i].value;var name=$scope.viewName||$scope.labels.defaultViewName;if(25<name.length)$scope.error=$scope.labels.viewName+" must be less than 25 characters";else{for(var x in $scope.error=!1,$scope.options)if($scope.options.hasOwnProperty(x)&&$scope.optionsValidation.hasOwnProperty(x)&&$scope.optionsValidation[x].hasOwnProperty("type"))switch($scope.optionsValidation[x].type){case"numeric":if(!$.isNumeric($scope.options[x]))return void($scope.error=$scope.labels[x]+" must be a number.");if($scope.optionsValidation[x].hasOwnProperty("min")&&$scope.options[x]<$scope.optionsValidation[x].min)return void($scope.error=$scope.labels[x]+" must be at least "+$scope.optionsValidation[x].min+".");if($scope.optionsValidation[x].hasOwnProperty("max")&&$scope.options[x]>$scope.optionsValidation[x].max)return void($scope.error=$scope.labels[x]+" must be at most "+$scope.optionsValidation[x].max+".");break;case"boolean":if("boolean"!=typeof $scope.options[x])return void($scope.error=$scope.labels[x]+" must be true or false.");break;case"string":if($scope.optionsValidation[x].hasOwnProperty("minLength")&&$scope.options[x].length<$scope.optionsValidation[x].minLength)return void(1===$scope.optionsValidation[x].minLength?$scope.error=$scope.labels[x]+" is required.":$scope.error=$scope.labels[x]+" must be at least "+$scope.optionsValidation[x].minLength+" characters long.");if($scope.optionsValidation[x].hasOwnProperty("maxLength")&&$scope.options[x].length>$scope.optionsValidation[x].maxLength)return void($scope.error=$scope.labels[x]+" must be at most "+$scope.optionsValidation[x].maxLength+" characters long.");break;case"regex":if(!new RegExp($scope.optionsValidation[x].regex).test($scope.options[x]))return void($scope.error=$scope.labels[x]+" is not valid.")}$scope.showSpinner=!0,$scope.message=!1;var options=$scope.options;if($scope.disableOption&&options[$scope.disableOption].value)for(var key in options){var option=options[key];option.canDisableOtherFields||!option.value||option.canNotBeDisabled||(option.value=""),option.onlyForMultiAccount&&!$scope.isMultiAccount&&(option.value=""),delete option.canDisableOtherFields,delete option.onlyForMultiAccount,delete option.canNotBeDisabled}var data={columns:columns,options:options,name:name};$scope.viewId?customView.update($scope.viewType,$scope.viewId,data).success(onSuccess).error(onError):customView.create($scope.viewType,data).success(onSuccess).error(onError)}},$scope.cancel=function(){$scope.viewId?sviUrl.href($scope.targetUrl.replace("*VIEWID*",$scope.viewId)):$window.document.referrer?sviUrl.href($window.document.referrer):sviUrl.historyBack()},$scope.remove=function(){$scope.showSpinner=!0,$scope.message=!1;var remove=function(){customView.remove($scope.viewType,$scope.viewId).success(onRemoveSuccess).error(onError)};$scope.enableDefaultCustomView&&$scope.viewId===currentDefaultView?preferences.remove(defaultViewPreferenceKeys).then(function(){remove()}):remove()};var onRemoveSuccess=function(response){if(!response.success)return $scope.showSpinner=!1,$scope.message="There was an error saving your settings.",void piwik.trackEvent("Custom View","Error Deleting");piwik.trackEvent("Custom View","Delete"),$scope.targetDeleteUrl?sviUrl.href($scope.targetDeleteUrl):sviUrl.href($scope.targetUrl.replace("*VIEWID*","../"+$scope.viewType))};for(var key in $scope.areFieldsDisabled=!1,$scope.disableOption=null,$scope.options)$scope.options[key].canDisableOtherFields&&($scope.disableOption=key);var disableInputs=function(disable){for(var key in $scope.options)$scope.options[key].canNotBeDisabled||$scope.options[key].canDisableOtherFields||eventDispatcher.trigger(key+".INPUT.DISABLE",{value:disable})};$scope.$watch("options."+$scope.disableOption,function(newVal,oldVal){newVal!==oldVal&&($scope.areFieldsDisabled=!!newVal.value,disableInputs($scope.areFieldsDisabled))},!0),$scope.isBoolean=function(val){return"boolean"==typeof val},eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(evt,data){var prevVal=$scope.isMultiAccount;for(var k in $scope.isMultiAccount=1!==data.currentAccount.length,$scope.options){var option=$scope.options[k];!$scope.edit&&option.onlyForMultiAccount&&prevVal!==$scope.isMultiAccount&&(option.value=""),!option.canDisableOtherFields||option.onlyForMultiAccount&&!$scope.isMultiAccount||disableInputs(Boolean(option.value))}}),$scope.isObject=function(val){return"object"==typeof val}}]}}]),angular.module("directives").directive("sviRcToggleRow",["$timeout",function($timeout){var tabindexModified=!1,roleModified=!1;return{replace:!1,scope:{rc:"=sviRcToggleRow",toggleRow:"@",rcToggleDisabled:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.required($attrs,"sviRcToggleRow"),svi.ng.required($attrs,"toggleRow"),svi.ng.defaultFalse($scope,$attrs,"rcToggleDisabled")}catch(e){throw"sviRcToggleRow: "+e}$scope.onActivate=function(evt){"keypress"==evt.type&&13!=evt.which&&32!=evt.which||(evt.stopPropagation(),evt.preventDefault(),$scope.rc.onClick(evt),$element.attr("aria-expanded",$scope.rc.rowExpanded($scope.toggleRow)?"true":"false"))},$scope.$watch("rc.hasCollapsedColumns",function(newVal,oldVal){newVal&&!$scope.rcToggleDisabled?$element.hasClass("svi-rc-toggle-row")||($element.addClass("svi-rc-toggle-row"),$element.on("click",$scope.onActivate),$element.on("keypress",$scope.onActivate),$element.attr("tabindex")||(tabindexModified=!0,$element.attr("tabindex","0")),$element.attr("role")||(roleModified=!0,$element.attr("role","button")),$element.attr("aria-expanded",$scope.rc.rowExpanded($scope.toggleRow)?"true":"false"),$element.attr("aria-label","toggle hidden column details")):$element.hasClass("svi-rc-toggle-row")&&($element.removeClass("svi-rc-toggle-row"),$element.off("click",$scope.onActivate),$element.off("keypress",$scope.onActivate),tabindexModified&&$element.removeAttr("tabindex"),roleModified&&$element.removeAttr("role"),$element.removeAttr("aria-expanded"),$element.removeAttr("aria-label"))})}]}}]),angular.module("directives").directive("sviResponsiveColumns",["APP_CONFIG","$timeout","$parse","$filter","bsBreakpoint","eventDispatcher",function(APP_CONFIG,$timeout,$parse,$filter,bsBreakpoint,eventDispatcher){var enabled=!0;return{restrict:"A",controller:["$scope","$element","$attrs",function($scope,$element,$attrs){var priority=null,formatters={},collapsedCols=[],expandedRows={},rowDetails={},allColNames=[],allColLabels=[],breakpoints=APP_CONFIG.responsiveColsBreakpoints,setSettings=function(settings){settings.enabled!==undefined&&(enabled=settings.enabled),settings.priority!==undefined&&(priority=settings.priority),settings.formatters!==undefined&&(formatters=settings.formatters),settings.breakpoints!==undefined&&(breakpoints=settings.breakpoints)};if($attrs.sviResponsiveColumns){var settings=$parse($attrs.sviResponsiveColumns)($scope)||{};setSettings(settings)}$scope.$watch($attrs.sviResponsiveColumns,function(newValue){newValue&&(setSettings(newValue),$scope.rc.reset())}),$element.closest(".svi-widget").length&&breakpoints.hasOwnProperty("widget")&&(breakpoints=breakpoints.widget);var rc=$scope.rc=this;this.reset=function(){collapsedCols=[],expandedRows={},rowDetails={},rc.hasCollapsedColumns=!!collapsedCols.length,rc.refreshHeader(!0),rc.updateBreakpoint(bsBreakpoint.getBreakpoint())},this.refreshHeader=function(updateColNames){updateColNames&&(allColNames=[]),allColLabels=[];var headerRow=$element.find("thead > tr").first();$element.prev().hasClass("floatThead-container")&&(0===headerRow.length||headerRow.hasClass("size-row"))&&(headerRow=$element.prev().find("thead > tr").first());var text,allEmpty=!0;headerRow.find("th").each(function(colNum){updateColNames&&allColNames.push(this.getAttribute("data-col-name")),text=$(this).text(),allColLabels.push(text),""!==text.trim()&&(allEmpty=!1)}),allEmpty&&(allColLabels=null)},this.hasCollapsedColumns=!1,this.hasCollapsedColumns=!!collapsedCols.length,this.getVisibleColumns=function(){if(!rc.hasCollapsedColumns)return allColNames;var visible=[];return allColNames.forEach(function(colName){rc.isColCollapsed(colName)||visible.push(colName)}),visible},this.updateBreakpoint=function(currentBreakpoint){var size=bsBreakpoint.getBreakpointName(currentBreakpoint);rc.showNumberOfCols(breakpoints.hasOwnProperty(size)?breakpoints[size]:-1)},this.showNumberOfCols=function(num){var realPriority;-1===num&&(num=allColNames.length);for(var len=(realPriority=priority||allColNames).length,shown=0,i=0;i<len;i++){var colName=realPriority[i];-1!==allColNames.indexOf(colName)&&(shown<num?rc.expandCol(colName):rc.collapseCol(colName),shown++)}$element.trigger("update"),$scope.$broadcast("responsiveColsUpdated"),$timeout(function(){$element.trigger("reflow")})},this.rowExpanded=function(rowName){return expandedRows[rowName]},this.expandRow=function(rowName){rc.hasCollapsedColumns&&(expandedRows[rowName]=!0)},this.collapseRow=function(rowName){expandedRows[rowName]=!1},this.expandAllRows=function(){rc.hasCollapsedColumns&&$element.find("tr[data-toggle-row]").each(function(){rc.expandRow(this.dataset.toggleRow)})},this.collapseAllRows=function(){$element.find("tr[data-toggle-row]").each(function(){rc.collapseRow(this.dataset.toggleRow)})},this.getRowDetails=function(rowName){if(!rc.rowExpanded(rowName))return[];var details=rowDetails[rowName];if(!details){details=[],null===allColLabels&&rc.refreshHeader(!1);for(var cols=$element.find('tr[data-toggle-row="'+rowName+'"] > td'),i=0;i<allColNames.length;i++){var colName=allColNames[i];if(-1!==collapsedCols.indexOf("hide-"+colName)){var formatter=formatters[colName];!1!==formatter&&(value=php.htmlspecialchars(cols.eq(i).text()),angular.isString(formatter)&&(formatter=formatters[colName]=$filter(formatter)),angular.isFunction(formatter)&&(value=formatter(value)),details.push({label:allColLabels[i],value:value}))}}rowDetails[rowName]=details}return details},this.getCollapsedCols=function(){return collapsedCols},this.isColCollapsed=function(colName){return-1!==collapsedCols.indexOf("hide-"+colName)},this.collapseCol=function(colName){-1===collapsedCols.indexOf("hide-"+colName)&&(collapsedCols.push("hide-"+colName),rowDetails={},rc.hasCollapsedColumns=!!collapsedCols.length)},this.expandCol=function(colName){var index=collapsedCols.indexOf("hide-"+colName);-1!==index&&(collapsedCols.splice(index,1),rowDetails={},rc.hasCollapsedColumns=!!collapsedCols.length,rc.hasCollapsedColumns||rc.collapseAllRows())},this.onClick=function(e){if(!$(e.target).closest(".ignoreToggle").length){var rowName=e.currentTarget.dataset.toggleRow;rc.rowExpanded(rowName)?rc.collapseRow(rowName):rc.expandRow(rowName),$scope.$applyAsync()}}}],require:"?ngModel",link:function($scope,$element,$attrs,ngModel){enabled&&($element.addClass("responsive-enabled"),eventDispatcher.on("WINDOW.BREAKPOINT",function(e,data){$scope.rc.updateBreakpoint(data.current)},null,$element),$scope.rc.reset(),ngModel&&ngModel.$formatters.push(function(){$timeout(function(){$scope.rc.reset()})}))}}}]),angular.module("directives").directive("sviTotalsLabel",["$timeout",function($timeout){return{restrict:"A",require:["?ngModel","?sviResponsiveColumns"],link:function($scope,$element,$attrs,controllers){var ngModel=controllers[0],rc=controllers[1];$element.addClass("svi-totals-label");var totalsLabel=$('<span class="totalsLabel"></span>');$attrs.sviTotalsLabel!==undefined&&$attrs.$observe("sviTotalsLabel",function(val){totalsLabel.html(val||"")}),svi.ng.defaultTrue($scope,$attrs,"sviTotalsLabelHideSecondCol");var update=function(){var totals=$element.find("tr.totals").eq(0);if(totals.find("td.totals1").removeClass("totals1"),totals.find("td.totals2").removeClass("totals2"),totalsLabel){var visible;if(rc){var visibleColumns=rc.getVisibleColumns();0<visibleColumns.length&&((visible=totals.find('td[data-col-name="'+visibleColumns[0]+'"]')).prepend(totalsLabel).addClass("totals1"),visible.attr("role","rowheader")),$scope.sviTotalsLabelHideSecondCol&&1<visibleColumns.length&&(visible=totals.find('td[data-col-name="'+visibleColumns[1]+'"]')).addClass("totals2")}else(visible=totals.find("td:not(.ng-hide)")).eq(0).prepend(totalsLabel).addClass("totals1"),$scope.sviTotalsLabelHideSecondCol&&visible.eq(1).addClass("totals2");visible&&visible.text()&&visible.text()!==totalsLabel.text()&&visible.addClass("total-td-not-empty")}};update(),ngModel&&ngModel.$formatters.push(function(){$timeout(update)}),$scope.$on("responsiveColsUpdated",function(event,data){$timeout(update)})}}}]),angular.module("directives").directive("sviAccountGroupMgr",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","accountGroup","preferences","piwik",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,accountGroup,preferences,piwik){return{replace:!1,scope:{filterBoidFromGroups:"@"},template:$templateCache.get("accountGroupMgr/accountGroupMgr.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"filterBoidFromGroups",""),$scope.filterBoidFromGroups?$scope.noGroupBoids=$scope.filterBoidFromGroups.split(","):$scope.noGroupBoids=[],$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.accountList=accountList.getAccountsWithNicknames(),$scope.groups=[],$scope.accountNames={},angular.forEach(accountList.getAccountObjects(),function(account,index){$scope.accountNames[account.account]=account.nickname}),$scope.getAccountName=function(account){return $scope.accountNames[account]},$scope.view=svi.ng.defaultString($scope,$attrs,"view","create"),$scope.accountGroup={},$scope.backToListBtn=!1,$scope.showConfirm={},$scope.invalidGroupName="",$scope.defaultGroup=APP_CONFIG.defaultGroup,$scope.tmpAccountList=[],labels.setupLabels($scope,["general","multiAccount"],{}),$scope.$watch("accountGroup.group.accountInfo.accounts",function(newVal,oldVal){if(newVal!==oldVal){for(var accounts=[],i=0;i<$scope.accountGroup.group.accountInfo.accounts.length;i++)!0===$scope.accountGroup.group.accountInfo.accounts[i].selected&&accounts.push($scope.accountGroup.group.accountInfo.accounts[i].index);$scope.tmpAccountList=accounts}},!0),this.getNextAvailableNickname=function(){var valid,nickname,nicknameLower,groups=$scope.groups,count=1;do{valid=!0,nicknameLower=(nickname=$scope.labels.defaultGroupPrefix+" "+count++).toLowerCase();for(var i=0,l=groups.length;i<l;i++)if(nicknameLower===groups[i].nickname.toLowerCase()){valid=!1;break}}while(!valid);return nickname},$scope.createGroup=function(){$scope.view="list",$scope.accountGroup.group.nickname=$scope.api.getNextAvailableNickname()},$scope.saveGroup=function(){if(!0===$scope.createGroupForm.$invalid)return!1;null!=$scope.accountGroup.group.id?$scope.loader.setLoadHandler(updateGroupCallback).load().then(function(response){onSaveSuccess(response,"update",$scope.accountGroup.group.id)},onSaveError):$scope.loader.setLoadHandler(createGroupCallback).load().then(function(response){onSaveSuccess(response,"create")},onSaveError)};var createGroupCallback=function(){var promise=accountGroup.create($scope.accountGroup.group.nickname,$scope.tmpAccountList);return $scope.createGroupForm.$setPristine(),promise},updateGroupCallback=function(){var promise=accountGroup.update($scope.accountGroup.group.id,$scope.accountGroup.group.nickname,$scope.tmpAccountList);return $scope.createGroupForm.$setPristine(),promise};$scope.showView=function(view){$scope.view=view},$scope.removeAccount=function(groupIndex,accountIndex){$scope.groups[groupIndex].accountInfo[accountIndex]&&$scope.groups[groupIndex].accountInfo.splice(accountIndex,1)},$scope.confirmDeleteGroup=function(index,groupId){$("#"+groupId+"-accounts").collapse("show"),$scope.showConfirm[index]=!0},$scope.resetConfirm=function(index,groupId){$scope.showConfirm[index]=!1,$("#"+groupId+"-accounts").collapse("hide")},$scope.editGroup=function(groupId){$scope.view="edit",function(group){resetGroupModel(),$scope.accountGroup.group.nickname=group.nickname,$scope.accountGroup.group.id=group.id;for(var a,accountList=[],i=0;i<$scope.accountGroup.group.accountInfo.accounts.length;i++)if(a=$scope.accountGroup.group.accountInfo.accounts[i],!$scope.noGroupBoids||!php.in_array(a.boid,$scope.noGroupBoids)){var selected=isAccountInGroup(a.account,group),account={account:a.account,nickname:a.nickname,index:a.index,boid:a.boid,selected:selected};accountList.push(account)}$scope.accountGroup.group.accountInfo.accounts=accountList}(getGroupById(groupId))},$scope.removeGroup=function(groupId){getGroupById(groupId)&&($scope.resetConfirm(getGroupIndexById(groupId)),$scope.groups.splice(getGroupIndexById(groupId),1),$scope.loader.setLoadHandler(deleteGroupCallback).load(groupId).then(function(response){onSaveSuccess(response,"delete",groupId)},onSaveError))};var deleteGroupCallback=function(groupId){return accountGroup.remove(groupId)};$scope.btnCancel=function(closeModal){resetGroupModel(),$scope.createGroupForm.$setPristine(),$("#createGroup").find(".has-error").removeClass("has-error"),!0===closeModal?$($element).closest(".modal").modal("hide"):$scope.showView("list")},$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)};var loadCallback=function(invalidateCache){return function(invalidateCache){return accountGroup.list(invalidateCache)}(invalidateCache)},onSuccess=function(data){var response=data.data||data;if(response.success){for(var accounts=accountList.getAccountObjects(),i=0;i<response.groups.length;i++){var group=response.groups[i];response.groups[i].accounts=$scope.filterGroupAccounts(accounts,group.accounts)}$scope.groups=response.groups,resetGroupModel(),0<$scope.groups.length&&$scope.showView("list")}else response.group.status.statusMessage?$scope.loader.setError(response.group.status.statusMessage):$scope.loader.setError($scope.labels.dataRenderError)},onError=function(response){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackEvent("Account Group","Error")},onSaveSuccess=function(response,mode,groupId){response.success?(null===$scope.accountGroup.group.id?"create"===mode?(eventDispatcher.trigger("ACCOUNT.GROUP.CREATED",{accountGroup:$scope.accountGroup}),piwik.trackEvent("Account Group","Create")):(eventDispatcher.trigger("ACCOUNT.GROUP.REMOVED",{groupId:groupId}),piwik.trackEvent("Account Group","Delete")):(eventDispatcher.trigger("ACCOUNT.GROUP.UPDATED",{accountGroup:$scope.accountGroup}),piwik.trackEvent("Account Group","Update")),$scope.load(!0)):(response.group.status.statusMessage?$scope.loader.setError(response.group.status.statusMessage):$scope.loader.setError($scope.labels.dataRenderError),piwik.trackEvent("Account Group","Error"))},onSaveError=function(response){};function resetGroupModel(){$scope.accountGroup={group:{nickname:$scope.api.getNextAvailableNickname(),invalid:!1,id:null,accountInfo:{accounts:[],invalid:!1}}};for(var accounts=accountList.getAccountObjects(),i=0;i<accounts.length;i++)$scope.noGroupBoids&&php.in_array(accounts[i].boid,$scope.noGroupBoids)||$scope.accountGroup.group.accountInfo.accounts.push({account:accounts[i].account,nickname:accounts[i].nickname,index:accounts[i].index,boid:accounts[i].boid,selected:!1});$scope.tmpAccountList=[]}function isAccountInGroup(account,group){for(var i=0;i<group.accounts.length;i++)if(group.accounts[i].account==account)return!0;return!1}function getGroupById(groupId){for(var i=0;i<=$scope.groups.length;i++)if(groupId==$scope.groups[i].id)return $scope.groups[i]}function getGroupIndexById(groupId){for(var i=0;i<=$scope.groups.length;i++)if(groupId==$scope.groups[i].id)return i}$scope.focusSelect=function($event){$event.target.select()},$scope.filterGroupAccounts=function(accountList,groupAccounts){for(var i=0;i<groupAccounts.length;i++){for(var accountExists=!1,j=0;j<accountList.length;j++)if(groupAccounts[i].account===accountList[j].account){if($scope.noGroupBoids&&php.in_array(accountList[j].boid,$scope.noGroupBoids)){accountExists=!1;break}accountExists=!0;break}!1===accountExists&&groupAccounts.splice(i--,1)}return groupAccounts},$scope.$watch("groups",function(newVal,oldVal){0===$scope.groups.length&&($scope.view="create")},!0),$scope.$watch("defaultGroup",function(newVal,oldVal){newVal!==oldVal&&newVal!==APP_CONFIG.defaultGroup&&(null===newVal?preferences.remove(["accountGroup","default"]):preferences.set(["accountGroup","default"],newVal),APP_CONFIG.defaultGroup=newVal)},!0),$scope.handleAccountEvent=function(e,account){$scope.createGroupForm["accountGroup.group.accountInfo.accounts"].$dirty=!0},$scope.handleDefaultGroupEvent=function($event,groupId){$scope.defaultGroup===groupId?$scope.defaultGroup=null:$scope.defaultGroup=groupId},$scope.api=this,$timeout(function(){resetGroupModel(),$scope.load()},300)}],link:function($scope,$element,$attrs){var validateNickname=function(nickname){angular.isUndefined(nickname)&&(nickname=$scope.accountGroup.group.nickname);if($scope.invalidGroupName=$scope.labels.invalidGroupNameFormat,!/^[a-z0-9 ]{1,25}$/i.test(nickname))return $scope.createGroupForm["accountGroup.group.nickname"].$setValidity("nicknameRegex",!1),$scope.createGroupForm["accountGroup.group.nickname"].$setValidity("nicknameExists",!0),!1;$scope.createGroupForm["accountGroup.group.nickname"].$setValidity("nicknameRegex",!0);for(var groups=$scope.groups,i=0,l=groups.length;i<l;i++)if($scope.accountGroup.group.id!==groups[i].id){var groupNickName=groups[i].nickname;if(nickname.toLowerCase()===groupNickName.toLowerCase())return $scope.createGroupForm["accountGroup.group.nickname"].$setValidity("nicknameExists",!1),$scope.invalidGroupName=$scope.labels.groupNameExists,!1}return $scope.createGroupForm["accountGroup.group.nickname"].$setValidity("nicknameExists",!0),!0},addValidators=function(){$scope.createGroupForm?($scope.createGroupForm["accountGroup.group.nickname"].$validators.nickname=validateNickname,$scope.createGroupForm["accountGroup.group.nickname"].$formatters.push(function(value){return validateNickname(value),value})):$timeout(addValidators,250)};$timeout(addValidators)}}}]),angular.module("directives").directive("sviGroupAccountDropdown",["$templateCache","accountList","APP_CONFIG","$timeout","eventDispatcher","accountGroup","labels","switchAccount",function($templateCache,accountList,APP_CONFIG,$timeout,eventDispatcher,accountGroup,labels,switchAccount){return{replace:!1,scope:{buttonClass:"@",fixDropdown:"@",showAllAccounts:"@",filterBoid:"@",filterBoidFromGroups:"@",dropdownClasses:"@",shouldFilterAccounts:"@"},template:$templateCache.get("groupAccountDropdown/groupAccountDropdown.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"buttonClass",""),svi.ng.defaultFalse($scope,$attrs,"fixDropdown"),svi.ng.defaultTrue($scope,$attrs,"showAllAccounts"),svi.ng.defaultString($scope,$attrs,"filterBoid",""),svi.ng.defaultString($scope,$attrs,"filterBoidFromGroups",""),svi.ng.defaultTrue($scope,$attrs,"shouldFilterAccounts"),svi.ng.defaultString($scope,$attrs,"dropdownClasses",""),$scope.filterBoidFromGroups?$scope.noGroupBoids=$scope.filterBoidFromGroups.split(","):$scope.noGroupBoids=[],$scope.id=php.uniqid("gad"),$scope.accountList=accountList.getAccountObjects(),$scope.groups=[],$scope.groupsById=null,$scope.selectedGroup=null,$scope.viewMode=APP_CONFIG.viewMode;var _filterBoids=[];if($scope.filterBoid&&(_filterBoids=$scope.filterBoid.split(",")),$scope.filterAccountsByBoid=function(accounts,boIds){if(angular.isUndefined(boIds)&&(boIds=_filterBoids),angular.isArray(boIds)&&0<boIds.length){for(var a,list=[],i=0,l=accounts.length;i<l;i++)angular.isObject(accounts[i])?php.in_array(accounts[i].boid,boIds)||list.push(accounts[i]):(a=accountList.getAccountObjectByIndex(accounts[i]),php.in_array(a.boid,boIds)||list.push(a.index));return list}return accounts},$scope.accountList=$scope.filterAccountsByBoid($scope.accountList,_filterBoids),0<$scope.noGroupBoids.length){$scope.hasGroupAccounts=!1;for(var i=0,l=$scope.accountList.length;i<l;i++)if(!php.in_array($scope.accountList[i].boid,$scope.noGroupBoids)){$scope.hasGroupAccounts=!0;break}}else $scope.hasGroupAccounts=!0;labels.setupLabels($scope,["general","multiAccount"],{}),$scope.showGroupMgr=function(){$("#svi-account-group-mgr-modal").modal("show")},$scope.hideGroupMgr=function(){$("#svi-account-group-mgr-modal").modal("hide")},$scope.loadGroups=function(invalidateCache){angular.isUndefined(invalidateCache)&&(invalidateCache=!1);return accountGroup.list(invalidateCache).then(function(data){var response=data.data||data;if(response.success){var id;$scope.groups=response.groups,$scope.groupsById={};for(var i=0,l=$scope.groups.length;i<l;i++)id=$scope.groups[i].id,0<$scope.noGroupBoids.length&&(!$scope.groups[i].hasOwnProperty("accountIndexes")&&$scope.groups[i].hasOwnProperty("accounts")?$scope.groups[i].accountIndexes=accountList.getIndexesFromObjects($scope.groups[i].accounts):$scope.groups[i].accountIndexes=[],1<$scope.groups[i].accountIndexes.length&&$scope.groups[i].accountIndexes.length!=$scope.filterAccountsByBoid($scope.groups[i].accountIndexes,$scope.noGroupBoids).length&&($scope.groups[i].accountIndexes=[],$scope.groups[i].accounts=[],$scope.groups[i].numAccounts=0)),$scope.groupsById[id]=$scope.groups[i];$scope.groupsById.hasOwnProperty($scope.selectedGroup)||($scope.selectedGroup=null),null!=$scope.selectedGroup&&($scope.groupsById[$scope.selectedGroup].hasOwnProperty("accountIndexes")||($scope.groupsById[$scope.selectedGroup].accountIndexes=accountList.getIndexesFromObjects($scope.groupsById[$scope.selectedGroup].accounts)),$scope.selectedAccounts=$scope.filterAccountsByBoid($scope.groupsById[$scope.selectedGroup].accountIndexes),1<$scope.selectedAccounts.length&&($scope.selectedAccounts=$scope.filterAccountsByBoid($scope.selectedAccounts,$scope.noGroupBoids))),accountList.setGroupList($scope.groupsById),updateSelectedLabel()}},function(data){})},$scope.isAccountSelected=function(index){return php.in_array(index,$scope.selectedAccounts)},$scope.isGroupSelected=function(group){return $scope.selectedGroup==group},$scope.selectAccount=function(index){$scope.selectedAccounts=[index],$scope.selectedGroup=null},$scope.selectAll=function(){$scope.selectedAccounts=accountList.getIndexesFromObjects($scope.accountList),$scope.selectedGroup=null},$scope.displayGroup=function(group){var numAccts=0,nickname="Unnamed Group";if(!group||!angular.isObject(group))return"";group.hasOwnProperty("accounts")&&(numAccts=group.accounts.length),group.hasOwnProperty("nickname")&&(nickname=group.nickname);var label=numAccts+" "+(1==numAccts?$scope.labels.account:$scope.labels.accounts);return nickname+accountList.getNicknameSeparator()+label},$scope.selectGroup=function(group){$scope.selectedGroup=group},$scope.broadcast=function(){null===$scope.selectedGroup?angular.isArray($scope.selectedAccounts)&&0<$scope.selectedAccounts.length&&switchAccount.multi($scope.selectedAccounts,$scope.shouldFilterAccounts):angular.isArray($scope.selectedAccounts)&&0<$scope.selectedAccounts.length&&switchAccount.group($scope.groupsById[$scope.selectedGroup])},$scope.onDropdown=function(e){$scope.fixDropdown&&svi.fixDropdown.onClick(e)},$scope.$watch("selectedGroup",function(newValue,oldValue){angular.isDefined(oldValue)&&newValue!=oldValue&&($scope.groupsById.hasOwnProperty($scope.selectedGroup)?($scope.groupsById[$scope.selectedGroup].hasOwnProperty("accountIndexes")||($scope.groupsById[$scope.selectedGroup].accountIndexes=accountList.getIndexesFromObjects($scope.groupsById[$scope.selectedGroup].accounts)),$scope.selectedAccounts=$scope.filterAccountsByBoid($scope.groupsById[$scope.selectedGroup].accountIndexes),1<$scope.selectedAccounts.length&&($scope.selectedAccounts=$scope.filterAccountsByBoid($scope.selectedAccounts,$scope.noGroupBoids))):$scope.selectedGroup=null,$scope.broadcast()),updateSelectedLabel()},!0),$scope.$watch("selectedAccounts",function(newValue,oldValue){angular.isArray(newValue)&&angular.isDefined(oldValue)&&$scope.broadcast(),updateSelectedLabel()},!0);var updateSelectedLabel=function(){if(angular.isArray($scope.selectedAccounts)&&0<$scope.selectedAccounts.length){if(null!=$scope.selectedGroup){var selectedGroup=$scope.groupsById[$scope.selectedGroup];return $scope.selectLabel=$scope.displayGroup(selectedGroup),$scope.selectLabel}if(1===$scope.selectedAccounts.length)return $scope.selectLabel=accountList.displayAccount(accountList.getAccountObjectByIndex($scope.selectedAccounts[0]));if($scope.selectedAccounts.length===$scope.accountList.length)return $scope.selectLabel=$scope.labels.allAccountsSelected;if(1<$scope.selectedAccounts.length)return $scope.selectLabel=$scope.selectedAccounts.length+" "+$scope.labels.someAccountsSelected}return $scope.selectLabel=$scope.labels.selectMultiAccount};$timeout(function(){$scope.loadGroups();var currentGroup=accountList.getCurrentGroup();if(currentGroup&&(null===$scope.groupsById?($scope.groupsById={},$scope.groups.push(currentGroup),$scope.groupsById[currentGroup.id]=currentGroup,$scope.selectedGroup=currentGroup.id):$scope.groupsById.hasOwnProperty(currentGroup.id)&&($scope.selectedGroup=currentGroup.id)),$scope.selectedAccounts=accountList.getCurrentAccountIndexList()||[],0===$scope.selectedAccounts.length||!$scope.selectedGroup){$scope.selectedGroup=null;var list=accountList.getCurrentAccountIndexList();angular.isArray(list)&&($scope.selectedAccounts=$scope.filterAccountsByBoid(list),1<$scope.selectedAccounts.length&&($scope.selectedAccounts=$scope.filterAccountsByBoid($scope.selectedAccounts,$scope.noGroupBoids))),(!angular.isArray($scope.selectedAccounts)||$scope.selectedAccounts.length<=1)&&($scope.selectedAccounts=[accountList.getCurrentAccountIndex()])}if($scope.selectedGroup&&$scope.groupsById&&$scope.groupsById.hasOwnProperty($scope.selectedGroup)){var selectedAccounts=$scope.groupsById[$scope.selectedGroup].accounts;if(angular.isArray(selectedAccounts)&&0<selectedAccounts.length){var index;$scope.selectedAccounts=[];for(var accounts=accountList.getAccountObjects(),maxIndex=accounts.length,i=0;i<selectedAccounts.length;i++)index=parseInt(selectedAccounts[i].index),!isNaN(index)&&index<maxIndex&&!php.in_array(accounts[index].boid,_filterBoids)&&$scope.selectedAccounts.push(index)}}if($scope.broadcast(),1<$scope.selectedAccounts.length){var len=$scope.selectedAccounts.length;$scope.selectedAccounts=$scope.filterAccountsByBoid($scope.selectedAccounts,$scope.noGroupBoids),$scope.selectedAccounts.length!=len&&$scope.selectedGroup&&($scope.selectedGroup=null,$scope.selectedAccounts=[])}eventDispatcher.on("ACCOUNT.GROUP.CONTEXT.CHANGED",function(e,data){if(data.hasOwnProperty("group")&&(null===data.group?$scope.selectedGroup=null:accountList.isValidGroup(data.group)&&($scope.selectedGroup=data.group.id)),angular.isArray(data.selectedAccounts))if(0<data.selectedAccounts.length){if($scope.selectedAccounts=$scope.filterAccountsByBoid(data.selectedAccounts),1<$scope.selectedAccounts.length){var len=$scope.selectedAccounts.length;$scope.selectedAccounts=$scope.filterAccountsByBoid($scope.selectedAccounts,$scope.noGroupBoids),$scope.selectedAccounts.length!=len&&($scope.selectedGroup=null,$scope.selectedAccounts=[])}}else $scope.selectedAccounts=[]}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){if(angular.isArray(data.currentAccount)){if($scope.selectedAccounts=$scope.filterAccountsByBoid(data.currentAccount),1<$scope.selectedAccounts.length){var len=$scope.selectedAccounts.length;$scope.selectedAccounts=$scope.filterAccountsByBoid($scope.selectedAccounts,$scope.noGroupBoids),$scope.selectedAccounts.length!=len&&($scope.selectedGroup=null,$scope.selectedAccounts=[])}if(null!==$scope.selectedGroup){var group=$scope.groupsById[$scope.selectedGroup];group.hasOwnProperty("accountIndexes")||(group.accountIndexes=accountList.getIndexesFromObjects(group.accounts)),angular.equals($scope.selectedAccounts.sort(),group.accountIndexes.sort())||($scope.selectedGroup=null)}}}),updateSelectedLabel()},200),eventDispatcher.on("ACCOUNT.GROUP.CREATED",$scope.loadGroups),eventDispatcher.on("ACCOUNT.GROUP.UPDATED",$scope.loadGroups),eventDispatcher.on("ACCOUNT.GROUP.REMOVED",function(event,data){$scope.selectedGroup==data.groupId&&$scope.selectAccount(accountList.getCurrentAccountIndex()),$scope.loadGroups()})}],link:function($scope,$element,$attrs){$("#svi-account-group-mgr-modal").appendTo(".modals-section")}}}]),angular.module("svi.hello").directive("sviHelloChart",["APP_CONFIG","$templateCache","$timeout","labels","loader","highcharts","piwik",function(APP_CONFIG,$templateCache,$timeout,labels,loader,highcharts,piwik){return{replace:!1,scope:{chartType:"@",donutInnerSize:"@"},template:$templateCache.get("helloChart/helloChart.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="helloWorld",this.friendlyName="Hello World";try{svi.ng.defaultValidString($scope,$attrs,"chartType",["pie","donut"],"donut"),svi.ng.defaultString($scope,$attrs,"donutInnerSize","20%")}catch(e){throw"sviHelloChart: "+e}$scope.id=php.uniqid("helloChart"),$scope.chart=null,labels.setupLabels($scope,["general","helloWorld"]),$scope.getOptions=function(){return{chart:{type:"pie",renderTo:$element.find(".chart")[0],height:$element.find(".chart").width()||300},accessibility:{description:"Chart showing demo data."},credits:{enabled:!1},title:{text:"Hello Chart",style:{display:"none"}},series:[{id:"assets",name:"Asset Allocation",data:[],innerSize:"donut"===$scope.chartType?$scope.donutInnerSize:"0%",dataLabels:{formatter:function(){return 2.5<=this.y?Math.round(this.y)+"%":""},style:{textOutline:!1}}}]}};loader.attach($scope,$element,function(invalidateCache){return loader.getDummyChartData(invalidateCache)},function(data){piwik.trackDataLoad($scope,data);var options=$.extend(!0,{},$scope.getOptions()),seriesData=function(data){return data.chart}(data);options.series[0].data=seriesData,$scope.chart&&$scope.chart.destroy(),$scope.chart=highcharts.getChart(options)}),$timeout(function(){$scope.chart||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.hello").directive("sviHelloEventListener",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","eventDispatcher","symbol",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,eventDispatcher,symbol){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("helloEventListener/helloEventListener.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="helloEventListener",this.friendlyName="Hello Event Listener";try{svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"sviHelloEventListener: "+e}$scope.quote=null,labels.setupLabels($scope,["general","helloWorld"]);this.isReadyToLoad=function(){return null!==$scope.symbol&&""!==$scope.sybmol},loader.attach($scope,$element,function(invalidateCache){return symbol.getQuote($scope.symbol,!0,null,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.quote=data.symbolQuote.instrumentQuotes[0].quote}catch(e){$scope.quote=null}}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!=data.symbol&&($scope.symbol=data.symbol)},null,$element),$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.hello").directive("sviHelloGridContainer",["APP_CONFIG","$templateCache","$timeout","labels","loader","grid","piwik","accountList","holdings",function(APP_CONFIG,$templateCache,$timeout,labels,loader,grid,piwik,accountList,holdings){return{replace:!1,scope:{account:"@",columns:"@",columnPriority:"@",responsiveColumns:"@",pageSize:"@",showPaging:"@",sortable:"@"},template:$templateCache.get("helloGridContainer/helloGridContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="helloGridContainer",this.friendlyName="Hello Grid Container",this.eventName="HELLO_GRID";try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["symbol","desc","qty","lastPrice","change","pctChange","marketValueChange","marketValue","actionMenu"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["symbol","lastPrice","change","qty","desc","pctChange","marketValueChange","marketValue","actionMenu"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultInt($scope,$attrs,"pageSize",0),svi.ng.defaultTrue($scope,$attrs,"showPaging"),svi.ng.defaultTrue($scope,$attrs,"sortable")}catch(e){throw"sviHelloGridContainer: "+e}$scope.holdings=null,grid.attachContainer($scope,$element,$attrs,"instrument.symbol"),labels.setupLabels($scope,["general","helloWorld"]),$scope.getLoadParameters=function(){var options={sortField:$scope.sortField,sortDir:$scope.sortDir,columns:JSON.stringify($scope.columns)};return $scope.pageSize&&(options.pageSize=$scope.pageSize,options.pageNum=$scope.currentPage,options.pageCacheID=$scope.pageCacheID),options};loader.attach($scope,$element,function(invalidateCache){return holdings.getHoldings($scope.account,$scope.getLoadParameters(),invalidateCache)},function(data){piwik.trackDataLoad($scope,data),$scope.holdings=data.holdings,$scope.currentPage=$scope.holdings.pageNum,$scope.totalPages=$scope.holdings.pageCount,$scope.pageCacheID=$scope.holdings.pageCacheID,$scope.holdings.positions.length?$timeout(function(){svi.ui.pulse(".hello-grid, .hello-grid tr")}):$scope.loader.setMessage($scope.labels.noHoldingsData)}),$timeout(function(){$scope.initComplete=!0,$scope.holdings||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.hello").directive("sviHelloGridGrid",["APP_CONFIG","$templateRequest","$compile","labels","grid",function(APP_CONFIG,$templateRequest,$compile,labels,grid){return{replace:!1,scope:{columns:"=",columnPriority:"=",responsiveColumns:"@",holdings:"=",sortField:"=?",sortDir:"=?",sortable:"="},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="helloGridGrid",this.friendlyName="Hello Grid Grid",this.eventName="HELLO_GRID";try{svi.ng.defaultTrue($scope,$attrs,"responsiveColumns")}catch(e){throw"sviHelloGridGrid: "+e}$scope.id=php.uniqid(this.name),grid.attachGrid($scope,$element),labels.setupLabels($scope,["general","helloWorld","holdings"])}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("hello/helloGridGrid/helloGridGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("svi.hello").directive("sviHelloModal",["APP_CONFIG","$templateCache","$timeout","labels","loader","modal",function(APP_CONFIG,$templateCache,$timeout,labels,loader,modal){return{replace:!1,scope:{},template:$templateCache.get("helloModal/helloModal.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="helloModal",this.friendlyName="Hello Modal",$scope.data=null;modal.attach($scope,$element,function(active,data){active&&($scope.data||$scope.api.load())}),labels.setupLabels($scope,["general","helloWorld"]).then(function(){var modalCtrl=$scope.api.getModalCtrl();modalCtrl&&modalCtrl.setTitle($scope.labels.helloWorldTitle)});loader.attach($scope,$element,function(invalidateCache){return loader.getDummyData(invalidateCache)})}]}}]),angular.module("svi.hello").directive("sviHelloMultiTemplate",["APP_CONFIG","$templateCache","$compile","$timeout","labels","loader",function(APP_CONFIG,$templateCache,$compile,$timeout,labels,loader){return{replace:!1,scope:{template:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="helloMultiTemplate",this.friendlyName="Hello Multi Template";try{svi.ng.defaultValidString($scope,$attrs,"template",["default","alternate"],"default")}catch(e){throw"sviHelloMultiTemplate: "+e}$scope.data=null,labels.setupLabels($scope,["general","helloWorld"]);loader.attach($scope,$element,function(invalidateCache){return loader.getDummyData(invalidateCache)}),$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}],link:function($scope,$element,$attrs){var template=$templateCache.get("helloMultiTemplate/"+$scope.template+".tpl.html"),sharedTmpl=$templateCache.get("helloMultiTemplate/shared.tpl.html");template=template.replace("%SHARED_TPL%",sharedTmpl),$element.html(template).show(),$compile($element.contents())($scope)}}}]),angular.module("svi.hello").directive("sviHelloWidget",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","preferences","piwik",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,preferences,piwik){return{replace:!1,scope:{moreUrl:"@"},template:$templateCache.get("helloWidget/helloWidget.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="helloWidget",this.friendlyName="Hello Widget";try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl",""),$scope.id=php.uniqid(this.name),$scope.comm={},$scope.preference={},$scope.options={timespan:[{value:"Today",label:"Today"},{value:"OneWeek",label:"One Week"},{value:"OneMonth",label:"One Month"}]},labels.setupLabels($scope,["general","helloWorld"]);loader.attach($scope,$element,function(invalidateCache){return preferences.get(["helloWorld","widget"],invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.preference=JSON.parse(data.resource),angular.isObject($scope.preference)||($scope.preference={})}catch(e){$scope.preference={}}}),widget.attach($scope,$element),this.savePreferences=function(){var loader=$scope.api.getLoader();if(loader){if(loader.showSpinner)return;$scope.comm.helloWidgetSettings.$valid&&""!=$scope.preference.symbol?loader.setLoadHandler(function(){return preferences.set(["helloWorld","widget"],JSON.stringify($scope.preference))}).load().then($scope.api.hideSettings,function(error){loader.setError(error.message)}):loader.setError($scope.labels.invalidInput)}else $timeout($scope.api.load,APP_CONFIG.autoLoadDelay)},$timeout(function(){$scope.preferences||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.hello").directive("sviHelloWorld",["APP_CONFIG","$templateCache","$timeout","labels","loader",function(APP_CONFIG,$templateCache,$timeout,labels,loader){return{replace:!1,scope:{dummyString:"@",dummyInt:"@",dummyBoolean:"@",dummyValidatedString:"@"},template:$templateCache.get("helloWorld/helloWorld.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="helloWorld",this.friendlyName="Hello World";try{svi.ng.defaultString($scope,$attrs,"dummyString",""),svi.ng.defaultInt($scope,$attrs,"dummyInt",0),svi.ng.defaultFalse($scope,$attrs,"dummyBoolean"),svi.ng.defaultValidString($scope,$attrs,"dummyValidatedString",["A","B","C"],"A")}catch(e){throw"sviHelloWorld: "+e}$scope.data=null,labels.setupLabels($scope,["general","helloWorld"]);loader.attach($scope,$element,function(invalidateCache){return loader.getDummyData(invalidateCache)}),$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("directives").directive("sviHistoricalValueContainer",["$templateCache","$timeout","$log","historicalValue","accountList","eventDispatcher","labels","piwik",function($templateCache,$timeout,$log,historicalValue,accountList,eventDispatcher,labels,piwik){return{replace:!1,scope:{account:"@",columns:"@",columnPriority:"@",responsiveColumns:"@"},template:$templateCache.get("historicalValueContainer/historicalValueContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["date","valueAsOfDate","changeFromPriorPeriod","pctChangeFromPriorPeriod","mtdNetChange","ytdNetChange"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["date","valueAsOfDate","changeFromPriorPeriod","pctChangeFromPriorPeriod","mtdNetChange","ytdNetChange"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns")}catch(e){throw"sviHistoricalValueContainer: "+e}labels.setupLabels($scope,["historicalValue"],{}),$scope.initComplete=!1,$scope.historicalValue=!1;try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.warn("sviHistoricalValueContainer: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviHistoricalValueContainer: Error parsing columnPriority: ",e,$attrs.columnPriority)}$scope.setLoader=function(loader){$scope.loader=loader}}],link:function($scope,$element,$attrs){var load=function(){if($scope.initComplete)return $scope.loader?void $scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout(load,200)},loadCallback=function(invalidateCache){return $("html,body").animate({scrollTop:0},0),historicalValue.getHistoricalValue($scope.account,invalidateCache)},onSuccess=function(response){piwik.trackPage("historicalValueContainer","Historical Value Container",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}]),$scope.historicalValue=response.historicalValue,response.historicalValue.historicalValueItems.length?$timeout(function(){svi.ui.pulse(".historical-value-grid, .historical-value-grid tr")}):$scope.loader.setMessage($scope.labels.noHistoricalValueData)},onError=function(reason){piwik.trackPage("historicalValueContainer/error","Error: Historical Value Container",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}])};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.historicalValue=!1,load())},!0),eventDispatcher.on("HISTORICALVALUE.REFRESH",function(){load()}),$timeout(function(){$scope.initComplete=!0,$scope.historicalValue||load()},100)}}}]),angular.module("directives").directive("sviHistoricalValueGrid",["$templateRequest","$compile","labels","config","$sce","bsBreakpoint",function($templateRequest,$compile,labels,config,$sce,bsBreakpoint){return{replace:!1,scope:{title:"@",columns:"=",columnPriority:"=",responsiveColumns:"@",historicalValue:"="},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns")}catch(e){throw"sviHistoricalValueGrid: "+e}$scope.id=php.uniqid("HISTORICALVALUEGRID"),labels.setupLabels($scope,["historicalValue"],{}),$scope.monthDisplayLength=function(){return bsBreakpoint.getBreakpoint()>bsBreakpoint.XS?10:3},$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority}}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("history/historicalValueGrid/historicalValueGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviHistoryContainer",["$templateCache","$log","$timeout","$filter","history","accountList","eventDispatcher","state","labels","tags","piwik",function($templateCache,$log,$timeout,$filter,history,accountList,eventDispatcher,state,labels,tags,piwik){var dateFilter=$filter("date"),normalizeDate=function(dateString){if(!dateString)return"";var date;if(angular.isDate(dateString)||angular.isNumber(dateString))date=dateString;else{if(!angular.isString(dateString))return"";if(!1===(date=php.strtotime(dateString.replace(/-/g,"/"))))return"";date*=1e3}return dateFilter(date,"yyyy-MM-dd")};return{replace:!1,scope:{account:"@",columns:"@",columnPriority:"@",responsiveColumns:"@",pageSize:"@",startDate:"@",endDate:"@",grouped:"@"},template:$templateCache.get("historyContainer/historyContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["tradeDate","transactionTypeDesc","desc","symbol","quantity","price","fee","amount","settlementDate","accountType","actionMenu"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["tradeDate","transactionTypeDesc","quantity","desc","accountType","price","transactionType","symbol","fee","amount","settlementDate","tags","actionMenu","expander"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultFalse($scope,$attrs,"grouped"),svi.ng.defaultInt($scope,$attrs,"pageSize",0)}catch(e){throw"sviHistoryContainer: "+e}var startDate=$attrs.startDate;startDate||(startDate=state.get("history-dateRangeFrom")),$scope.startDate=$attrs.startDate=startDate?normalizeDate(startDate):"";var transactionType,endDate=$attrs.endDate;endDate||(endDate=state.get("history-dateRangeTo")),$scope.endDate=$attrs.endDate=endDate?normalizeDate(endDate):"",$scope.sortDir=state.get("history-sortDir","desc"),$scope.sortField=state.get("history-sortField","transaction.tradeDate"),$scope.currentPage=0,$scope.pageSize&&($scope.currentPage=1),$scope.totalPages=0,$scope.pageCacheID="",$scope.refocus=null,labels.setupLabels($scope,["historyContainer"],{}),$scope.initComplete=!1,$scope.history=!1;try{(transactionType=state.get("history-transactionType"))||(transactionType=[])}catch(e){transactionType=[]}$scope.filters={transactionType:transactionType,symbol:state.get("history-symbol"),showCategory:state.get("history-showCategory"),showSweeps:state.get("history-showSweeps")};try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.error("sviHistoryContainer: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviHistoryContainer: Error parsing columnPriority: ",e,$attrs.columnPriority)}$scope.$watch("sortField",function(val){state.set("history-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("history-sortDir",val).save()}),$scope.$watch("filters.transactionType",function(val){state.set("history-transactionType",val).save()}),$scope.$watch("filters.symbol",function(val){state.set("history-symbol",val).save()}),$scope.$watch("filters.showCategory",function(val){state.set("history-showCategory",val).save()}),$scope.$watch("filters.showSweeps",function(val){state.set("history-showSweeps",val).save()}),$scope.getLoadParameters=function(){var index,data={sortField:$scope.sortField,sortDir:$scope.sortDir,grouped:$scope.grouped?"true":"false",startDate:$scope.startDate||"",endDate:$scope.endDate||""};$scope.pageSize&&(data.pageSize=$scope.pageSize,data.pageNum=$scope.currentPage,data.pageCacheID=$scope.pageCacheID),data.filterField=[],data.filterValue=[];var tt=$scope.filters.transactionType.length;if(tt){index=data.filterField.length,data.filterField[index]="transaction.transactionType",data.filterValue[index]=[];for(var i=0;i<tt;i++)data.filterValue[index]=php.array_merge(data.filterValue[0],$scope.filters.transactionType[i].value)}return $scope.filters.symbol&&(data.filterField.push("symbol"),data.filterValue.push($scope.filters.symbol.split(/\s*,\s*/))),$scope.filters.showCategory&&(data.showCategory=$scope.filters.showCategory),$scope.filters.showSweeps&&(data.showSweeps=$scope.filters.showSweeps),data},$scope.setLoader=function(loader){$scope.loader=loader}}],link:function($scope,$element,$attrs){var load=function(){if($scope.initComplete)return $scope.loader?void $scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout(load,200)},loadCallback=function(){$("html,body").animate({scrollTop:0},0);var data=$scope.getLoadParameters();return $scope.isMultiAccount=angular.isArray($scope.account)&&1<$scope.account.length,history.getHistory($scope.account,data)},onSuccess=function(response){piwik.trackPage("historyContainer","History Container",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}]),$scope.history=response.history,$scope.currentPage=$scope.history.pageNum,$scope.totalPages=$scope.history.pageCount,$scope.pageCacheID=$scope.history.pageCacheID,$scope.history.requestQuery&&$scope.history.requestQuery.startDate&&$scope.history.requestQuery.endDate&&($scope.startDate=normalizeDate($scope.history.requestQuery.startDate),$scope.endDate=normalizeDate($scope.history.requestQuery.endDate),eventDispatcher.trigger("HISTORY.DATE_RANGE.FILTER.CHANGED",{from:$scope.startDate,to:$scope.endDate})),$scope.history.warnings&&$scope.history.warnings.length?$scope.history.warnings.forEach(function(warning){$scope.loader.setWarning(warning.warningMessage)}):$scope.history.historyItems.length?(-1!=$scope.columns.indexOf("tags")&&$scope.history.symbolList&&tags.getBySymbol($scope.history.symbolList).success(function(response){if(response.success){tags.ignoreUpdates(!0);var symbol="";for(i=0,l=$scope.history.historyItems.length;i<l;i++)try{symbol=$scope.history.historyItems[i].transaction.security.symbol,$scope.history.historyItems[i].tags=response.tags[symbol]}catch(e){$scope.history.historyItems[i].tags=[]}$timeout(function(){tags.ignoreUpdates(!1)})}}),$timeout(function(){void 0!==svi.marketHoverOver&&$element.get()&&svi.marketHoverOver.attachTooltips($element.get()[0]),svi.ui.pulse(".history-grid, .history-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)})):$scope.loader.setMessage($scope.labels.noHistoryData)},onError=function(reason){angular.isObject(console)&&console.error(reason),piwik.trackPage("historyContainer/error","Error: History Container",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}])};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.history=!1,$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("HISTORY.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.refocus='.svi-column-header[data-event="HISTORY.'+data.field+'"]',load())},!0),eventDispatcher.on("HISTORY.PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.currentPage=data,load())},!0),eventDispatcher.on("HISTORY.SHOW_CATEGORY.FILTER.CHANGED",function(e,data){$scope.filters.showCategory=data.value,$scope.pageSize&&($scope.currentPage=1),load()},!0),eventDispatcher.on("HISTORY.SHOW_SWEEPS.FILTER.CHANGED",function(e,data){$scope.filters.showSweeps=data,$scope.pageSize&&($scope.currentPage=1),load()},!0),eventDispatcher.on("HISTORY.TRANSACTION_TYPE.FILTER.CHANGED",function(e,data){if(!data||0===data.length)return 0===$scope.filters.transactionType.length?void 0:($scope.filters.transactionType=[],load());if($scope.filters.transactionType!==data){if($scope.filters.transactionType.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.filters.transactionType[i].value!==data[i].value){same=!1;break}if(same)return}$scope.filters.transactionType=data,$scope.pageSize&&($scope.currentPage=1),load()}},!0),eventDispatcher.on("HISTORY.SYMBOL.FILTER.CHANGED",function(e,data){$scope.filters.symbol!=data&&($scope.filters.symbol=data,$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("HISTORY.DATE_RANGE.FILTER.CHANGED",function(e,data){if(data.hasOwnProperty("from")&&data.hasOwnProperty("to")){var from=normalizeDate(data.from),to=normalizeDate(data.to);$scope.startDate==from&&$scope.endDate==to||($scope.startDate=from,$scope.endDate=to,$scope.pageSize&&($scope.currentPage=1),data.hasOwnProperty("fromQuickDateRange")&&data.fromQuickDateRange||eventDispatcher.trigger("HISTORY.QUICK_DATE_RANGE.FILTER.CHANGED",{value:"custom"}),load())}},!0),eventDispatcher.on("HISTORY.QUICK_DATE_RANGE.FILTER.CHANGED",function(e,data){data.hasOwnProperty("value")&&angular.isObject(data.value)&&data.value.hasOwnProperty("from")&&data.value.hasOwnProperty("to")&&(data.value.fromQuickDateRange=!0,eventDispatcher.trigger("HISTORY.DATE_RANGE.FILTER.CHANGED",data.value))},!0),eventDispatcher.on("HISTORY.EXPORT",function(){var data=$scope.getLoadParameters();data.columns=JSON.stringify($scope.columns),history.exportHistory($scope.account,data)}),$timeout(function(){$scope.initComplete=!0,$scope.history||load()},400)}}}]),angular.module("directives").directive("sviHistoryGrid",["$templateRequest","$compile","APP_CONFIG","$filter","labels","expander","floatThead",function($templateRequest,$compile,APP_CONFIG,$filter,labels,expander,floatThead){return{replace:!1,scope:{title:"@",columns:"=",columnPriority:"=",responsiveColumns:"@",history:"=",sortField:"=?",sortDir:"=?",isMultiAccount:"=?",grouped:"=?"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns")}catch(e){throw"sviHistoryGrid: "+e}$scope.id=php.uniqid("HISTORYGRID"),labels.setupLabels($scope,["general","assetTypes","history"],{}),floatThead.init($scope,$element),expander.init($scope,$scope.id,$element),$scope.$watch("history",function(){expander.reset($scope)}),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{actionMenu:!1,expander:!1}},APP_CONFIG.accountClasses&&($scope.accountClasses=APP_CONFIG.accountClasses)}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("history/historyGrid/historyGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviHoldingMarketValue",["$templateCache","eventDispatcher","APP_CONFIG","$timeout","accountList","labels","holdings","symbol","piwik",function($templateCache,eventDispatcher,APP_CONFIG,$timeout,accountList,labels,holdings,symbol,piwik){return{replace:!1,scope:{useParentData:"@",accounts:"=?",symbol:"@",eventName:"@",showGainloss:"@",enableTrading:"@",delayedQuote:"@"},template:$templateCache.get("holdingMarketValue/holdingMarketValue.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$attrs.hasOwnProperty("accounts")||($scope.accounts=$attrs.accounts=[accountList.getCurrentAccountIndex()]),$scope._symbol=svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultFalse($scope,$attrs,"enableTrading"),svi.ng.defaultTrue($scope,$attrs,"showGainloss"),svi.ng.defaultBoolean($scope,$attrs,"delayedQuote",!APP_CONFIG.rtqEnabled),svi.ng.defaultFalse($scope,$attrs,"useParentData"),$scope.currentAccount="",$scope.reset=function(){$scope.loaded=!1,$scope.positions=null,$scope.quote=null,$scope.instrument=null,$scope.qty=0,$scope.gainLoss=0,$scope.marketValue=0,$scope.marketValueChange=0},$scope.reset(),APP_CONFIG.accountClasses&&($scope.accountClasses=APP_CONFIG.accountClasses),labels.setupLabels($scope,["general","holdingMarketValue"],{qty:"Quantity",marketValue:"Market Value",dayChange:"Day Change",gainLoss:"Unrealized Gain",btnBuy:"Buy More",btnSell:"Sell"}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.symbol=$scope._symbol?$scope._symbol:$scope.$parent.symbol,""!==$scope.symbol&&null!==$scope.symbol&&!1!==$scope.symbol&&($scope.reset(),$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError))},$scope.loadQuote=function(){""!==$scope.symbol&&null!==$scope.symbol&&!1!==$scope.symbol&&$scope.loader.setLoadHandler(loadQuoteCallback).load().then(onQuoteSuccess,onQuoteError)};var loadCallback=function(){if(!0===$scope.useParentData||"true"===$scope.useParentData)return $scope.$parent.loadCallback();var query={filterField:["instrument.symbol"],filterValue:[[$scope.symbol]]};return"Option"==$scope.$parent.investmentType&&(query={}),holdings.getHoldings($scope.accounts[0],query)},loadQuoteCallback=function(){return symbol.getQuote($scope.symbol,$scope.delayedQuote)},onSuccess=function(response){if($scope.currentAccount=response.currentAccount,piwik.trackPage("holdingMarketValue","Holding Market Value",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.loadQuote(),$scope.positions=holdings.filterBySymbol($scope.symbol,response.holdings.positions),0===$scope.positions.length)$scope.loader.setWarning($scope.labels.noDataSymbol),$scope.loaded=!1;else{$scope.quote=$scope.positions[0].quote;for(var i=0;i<$scope.positions.length;i++)$scope.qty=$scope.qty+$scope.positions[i].qty,$scope.gainLoss=$scope.gainLoss+$scope.positions[i].gainLoss,$scope.marketValue=$scope.marketValue+$scope.positions[i].marketValue,$scope.marketValueChange=$scope.marketValueChange+$scope.positions[i].marketValueChange}},onQuoteSuccess=function(data){var response;if(data&&data.hasOwnProperty("data")&&data.data.hasOwnProperty("data"))response=data.data.data;else if(data&&data.hasOwnProperty("data"))response=data.data;else{if(!data)return!1;response=data}if(response.symbolQuote.instrumentQuotes.length){if($scope.quote=response.symbolQuote.instrumentQuotes[0].quote,$scope.instrument=response.symbolQuote.instrumentQuotes[0].instrument,response.symbolQuote.instrumentQuotes[0].hasOwnProperty("menuItems")&&angular.isArray(response.symbolQuote.instrumentQuotes[0].menuItems)){var menuItems=response.symbolQuote.instrumentQuotes[0].menuItems.filter(function(item){return!item.event||"QUOTE.ACTION.ZOOM"!==item.event.name});if($scope.actionMenuItems=[],angular.isDefined(menuItems[0])&&"dropdown"===menuItems[0].type){var priority=0;menuItems[0].items.forEach(function(item){priority=item.priority>=priority?item.priority:priority,$scope.actionMenuItems.push(item)}),$scope.actionMenuItems.push({class:"divider",type:"url",url:!1,priority:priority+1}),menuItems.forEach(function(item,index){0!==index&&$scope.actionMenuItems.push(item)})}else menuItems.forEach(function(item){$scope.actionMenuItems.push(item)})}$scope.loader.setWarning(!1),$scope.loaded=!0}return data},onQuoteError=function(data){},onError=function(response){piwik.trackPage("holdingMarketValue/error","Error: Holding Market Value",!1,[{name:"numAccounts",index:1,value:1}])};$scope.$watch("accounts",function(newVal,oldVal){null!==newVal&&newVal!=oldVal&&0<$scope.accounts.length&&($scope.loaded=!1,$scope.load())},!0),$scope.$watch("_symbol",function(newVal,oldVal){null!==newVal&&newVal!=oldVal&&($scope.loaded=!1,$scope.load())}),$timeout(function(){$scope._symbol=$attrs.symbol,$scope.load()},300),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data.currentAccount&&$scope.accounts!=data.currentAccount&&($scope.accounts=data.currentAccount)}),eventDispatcher.on($scope.eventName,function(e,data){data.symbol&&$scope._symbol!=data.symbol&&($scope._symbol=data.symbol)})}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviHoldingsContainer",["$templateCache","$compile","$log","$timeout","holdings","accountList","eventDispatcher","state","labels","actionMenu","tags","config","sviUrl","piwik",function($templateCache,$compile,$log,$timeout,holdings,accountList,eventDispatcher,state,labels,actionMenu,tags,config,sviUrl,piwik){return{replace:!1,scope:{template:"@",account:"@",assetView:"@",columns:"@",multiColumns:"@",totalsConfig:"@",columnPriority:"@",responsiveColumns:"@",pageSize:"@",showPaging:"@",showTotalSecurities:"@",showTotalMarketValue:"@",showTotalMarketValueChange:"@",sortable:"@",holdingsLabelSet:"@",assetClassificationEnabled:"@",multiAccountGainLoss:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultFalse($scope,$attrs,"assetView"),svi.ng.defaultString($scope,$attrs,"columns",'["symbol","desc","shortName","investmentType","assetClassification","accountType","qty","lastPrice","change","pctChange","marketValueChange","marketValue","costBasis","unitCost","gainLoss","pctOfAssets","estDividend","currentYield","actionMenu"]'),svi.ng.defaultString($scope,$attrs,"multiColumns",'["symbol","desc","shortName","investmentType","assetClassification","accountType","qty","lastPrice","change","pctChange","marketValueChange","marketValue","costBasis","unitCost","gainLoss","pctOfAssets","estDividend","currentYield","actionMenu"]'),svi.ng.defaultString($scope,$attrs,"totalsConfig",JSON.stringify({pctChange:!0,marketValueChange:!0,marketValue:!0,gainLoss:!0,change:!0,pctOfAssets:!0,costBasis:!0,currentYield:!0,estDividend:!0})),svi.ng.defaultString($scope,$attrs,"columnPriority",'["symbol","lastPrice","change","estDividend","shortName","qty","desc","pctChange","marketValueChange","marketValue","costBasis","gainLoss","unitCost","purchasePrice","pctOfAssets","currentYield","tags","investmentType","accountType","actionMenu","expander"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultFalse($scope,$attrs,"assetClassificationEnabled"),svi.ng.defaultFalse($scope,$attrs,"multiAccountGainLoss"),$scope.assetView?$scope.pageSize=$attrs.pageSize=0:svi.ng.defaultInt($scope,$attrs,"pageSize",0),config.getHeldAway().then(function(response){200==response.status&&response.data.success&&($scope.heldAwayConfig=response.data.heldAwayConfig)})}catch(e){throw"sviHoldingsContainer: "+e}var investmentType;$scope.sortDir=state.get("holdings-sortDir","asc"),$scope.sortField=state.get("holdings-sortField","instrument.symbol"),$scope.currentPage=0,$scope.pageSize&&($scope.currentPage=1),$scope.totalPages=0,$scope.pageCacheID="",$scope.showTotals=!0,$scope.refocus=null,labels.setupLabels($scope,["general","holdingsContainer"],{}),$scope.initComplete=!1,$scope.holdings=!1,svi.ng.defaultTrue($scope,$attrs,"showTotalSecurities"),svi.ng.defaultTrue($scope,$attrs,"showTotalMarketValue"),svi.ng.defaultFalse($scope,$attrs,"showTotalMarketValueChange"),svi.ng.defaultTrue($scope,$attrs,"showPaging"),svi.ng.defaultTrue($scope,$attrs,"sortable"),svi.ng.defaultString($scope,$attrs,"holdingsLabelSet","holdings");try{(investmentType=state.get("holdings-investmentType"))||(investmentType=[])}catch(e){investmentType=[]}$scope.filters={investmentType:investmentType},$scope.includeHeldAway=state.get("holdings-includeHeldAway");try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.error("sviHoldingsContainer: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}try{svi.ng.parseJSON($scope,$attrs,"multiColumns")}catch(e){$log.error("sviHoldingsContainer: Error parsing multiColumns: ",e,$attrs.multiColumns),$scope.multiColumns=$attrs.multiColumns=[]}try{svi.ng.parseJSON($scope,$attrs,"totalsConfig")}catch(e){$log.error("sviHoldingsContainer: Error parsing totalsConfig: ",e,$attrs.totalsConfig),$scope.totalsConfig=$attrs.totalsConfig={}}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviHoldingsContainer: Error parsing columnPriority: ",e,$attrs.columnPriority),$scope.columnPriority=$attrs.columnPriority=[]}$scope.$watch("sortField",function(val){state.set("holdings-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("holdings-sortDir",val).save()}),$scope.$watch("filters.investmentType",function(val){state.set("holdings-investmentType",val).save()}),$scope.$watch("includeHeldAway",function(val){state.set("holdings-includeHeldAway",val).save()}),$scope.getLoadParameters=function(){var data={byAssetType:$scope.assetView?"Y":"N",sortField:$scope.sortField,sortDir:$scope.sortDir,columns:JSON.stringify($scope.isMultiAccount&&$scope.multiColumns?$scope.multiColumns:$scope.columns)};$scope.pageSize&&(data.pageSize=$scope.pageSize,data.pageNum=$scope.currentPage,data.pageCacheID=$scope.pageCacheID);var it=$scope.filters.investmentType.length;it&&($scope.assetClassificationEnabled?data.filterField=["instrument.assetClassification"]:data.filterField=["instrument.investmentType"],data.filterValue=[[]]);for(var i=0;i<it;i++)angular.isArray($scope.filters.investmentType[i].value)?data.filterValue[0]=php.array_merge(data.filterValue[0],$scope.filters.investmentType[i].value):data.filterValue[0].push($scope.filters.investmentType[i].value);return $scope.includeHeldAway&&(data.includeHeldAway=$scope.includeHeldAway),data};var getWidgetCtrl=svi.ng.getControllerFactory($element,$scope,"svi-widget");$scope.setLoader=function(loader){if($scope.loader=loader,"Widget"==$scope.template){var widget=getWidgetCtrl();widget&&widget.setLoader(loader)}},this.more=function(){sviUrl.href(["accountHoldings",{action:"default"}])},$scope.api=this}],link:function($scope,$element,$attrs){$element.html($templateCache.get("holdingsContainer/holdingsContainer"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope);var load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout(load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}},loadCallback=function(invalidateCache){"Widget"!=$scope.template&&$("html,body").animate({scrollTop:0},0),$scope.isMultiAccount=angular.isArray($scope.account)&&1<$scope.account.length;var data=$scope.getLoadParameters($scope.isMultiAccount);return holdings.getHoldings($scope.account,data,invalidateCache)},populateTags=function(positions){if(angular.isArray(positions))for(var symbol="",i=0,l=positions.length;i<l;i++)try{symbol=positions[i].instrument.symbol,positions[i].tags=response.tags[symbol]}catch(e){positions[i].tags=[]}},onSuccess=function(response){piwik.trackPage("holdingsContainer","Holdings",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}]),$scope.holdings=response.holdings,$scope.currentPage=$scope.holdings.pageNum,$scope.totalPages=$scope.holdings.pageCount,$scope.pageCacheID=$scope.holdings.pageCacheID,$scope.holdings.warnings&&$scope.holdings.warnings.length?$scope.holdings.warnings.forEach(function(warning){$scope.loader.setWarning(warning.warningMessage)}):$scope.assetView||$scope.holdings.positions.length?$scope.assetView&&angular.isArray($scope.holdings.positions)?$scope.loader.setMessage($scope.labels.noHoldingsData):($scope.showTotals=$scope.showPaging||$scope.holdings.totalRecords<=$scope.holdings.pageSize,-1!==$scope.columns.indexOf("tags")&&angular.isArray($scope.holdings.symbolList)&&0<$scope.holdings.symbolList.length&&tags.getBySymbol($scope.holdings.symbolList).success(function(response){if(response.success){if(tags.ignoreUpdates(!0),$scope.assetView)for(var x in $scope.holdings.positions)$scope.holdings.positions.hasOwnProperty(x)&&populateTags($scope.holdings.positions[x]);else populateTags($scope.holdings.positions);$timeout(function(){tags.ignoreUpdates(!1)})}}),$timeout(function(){void 0!==svi.marketHoverOver&&$element.get()&&svi.marketHoverOver.attachTooltips($element.get()[0]),svi.ui.pulse(".holdings-grid, .holdings-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)})):$scope.loader.setMessage($scope.labels.noHoldingsData)},onError=function(reason){piwik.trackPage("holdingsContainer/error","Error: Holdings",null,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}])};eventDispatcher.on("HOLDINGS.ACTION.ZOOM",function(e,data){actionMenu.startHoldingZoom(data)},!1),eventDispatcher.on("HOLDINGS.ACTION.TRADE",function(e,data){actionMenu.startTradeWidget(data)},!1),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){angular.toJson($scope.account)!==angular.toJson(data.currentAccount)&&($scope.account=data.currentAccount,$scope.holdings=!1,$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("HOLDINGS.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.refocus='.svi-column-header[data-event="HOLDINGS.'+data.field+'"]',load())},!0),eventDispatcher.on("HOLDINGS.PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.currentPage=data,load())},!0),eventDispatcher.on("HOLDINGS.INVESTMENT_TYPE.FILTER.CHANGED",function(e,data){if(!data||0===data.length)return 0===$scope.filters.investmentType.length?void 0:($scope.filters.investmentType=[],load());if($scope.filters.investmentType!==data){if($scope.filters.investmentType.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.filters.investmentType[i].value!==data[i].value){same=!1;break}if(same)return}$scope.filters.investmentType=data,$scope.pageSize&&($scope.currentPage=1),load()}},!0),eventDispatcher.on("HOLDINGS.INCLUDE_HELDAWAY.FILTER.CHANGED",function(e,data){$scope.includeHeldAway!=data.value&&($scope.includeHeldAway=data.value,$scope.pageSize&&($scope.currentPage=1),load())},!0),eventDispatcher.on("HOLDINGS.REFRESH",function(){load(!0)}),eventDispatcher.on("HOLDINGS.EXPORT",function(){var data=$scope.getLoadParameters();holdings.exportHoldings($scope.account,data)}),$timeout(function(){$scope.initComplete=!0,$scope.holdings||load()},100)}}}]),angular.module("directives").directive("sviHoldingsGrid",["APP_CONFIG","$templateRequest","$compile","$filter","labels","expander","floatThead","actionMenu",function(APP_CONFIG,$templateRequest,$compile,$filter,labels,expander,floatThead,actionMenu){return{replace:!1,scope:{template:"@",title:"@",assetType:"@",columns:"=",multiColumns:"=",totalsConfig:"=",columnPriority:"=",responsiveColumns:"@",holdings:"=",sortField:"=?",sortDir:"=?",sortable:"=",showTotals:"=?",includeHeldAway:"=?",holdingsLabelSet:"=?",isMultiAccount:"=?",multiAccountGainLoss:"@",classificationTypeColors:"@",assetClassificationEnabled:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{if(svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"assetType",""),svi.ng.defaultString($scope,$attrs,"holdingsLabelSet","holdings"),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultFalse($scope,$attrs,"multiAccountGainLoss"),$scope.assetType)if($scope.assetClassificationEnabled&&$scope.classificationTypeColors){for($categories=JSON.parse($scope.classificationTypeColors),$i=0;$i<$categories.length;$i++)if($categories[$i].name==$scope.assetType){$scope.assetTypeColor=$categories[$i].color;break}}else{var index=$scope.columns.indexOf("investmentType");-1!=index&&$scope.columns.splice(index,1),$scope.assetTypeColor=$filter("assetTypeColor")($scope.assetType)}}catch(e){throw"sviHoldingsGrid: "+e}$scope.id=php.uniqid("HOLDINGSGRID"),APP_CONFIG.accountClasses&&($scope.accountClasses=APP_CONFIG.accountClasses),labels.setupLabels($scope,["general","assetTypes",$scope.holdingsLabelSet],{}),$scope.displayColumns=function(){return $scope.isMultiAccount&&$scope.multiColumns&&0<$scope.multiColumns.length?$scope.multiColumns:$scope.columns},$scope.totalsCalculated=!1;var totalWatch=!($scope.calculateTotals=function(){if($scope.totals={},$scope.totals.marketValueChange=0,$scope.totals.marketValue=0,$scope.totals.gainLoss=0,$scope.totals.costBasis=0,$scope.totals.pctGainLoss=0,$scope.totals.pctChange=0,$scope.totals.change=0,$scope.totals.pctOfAssets=0,$scope.totals.estDividend=0,$scope.totals.currentYield=0,$scope.holdings){for(var i=0,l=$scope.holdings.length;i<l;i++){if(angular.isNumber($scope.holdings[i].marketValueChange)&&($scope.totals.marketValueChange+=$scope.holdings[i].marketValueChange),angular.isNumber($scope.holdings[i].marketValue)&&($scope.totals.marketValue+=$scope.holdings[i].marketValue),$scope.holdings[i].gainLossLot)for(var j=0,gl=$scope.holdings[i].gainLossLot.length;j<gl;j++)angular.isNumber($scope.holdings[i].gainLossLot[j].gainLoss)&&($scope.totals.gainLoss+=$scope.holdings[i].gainLossLot[j].gainLoss);else angular.isNumber($scope.holdings[i].gainLoss)&&($scope.totals.gainLoss+=$scope.holdings[i].gainLoss);angular.isNumber($scope.holdings[i].costBasis)&&($scope.totals.costBasis+=$scope.holdings[i].costBasis),angular.isNumber($scope.holdings[i].quote.change)&&($scope.totals.change+=$scope.holdings[i].quote.change),angular.isNumber($scope.holdings[i].pctOfAssets)&&($scope.totals.pctOfAssets+=$scope.holdings[i].pctOfAssets),angular.isNumber($scope.holdings[i].estDividend)&&($scope.totals.estDividend+=$scope.holdings[i].estDividend)}0<$scope.totals.marketValue&&($scope.totals.currentYield=100*$scope.totals.estDividend/$scope.totals.marketValue),$scope.totals.pctChange=100*$scope.totals.marketValueChange/(Math.abs($scope.totals.marketValue)-$scope.totals.marketValueChange),$scope.totals.pctGainLoss=100*$scope.totals.gainLoss/Math.abs($scope.totals.costBasis),$scope.totalsCalculated=!0}}),checkTotalsWatch=function(){if($scope.showTotals){var enabledTotals=[];for(var x in $scope.totalsConfig)$scope.totalsConfig.hasOwnProperty(x)&&$scope.totalsConfig[x]&&enabledTotals.push(x);var totalCols=php.array_values(php.array_intersect($scope.columns,enabledTotals));if(0<totalCols.length&&(1!=totalCols.length||"gainLoss"!=totalCols[0]||!$scope.isMultiAccount||$scope.multiAccountGainLoss))return $scope.calculateTotals(),void(totalWatch=$scope.$watch("holdings",$scope.calculateTotals))}totalWatch&&(totalWatch(),totalWatch=!1,$scope.totalsCalculated=!1)};$scope.$watch("showTotals",checkTotalsWatch),$scope.$watch("isMultiAccount",checkTotalsWatch),floatThead.init($scope,$element),expander.init($scope,$scope.id,$element),$scope.$watch("holdings",function(){expander.reset($scope)}),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{actionMenu:!1,expander:!1,change:"currencyChange",pctChange:"percentChange",marketValueChange:"currencyChange",gainLoss:"currencyChange"},breakpoints:{xs:3,sm:7,md:10}},$scope.startHoldingZoom=function(position){if(position&&position.hasOwnProperty("menuItems"))for(var x,i=0,l=position.menuItems.length;i<l;i++)if("event"==(x=position.menuItems[i]).type&&"HOLDINGS.ACTION.ZOOM"==x.event.name)return void actionMenu.startHoldingZoom(x.event.data)}}],link:function($scope,$element,$attrs){$scope.$watch("isMultiAccount",function(){var config;config={columns:$scope.displayColumns()},$templateRequest("holdings/holdingsGrid/holdingsGrid"+$scope.template+".tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})})}}}]),angular.module("directives").directive("sviHoldingsList",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","holdings","$window","piwik","bsBreakpoint","$compile","widget",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,holdings,$window,piwik,bsBreakpoint,$compile,widget){return{replace:!1,scope:{useParentData:"@",eventName:"@",titleEnabled:"@",excludeStock:"@",excludeOption:"@",excludeFund:"@",excludeFixedIncome:"@",excludeCash:"@",excludeCusip:"@",scrollable:"@",template:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.api=this,$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.filters={},$scope.filters.filterBy="all",svi.ng.defaultFalse($scope,$attrs,"excludeStock"),svi.ng.defaultFalse($scope,$attrs,"excludeOption"),svi.ng.defaultFalse($scope,$attrs,"excludeFund"),svi.ng.defaultFalse($scope,$attrs,"excludeFixedIncome"),svi.ng.defaultFalse($scope,$attrs,"excludeCash"),svi.ng.defaultFalse($scope,$attrs,"excludeCusip"),svi.ng.defaultTrue($scope,$attrs,"scrollable"),svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],"");svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultTrue($scope,$attrs,"titleEnabled"),svi.ng.defaultValidString($scope,$attrs,"template",["Widget",""],"");var setupFilterOptions=function(){$scope.filterOptions=[{display:$scope.labels.holdingListFilterAll,value:"all"},{display:$scope.labels.holdingListFilterGainers,value:"gainers"},{display:$scope.labels.holdingListFilterLosers,value:"losers"}]};labels.setupLabels($scope,["general","holdings","holdingsContainer","holdingsList"],{}).then(setupFilterOptions),setupFilterOptions(),angular.element($window).bind("resize",function(){0!==$element.find("td").length&&$scope.resizeTable()}),$scope.changeSymbol=function(e,data){eventDispatcher.trigger($scope.eventName,{symbol:data.instrument.symbol,underlying:data.underlying?data.underlying.symbol:data.instrument.symbol,investmentType:data.instrument.investmentType,securityType:data.instrument.securityType,subType:data.instrument.subType}),$element.find("table tbody tr").removeClass("active"),$(e.target).closest("tr").addClass("active"),e.preventDefault()};var sortBySymbol=function(a,b){return a.instrument.symbol===b.instrument.symbol?0:a.instrument.symbol>b.instrument.symbol?1:-1},sortByChangeAsc=function(a,b){return a.quote.pctChange-b.quote.pctChange},sortByChangeDesc=function(a,b){return b.quote.pctChange-a.quote.pctChange},addFilters=function(positions,filter){for(var i=0;i<positions.length;i++)positions[i].inFilter=filter(positions[i]);return positions};$scope.applyGainLossFilter=function(positions){switch($scope.filters.filterBy){case"gainers":return addFilters(php.array_values(php.usort(positions,sortByChangeDesc)),function(position){return 0<position.quote.pctChange});case"losers":return addFilters(php.array_values(php.usort(positions,sortByChangeAsc)),function(position){return position.quote.pctChange<=0});default:case"all":return addFilters(php.array_values(php.usort(positions,sortBySymbol)),function(){return!0})}},$scope.$watch("filters.filterBy",function(){$scope.positions=$scope.applyGainLossFilter($scope.positions)}),$scope.resizeTable=function(){},$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){if(!0===$scope.useParentData||"true"===$scope.useParentData)return $scope.$parent.loadCallback();return holdings.getHoldings($scope.accounts[0],{sortField:"instrument.symbol",sortDir:"asc"})},onSuccess=function(response){if(piwik.trackPage("holdingsList","Holdings List",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.holdings.positions.length){var config={excludeUnknownInvestmentType:$scope.loaded=!0,excludeInvalidQuote:!0,excludeStock:$scope.excludeStock,excludeOption:$scope.excludeOption,excludeFund:$scope.excludeFund,excludeFixedIncome:$scope.excludeFixedIncome,excludeCash:$scope.excludeCash,excludeCusip:$scope.excludeCusip};$scope.positions=$scope.applyGainLossFilter($scope.applyUniqueFilter(holdings.filterPositions(response.holdings.positions,config))),$scope.isScrollableList=25<=$scope.positions.length;var firstSymbol=$scope.positions[0];eventDispatcher.trigger($scope.eventName,{symbol:firstSymbol.instrument.symbol,underlying:firstSymbol.underlying?firstSymbol.underlying.symbol:firstSymbol.instrument.symbol,investmentType:firstSymbol.instrument.investmentType,securityType:firstSymbol.instrument.securityType,subType:firstSymbol.instrument.subType}),0===$scope.positions.length&&($scope.loader.setWarning($scope.labels.noHoldingsData),$scope.loaded=!1)}else $scope.loader.setWarning($scope.labels.noHoldingsData)},onError=function(){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("holdingsList/error","Error: Holdings List",!1,[{name:"numAccounts",index:1,value:1}])};$scope.applyUniqueFilter=function(positions){var addItem,positionData=[];return angular.forEach(positions,function(value,key){addItem=!0;for(var i=0;i<positionData.length;i++)positionData[i]&&positionData[i].instrument.symbol===value.instrument.symbol&&(addItem=!1);addItem&&positionData.push(positions[key])}),positionData},$scope.rendered=function(){$scope.resizeTable(),!1!==$element.find("table tbody tr").hasClass("active")||bsBreakpoint.isMobile()||$element.find("table tbody tr:first-child").addClass("active")},eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&($scope.loaded=!1,$scope.load())})}],link:function($scope,$element){var template=$templateCache.get("holdingsList/holdingsList"+$scope.template+".tpl.html");$element.html(template).show(),$compile($element.contents())($scope),"Widget"===$scope.template&&widget.attach($scope,$element),$timeout(function(){$scope.load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviHoldingZoom",["$templateCache","$compile","$parse","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","piwik","bsBreakpoint",function($templateCache,$compile,$parse,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,piwik,bsBreakpoint){return{replace:!1,scope:{symbol:"@",eventName:"@",underlying:"@",investmentType:"@",chartColorBegin:"@",useGradient:"@",yAxisFontColor:"@",useModal:"@",showOnlyNewsText:"@",enableTrading:"@",showOrderStatus:"@",urls:"@",useParentData:"@",showHoldingsList:"@",delayedQuote:"@",showEvent:"@",showAcctType:"@",responsiveColumns:"@",columnsSymbolUgl:"@",columnPrioritySymbolUgl:"@",columnsSymbolHoldings:"@",columnPrioritySymbolHoldings:"@",rangeButtonWidth:"@"},template:$templateCache.get("holdingZoom/holdingZoom.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),svi.ng.defaultTrue($scope,$attrs,"showAcctType"),svi.ng.defaultTrue($scope,$attrs,"showEvent"),svi.ng.defaultTrue($scope,$attrs,"showOrderStatus"),svi.ng.defaultInt($scope,$attrs,"rangeButtonWidth",null),svi.ng.defaultFalse($scope,$attrs,"showOnlyNewsText"),$scope.loaded=!1,$scope.id=php.uniqid("holdingZoom"),$scope.api=this,$scope.isMobile=bsBreakpoint.isMobile(),piwik.trackPage("holdingZoom","Holding Zoom",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]),svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultString($scope,$attrs,"underlying",""),svi.ng.defaultString($scope,$attrs,"investmentType",""),svi.ng.defaultString($scope,$attrs,"chartColorBegin",""),svi.ng.defaultTrue($scope,$attrs,"useGradient"),svi.ng.defaultFalse($scope,$attrs,"enableTrading"),svi.ng.defaultString($scope,$attrs,"yAxisFontColor","#FFFFFF"),svi.ng.defaultTrue($scope,$attrs,"showGainloss"),svi.ng.defaultBoolean($scope,$attrs,"delayedQuote",!APP_CONFIG.rtqEnabled),svi.ng.defaultFalse($scope,$attrs,"useModal"),svi.ng.defaultFalse($scope,$attrs,"showHoldingsList"),svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultString($scope,$attrs,"columnsSymbolUgl",'["symbol", "dateAcquired", "qty", "unitCost", "gainLoss", "eventDesc", "accountType"]'),svi.ng.defaultString($scope,$attrs,"columnPrioritySymbolUgl",'["symbol", "dateAcquired", "qty", "unitCost", "gainLoss", "eventDesc", "accountType"]'),svi.ng.defaultString($scope,$attrs,"columnsSymbolHoldings",'["symbol", "accountType", "qty", "marketValueChange", "marketValue"]'),svi.ng.defaultString($scope,$attrs,"columnPrioritySymbolHoldings",'["symbol", "accountType", "qty", "marketValueChange", "marketValue"]'),$scope.urls=svi.ng.getInput($scope,$attrs,"urls"),labels.setupLabels($scope,["general","holdingZoom","holdingsList","priceHistoryChart","symbolOrderStatus","symbolHoldings","symbolUgl","detailedQuote","symbolNews"],{}),$scope.id=php.uniqid("holdingZoom"),$scope.showNews=!0,$scope.touchedByNewsEvent=!1,$scope.newsSymbol="Option"===$scope.investmentType?$scope.underlying:$scope.symbol,eventDispatcher.on($scope.eventName,function(e,data){if(data.hasOwnProperty("symbol")&&data.hasOwnProperty("underlying")&&data.hasOwnProperty("investmentType")){var newsSymbol="Option"===data.investmentType?data.underlying:data.symbol;$scope.newsSymbol!==newsSymbol&&($scope.showNews=!0,$scope.touchedByNewsEvent=!1,$scope.newsSymbol=newsSymbol),$scope.symbol=data.symbol,$scope.underlying=data.underlying,$scope.investmentType=data.investmentType}}),eventDispatcher.on($scope.id+".NEWS.LOADED",function(e,data){data.newsExists?($scope.showNews=!0,$scope.touchedByNewsEvent=!0):data.newsExists||$scope.touchedByNewsEvent||($scope.showNews=!1,$timeout(function(){$element.find("ul.nav-tabs li:first a").tab("show")}))})}]}}]),angular.module("directives").directive("sviOverviewGrid",["$templateRequest","$compile","APP_CONFIG","$timeout","overview","eventDispatcher","labels","state","$filter","floatThead","piwik",function($templateRequest,$compile,APP_CONFIG,$timeout,overview,eventDispatcher,labels,state,$filter,floatThead,piwik){return{replace:!1,scope:{accounts:"@",columns:"@",columnPriority:"@",responsiveColumns:"@",precision:"@",ownedTooltip:"@",ownedTotalsTooltip:"@",ownedDisclaimer:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"accounts","all"),svi.ng.defaultString($scope,$attrs,"columns",'["account","accountNickname","accountCategory","totalBalance","totalMarketValue","rtTotalMarketValue","rtTotalEquity","purchaseCost","unrealizedGainLoss","realizedGainLossCY","estAnnualIncome","todayChange","pctChange","mtdNetChange","mtdChange","mtdPctChange","ytdNetChange","ytdChange","ytdPctChange"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["account","accountNickname","accountDisplay","rtTotalEquity","unrealizedGainLoss","realizedGainLossCY","estAnnualIncome","todayChange","pctChange","accountCategory","totalBalance","totalMarketValue","rtTotalMarketValue","purchaseCost","mtdNetChange","mtdChange","mtdPctChange","ytdNetChange","ytdChange","ytdPctChange"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultInt($scope,$attrs,"precision",2),svi.ng.parseJSON($scope,$attrs,"columns"),svi.ng.parseJSON($scope,$attrs,"columnPriority"),svi.ng.defaultString($scope,$attrs,"ownedTooltip",""),svi.ng.defaultString($scope,$attrs,"ownedTotalsTooltip",""),svi.ng.defaultString($scope,$attrs,"ownedDisclaimer","")}catch(e){throw"sviOverviewGrid: "+e}$scope.initComplete=!1,$scope.overview=!1,$scope.refocus=null,APP_CONFIG.accountClasses&&($scope.accountClasses=APP_CONFIG.accountClasses),$scope.sortDir=state.get("overviewGrid-sortDir","asc"),$scope.sortField=state.get("overviewGrid-sortField","accountNickname"),labels.setupLabels($scope,["overview"],{}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.getLoadParameters=function(){return{sortField:$scope.sortField,sortDir:$scope.sortDir}};var load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout(load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}},loadCallback=function(invalidateCache){return $("html,body").animate({scrollTop:0},0),overview.getOverview($scope.accounts,$scope.getLoadParameters(),invalidateCache)},onSuccess=function(response){piwik.trackPage("overviewGrid","Overview Grid",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:"all"==$scope.accounts?"all":angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.overview=response.overview,$scope.overview.accounts.length?$timeout(function(){svi.ui.pulse(".overview-grid, .overview-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)}):$scope.loader.setMessage($scope.labels.noOverviewData);var dateFilter=$filter("sviDate");$scope.mtdDate=dateFilter($scope.overview.mtdNetChangeBeginningDate,"MM/dd/yyyy"),$scope.ytdDate=dateFilter($scope.overview.ytdNetChangeBeginningDate,"MM/dd/yyyy")},onError=function(reason){piwik.trackPage("overviewGrid/error","Error: Overview Grid",!1,[{name:"numAccounts",index:1,value:"all"==$scope.accounts?"all":angular.isArray($scope.accounts)?$scope.accounts.length:1}])};$scope.$watch("accounts",function(newval,oldval){newval!==oldval&&($scope.overview=!1,load())},!0),$scope.$watch("sortField",function(val){state.set("overviewGrid-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("overviewGrid-sortDir",val).save()}),floatThead.init($scope,$element),$timeout(function(){$scope.initComplete=!0,$scope.overview||load()},400),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount},!0),eventDispatcher.on("OVERVIEW.REFRESH",function(){load(!0)}),eventDispatcher.on("OVERVIEW.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.refocus='.svi-column-header[data-event="OVERVIEW.'+data.field+'"]',load())},!0),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{unrealizedGainLoss:"currencyChange",realizedGainLossCY:"currencyChange",todayChange:"currencyChange",pctChange:"percentChange",mtdNetChange:"currencyChange",mtdChange:"currencyChange",mtdPctChange:"percentChange",ytdNetChange:"currencyChange",ytdChange:"currencyChange",ytdPctChange:"percentChange"}}}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("household/overviewGrid/overviewGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviMarketIndicesChart",["$templateCache","$timeout","labels","config","$sce","bsBreakpoint","piwik",function($templateCache,$timeout,labels,config,$sce,bsBreakpoint,piwik){return{replace:!1,scope:{widgetSize:"@"},template:$templateCache.get("marketIndicesChart/marketIndicesChart.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultInt($scope,$attrs,"widgetSize",14),$scope.config=null,$scope.nasdaqTab=null,$scope.sandpTab=null,$scope.djiaTab=null,$scope.marketUrl=null,$scope.marketIndicesHtml=null,$scope.chartFlag=1,labels.setupLabels($scope,["marketIndicesChart"]);var loadCallback=function(){return config.getChartConfig(["dashboard","marketIndices"])},onSuccess=function(data){piwik.trackPage("marketIndicesChart","Market Indices Chart",1e3*data._loaderMetadata.elapsedTime),angular.isObject(data.config)&&0!==data.config.length&&($scope.config=data.config,$scope.config.hasOwnProperty("marketIndexUrl")&&($scope.marketUrl=$scope.config.marketIndexUrl,$scope.marketUrl=$sce.trustAsResourceUrl($scope.marketUrl)),angular.isObject($scope.config.tabs)&&angular.isObject($scope.config.marketIndexUrls)?($scope.nasdaqTab=$scope.config.tabs.nasdaq.under,$scope.sandpTab=$scope.config.tabs.sandp.under,$scope.djiaTab=$scope.config.tabs.djia.over,$scope.marketUrl=$scope.config.marketIndexUrls.djia.url):angular.isObject(data.config.marketIndexUrls)&&angular.isDefined($scope.config.marketIndexUrls.singleChart.url)&&($scope.marketUrl=$scope.config.marketIndexUrls.singleChart.url,$scope.marketIndicesHtml=$scope.config.marketIndexUrls.singleChart.html,$scope.marketIndicesHtml=$sce.trustAsHtml($scope.marketIndicesHtml)))};$scope.setFlag=function(number){1==number&&($scope.chartFlag=1),2==number&&($scope.chartFlag=2),3==number&&($scope.chartFlag=3)},$scope.chartSwap=function(number){1==number&&1!=$scope.chartFlag&&(2==$scope.chartFlag&&($scope.nasdaqTab=$scope.config.tabs.nasdaq.under),3==$scope.chartFlag&&($scope.sandpTab=$scope.config.tabs.sandp.under),$scope.djiaTab=$scope.config.tabs.djia.over,$scope.marketUrl=$scope.config.marketIndexUrls.djia.url),2==number&&2!=$scope.chartFlag&&(1==$scope.chartFlag&&($scope.djiaTab=$scope.config.tabs.djia.under),3==$scope.chartFlag&&($scope.sandpTab=$scope.config.tabs.sandp.under),$scope.nasdaqTab=$scope.config.tabs.nasdaq.over,$scope.marketUrl=$scope.config.marketIndexUrls.nasdaq.url),3==number&&3!=$scope.chartFlag&&(2==$scope.chartFlag&&($scope.nasdaqTab=$scope.config.tabs.nasdaq.under),1==$scope.chartFlag&&($scope.djiaTab=$scope.config.tabs.djia.under),$scope.sandpTab=$scope.config.tabs.sandp.over,$scope.marketUrl=$scope.config.marketIndexUrls.sandp.url)},$scope.UpdateChart=function(idNotation,url,line,label,mnt){var aTr=[];for(angular.forEach($element.find("tr"),function(node){aTr.push(node)}),i=0;i<aTr.length;i++)i%2==0?aTr[i].className="evenrow":aTr[i].className="oddrow";$element.find("#row_"+idNotation)[0].className="selected_td",angular.element(document.querySelector("#minichartimg"))[0].src=url+"?LINE_COLOR="+line+"&LABEL_COLOR="+label+"&MOUNTAIN_COLOR="+mnt+"&WIDTH=260&HEIGHT=100&ID_NOTATION="+idNotation};var onError=function(reason){piwik.trackPage("marketIndicesChart/error","Error: Market Indices Chart")};this.getLoader=svi.ng.getLoaderFactory($element,$scope,"loader"),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)},$scope.api=this,$timeout(function(){$scope.messages||$scope.api.load()},400)}],link:function(scope,element){scope.$watch(function(){return element.outerWidth()},function(width){scope.iframeHeight=bsBreakpoint.getBreakpoint()===bsBreakpoint.XS||512<width?380:335})}}}]),angular.module("directives").directive("sviMorningstar",["APP_CONFIG","$templateCache","$timeout","$log","sviMorningstar","$filter","eventDispatcher","$compile","$interval","$location","piwik",function(APP_CONFIG,$templateCache,$timeout,$log,sviMorningstar,$filter,eventDispatcher,$compile,$interval,$location,piwik){return{replace:!1,scope:{template:"@",type:"@",name:"@",height:"@",width:"@",version:"@",symbol:"@",morningstarSymbol:"@",tokens:"@",indexes:"@",settings:"@",title:"@",showSymbolLoader:"@",hideIfNoSymbol:"@",preferUnderlying:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){if($scope.type=svi.ng.required($attrs,"type"),svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultString($scope,$attrs,"name",""),svi.ng.defaultString($scope,$attrs,"height",""),svi.ng.defaultString($scope,$attrs,"width",""),svi.ng.defaultString($scope,$attrs,"version","*"),svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"morningstarSymbol",""),svi.ng.defaultString($scope,$attrs,"tokens",""),svi.ng.defaultString($scope,$attrs,"title","Morningstar"),svi.ng.defaultFalse($scope,$attrs,"showSymbolLoader"),svi.ng.defaultFalse($scope,$attrs,"hideIfNoSymbol"),svi.ng.defaultFalse($scope,$attrs,"preferUnderlying"),svi.ng.defaultString($scope,$attrs,"indexes",""),""===$scope.indexes?$attrs.indexes=$scope.indexes={"111.10.SPX":"S&P 500 Index","30.10.!DJI":"DJ Industrial Average","29.10.@CCO":"NASDAQ Composite"}:svi.ng.parseJSON($scope,$attrs,"indexes",$scope.indexes),svi.ng.defaultString($scope,$attrs,"settings","{}"),svi.ng.parseJSON($scope,$attrs,"settings",$scope.settings),angular.isArray($scope.settings)&&($attrs.settings=$scope.settings={}),"markets-components-marketindex"==$scope.type&&($scope.settings=$.extend({autoRefresh:!0,pullFrequency:3e3,gridColumns:["Symbol","Date","Chg","Chg%","LastPrice"],menuList:["US"],data:{US:{ticker:$scope.indexes}},showSymbolLine:!1,fixHeight:!1,chartFixed:!0,headerRow:!0,showTimeLabel:!0,showTime:!0,showTimezone:!0,timezone:"EST"},$scope.settings),!APP_CONFIG.djiaEnabled)){var indexes={};for(var x in $scope.settings.data.US.ticker)$scope.settings.data.US.ticker.hasOwnProperty(x)&&x!=sviMorningstar.DJIA&&(indexes[x]=$scope.settings.data.US.ticker[x]);$scope.settings.data.US.ticker=indexes}if(""!==$scope.symbol||""!==$scope.morningstarSymbol)switch(APP_CONFIG.djiaEnabled||(php.in_array($scope.symbol,["DJIA","DJI"])&&($scope.symbol=""),$scope.morningstarSymbol==sviMorningstar.DJIA&&($scope.morningstarSymbol="")),$scope.type){case"markets-components-svgchart":$scope.settings.mainTicker=""!==$scope.morningstarSymbol?$scope.morningstarSymbol:sviMorningstar.symbol($scope.symbol);break;default:$scope.settings.ticker=""!==$scope.morningstarSymbol?$scope.morningstarSymbol:sviMorningstar.symbol($scope.symbol)}""!==$scope.tokens&&($scope.settings.tokens=$scope.tokens),$scope.shouldShow=function(){return!$scope.api.getLoader().showSpinner&&!$scope.api.getLoader().shouldShowMessages()&&(!$scope.hideIfNoSymbol||""!==$scope.symbol&&!1!==$scope.symbol&&null!==$scope.symbol)};var camelCase=$filter("sviCamelCase"),getComponentName=function(name){if(""!==$scope.name)return $scope.name;switch(name){case"markets-components-marketcenter":return"marketsMarketCenter";case"ecScreenerLoader":return"ecScreenerLoaderScivantage";case"ecSalStockReport":return"ecSalStockReportScivantage";default:return camelCase(name,"snake")}};$scope.isAngular=$scope.type.startsWith("ec"),$scope.id=php.uniqid($scope.type),$scope.style={},$scope.height&&($scope.style.height=$scope.height),$scope.width&&($scope.style.width=$scope.width),$scope.component=null,$scope.morningstarContainer=null,$scope.placeholder=null,$scope.container=null,$scope.injector=null,$scope.onClickCb=angular.noop,$scope.onLoadCb=angular.noop,$scope.preInitComponentCb=angular.noop,$scope.loadedSymbol="",this.setOnClickCallback=function(fn){angular.isFunction(fn)&&($scope.onClickCb=fn)},this.getOnClickCallback=function(){return $scope.onClickCb},this.onClickCallback=function(){return $scope.api.getOnClickCallback().apply(this,arguments)},this.setOnLoadCallback=function(fn){angular.isFunction(fn)&&($scope.onLoadCb=fn)},this.getOnLoadCallback=function(){return $scope.onLoadCb},this.setPreInitComponentCallback=function(fn){angular.isFunction(fn)&&($scope.preInitComponentCb=fn)},this.getPreInitComponentCallback=function(){return $scope.preInitComponentCb},this.getInjector=function(){return $scope.injector},this.getComponent=function(){return $scope.component},this.getContainer=function(){return $scope.container},this.getLoader=svi.ng.getLoaderFactory($element,$scope);var syncDatepicker=function(){var field=$(this),value=field.val().replace(/-/g,"/"),datePickerDate=field.datepicker("getDate");datePickerDate&&datePickerDate.getTime()===new Date(value).getTime()||field.datepicker("setDate",value)};this.onLoadCallback=function(){$(".ecSectorHeatmap .ec-section.ec-section--ec-sector-heatmap").addClass("svi-bs-tooltip-disabled");var pickers=$scope.container.find(".mkts-cmpt-svgcht-calendar-pickers");0<pickers.length&&(pickers.addClass("form-inline"),$scope.container.addClass("svi-bs-datepicker")),$('.mkts-cmpt-svgcht-date-box:not([type="date"])').off().on("click",function(event){event.preventDefault()}).addClass("form-control").datepicker({autoclose:!0,todayHighlight:!0,format:"mm/dd/yyyy",container:$scope.container}).on("show",function(event){syncDatepicker.apply(event.target)});var calendars=$scope.container.find(".qs-calendar-uicalendar");0<calendars.length&&($("li.menu.noclose").on("click",function(){calendars.find(".help-block").css("display","none"),calendars.removeClass("has-error")}),calendars.prepend('<div style="display: none;" class="help-block">The maximum supported date range is one week. Please narrow your selection.</div>'),calendars.addClass("form-inline"),$scope.container.addClass("svi-bs-datepicker"),calendars.find("input").off().addClass("form-control").removeClass("qs-ui-ipt").attr("readonly",!1).datepicker({autoclose:!0,todayHighlight:!0,format:"mm-dd-yyyy",container:$scope.container}).on("show",function(event){syncDatepicker.apply(event.target)}),calendars.each(function(){var calendar=$(this);calendar.find("a.go").each(function(){var goButton=$(this),oldHandler=goButton.data("events").click[0].handler;goButton.unbind("click.calendar",oldHandler),goButton.on("click.calendar",function(originalHandler,calendar){var startField=calendar.find(".start"),endField=calendar.find(".end"),helpBlock=calendar.find(".help-block");return function(){var start=new Date(startField.val().replace(/-/g,"/")),end=new Date(endField.val().replace(/-/g,"/")),days=Math.floor(Math.abs((end-start)/864e5));if(!(7<days||days!=days))return calendar.removeClass("has-error"),helpBlock.css("display","none"),originalHandler.apply(this,arguments);calendar.addClass("has-error"),helpBlock.css("display","block")}}(oldHandler,calendar))})}),calendars.find("a.go").addClass("btn btn-primary").removeClass("qs-ui-btn").removeClass("go"),window.jQuery!==jQuery&&$timeout(function(){window.jQuery("#"+$scope.id+" .qs-calendar-uicalendar input").off()},100));return $scope.api.getOnLoadCallback().apply(this,arguments)},this.getPlaceholderEl=function(){return $scope.placeholder&&0<$scope.placeholder.length||($scope.placeholder=$element.find("#"+$scope.id+"-placeholder")),$scope.placeholder},this.resize=function(){if($scope.container&&0<$scope.container.children().length?$scope.style.height=$scope.container.children().eq(0).height():$scope.style.height=$scope.height,$scope.container){var placeholder=$scope.api.getPlaceholderEl();0<placeholder.length&&$scope.container.css({position:"absolute",left:placeholder.offset().left,top:placeholder.offset().top,width:placeholder.width(),height:placeholder.height(),overflowY:"hidden"})}};var interval=null;this.startResizeInterval=function(){null===interval&&$interval($scope.api.resize,50)},this.stopResizeInterval=function(){null!==interval&&($interval.cancel(interval),interval=null),$scope.api.resize()},$scope.verifyChartSymbolChange=function(){$scope.morningstarSymbol&&(APP_CONFIG.djiaEnabled||$scope.morningstarSymbol!=sviMorningstar.DJIA)&&($scope.component&&$scope.component.hasOwnProperty("setParameter")||$timeout($scope.verifyChartSymbolChange,200),$element.find(".mainChart-tickerName").text()!=$scope.symbol&&($scope.component.setParameter("investment",{id:$scope.morningstarSymbol}),$timeout($scope.verifyChartSymbolChange,500)))},$scope.updateSymbolCb=function(data){if(data&&angular.isObject(data)&&data.hasOwnProperty("morningstarSymbol")&&($scope.morningstarSymbol=data.morningstarSymbol),$scope.component)if($scope.morningstarSymbol&&(APP_CONFIG.djiaEnabled||$scope.morningstarSymbol!=sviMorningstar.DJIA))switch($scope.type){case"markets-components-svgchart":$scope.verifyChartSymbolChange();break;case"markets-components-quicktake":case"ecSalStockReport":$scope.component.setParameter("ticker",$scope.morningstarSymbol)}else $scope.api.getLoader().setError("Data is not currently available for this symbol.");else $timeout($scope.updateSymbolCb,200)},this.setUpdateSymbolCallback=function(fn){angular.isFunction(fn)&&($scope.updateSymbolCb=fn)},this.updateSymbol=function(symbol){if(!angular.isUndefined(symbol)||""===$scope.loadedSymbol||!angular.equals($scope.symbol,$scope.loadedSymbol)){if((angular.isString(symbol)||angular.isArray(symbol))&&($scope.symbol=symbol),angular.isArray($scope.symbol)){var length=$scope.symbol.length;0==length?$scope.symbol="":1==length&&($scope.symbol=$scope.symbol[0])}if($scope.loadedSymbol=$scope.symbol,angular.isArray($scope.symbol))switch($scope.type){case"markets-components-svgchart":return $scope.api.getLoader().clearAllMessages(),$scope.showSymbolLoader&&($scope.api.getLoader().showSpinner=!0),void sviMorningstar.getSymbolData($scope.symbol.join(",")).then(function(data){if($scope.showSymbolLoader&&($scope.api.getLoader().showSpinner=!1),data.success&&angular.isArray(data.results)&&0<data.results.length){$scope.morningstarSymbol=[data.results[0].morningstarSymbol],$scope.settings.mainTicker=data.results[0].morningstarSymbol;for(var compare=[],i=1;i<data.results.length;i++)$scope.morningstarSymbol.push(data.results[i].morningstarSymbol),compare.push(data.results[i].morningstarSymbol);$scope.settings.compareTickers=compare,null!=$scope.component&&(destroyComponent(),$timeout(registerComponent,100))}else $scope.api.getLoader().setError("Data is not currently available for this symbol.")},function(errorData){$scope.showSymbolLoader&&($scope.api.getLoader().showSpinner=!1),$scope.api.getLoader().setError("Data is not currently available for this symbol.")});default:$scope.symbol=$scope.symbol[0],$scope.loadedSymbol=$scope.symbol}""!==$scope.symbol&&($scope.api.getLoader().clearAllMessages(),!APP_CONFIG.djiaEnabled&&php.in_array($scope.symbol,["DJIA","DJI"])?$scope.api.getLoader().setError("Data is not currently available for this symbol."):($scope.showSymbolLoader&&($scope.api.getLoader().showSpinner=!0),sviMorningstar.getSymbolData($scope.symbol).then(function(data){$scope.showSymbolLoader&&($scope.api.getLoader().showSpinner=!1),$scope.morningstarSymbol=data.morningstarSymbol,$scope.updateSymbolCb(data)},function(errorData){$scope.showSymbolLoader&&($scope.api.getLoader().showSpinner=!1),$scope.api.getLoader().setError("Data is not currently available for this symbol.")})))}},$scope.api=this,$scope.settings.callbacks={onClick:this.onClickCallback,onLoad:this.onLoadCallback},"markets-components-calendar"==$scope.type&&delete $scope.settings.callbacks.onClick;var destroyComponent=function(){null!=$scope.component&&($scope.component.destroy(),$scope.component=null),null!=$scope.container&&($scope.isAngular?($scope.container.remove(),$(window).off("resize",$scope.api.resize),$element.find(".widget").off("heightChanged",$scope.api.resize)):$timeout($scope.container.empty),$scope.container=null)},registerComponent=function(){var componentConfig={type:$scope.type,version:$scope.version,settings:$scope.settings};sviMorningstar.register(getComponentName($scope.type),componentConfig).then(function(results){piwik.trackPage("morningstar/"+$scope.type,"Morningstar "+$scope.type);var loader=$scope.api.getLoader();loader&&(loader.showSpinner=!1),$scope.isAngular?($scope.morningstarContainer=results.container,$scope.container=$('<div class="morningstar-component '+$scope.type+'" id="'+$scope.id+'"></div>').css($scope.style).appendTo($scope.morningstarContainer)):$scope.container=$element.find("#"+$scope.id),$timeout(function(){($scope.isAngular&&($scope.api.resize(),$(window).on("resize",$scope.api.resize),$element.find(".widget").on("heightChanged",$scope.api.resize),$interval($scope.api.resize,2e3),eventDispatcher.on("DASHBOARD.DRAGGING.START",$scope.api.startResizeInterval,!1,$element),eventDispatcher.on("DASHBOARD.DRAGGING.STOP",$scope.api.stopResizeInterval,!1,$element)),angular.isFunction($scope.preInitComponentCb)&&$scope.preInitComponentCb(),$scope.component=morningstar.initComponent(getComponentName($scope.type),{container:$scope.container[0]}),$scope.isAngular&&morningstar.asterix.ng&&($scope.injector=angular.bootstrap($scope.container[0],["MorningstarApp"])),"ecScreenerLoader"==$scope.type&&angular.isFunction($scope.settings.callbacks.onClick))&&(morningstar.asterix.instanceRegistry.find("ecScreenerLoaderScivantage.funds.tableSecurities").on("click",$scope.settings.callbacks.onClick),morningstar.asterix.instanceRegistry.find("ecScreenerLoaderScivantage.investmentTrust.tableSecurities").on("click",$scope.settings.callbacks.onClick),morningstar.asterix.instanceRegistry.find("ecScreenerLoaderScivantage.equities.tableSecurities").on("click",$scope.settings.callbacks.onClick),morningstar.asterix.instanceRegistry.find("ecScreenerLoaderScivantage.exchangeTradedFunds.tableSecurities").on("click",$scope.settings.callbacks.onClick));if($element.on("$destroy",destroyComponent),"ecScreenerLoader"==$scope.type){var hash=$location.search();if($log.debug(hash),hash&&angular.isObject(hash)&&hash.hasOwnProperty("universeId")&&"STUSA"==hash.universeId){var selectStockScreener=function(){var el=$scope.container.find(".ec-chosen-investment-selector__button").first();el.length?el.click():$timeout(selectStockScreener,200)};selectStockScreener()}}$timeout($scope.api.updateSymbol,200)})},function(reason){var loader=$scope.api.getLoader();loader&&(loader.showSpinner=!1,loader.setError("Morningstar Components are currently unavailable.")),delete $scope.style.height,delete $scope.style.width})};registerComponent(),$timeout(function(){if(!$scope.container){var loader=$scope.api.getLoader();loader&&(loader.showSpinner=!0)}}),$scope.$watch("symbol",function(newValue,oldValue){null!==newValue&&newValue!=oldValue&&$scope.api.updateSymbol()}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){if($scope.preferUnderlying&&data.hasOwnProperty("underlying")&&angular.isString(data.underlying)&&""!==data.underlying)$scope.symbol!=data.underlying&&($scope.symbol=data.underlying);else if(data.hasOwnProperty("symbol")&&angular.isString(data.symbol)&&""!==data.symbol)if($scope.preferUnderlying&&data.hasOwnProperty("investmentType")&&"Option"==data.investmentType){var parts=data.symbol.split(new RegExp(APP_CONFIG.optionMaskSeparator));$scope.symbol!=parts[0]&&($scope.symbol=parts[0])}else $scope.symbol!=data.symbol&&($scope.symbol=data.symbol);else data.hasOwnProperty("symbolList")&&angular.isArray(data.symbolList)&&0<data.symbolList.length&&($scope.symbol=data.symbolList)},null,$element),eventDispatcher.on("MORNINGSTAR.SYMBOL.FILTER.CHANGED",function(e,data){angular.isString(data)&&""!==data&&($scope.symbol=data)},null,$element)}],link:function($scope,$element,$attrs){$element.html($templateCache.get("morningstar/morningstar"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviMorningstarGla",["$templateCache","$timeout","sviMorningstar","eventDispatcher","$compile","labels",function($templateCache,$timeout,sviMorningstar,eventDispatcher,$compile,labels){return{replace:!1,scope:{template:"@",height:"@",version:"@",settings:"@",title:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultString($scope,$attrs,"height",""),svi.ng.defaultString($scope,$attrs,"version","*"),svi.ng.defaultString($scope,$attrs,"title","Gainers / Losers / Actives"),svi.ng.defaultString($scope,$attrs,"settings","{}"),$scope.id=php.uniqid("gla"),labels.setupLabels($scope,["morningstarGla"],{}),$scope.mode="actives",$scope.isActive=function(mode){return $scope.mode==mode},$scope.onClick=function(tickerObj){if(angular.isObject(tickerObj)&&tickerObj.hasOwnProperty("type")){var symbol;if(tickerObj.hasOwnProperty("ticker"))symbol=tickerObj.ticker;else{if(!tickerObj.hasOwnProperty("clientTicker"))return;symbol=tickerObj.clientTicker}eventDispatcher.trigger("SYMBOL.CONTEXT.CHANGED",{symbol:symbol,investmentType:sviMorningstar.securityTypeFromMorningstar(tickerObj.type),underlying:symbol})}};var getGainersCtrl=svi.ng.getControllerFactory(".gainers",$scope,"svi-morningstar","gainersCtrl"),getLosersCtrl=svi.ng.getControllerFactory(".losers",$scope,"svi-morningstar","losersCtrl"),getActivesCtrl=svi.ng.getControllerFactory(".actives",$scope,"svi-morningstar","activesCtrl"),attachGainersCb=function(){var ctl=getGainersCtrl();ctl?ctl.setOnClickCallback($scope.onClick):$timeout(attachGainersCb,200)},attachLosersCb=function(){var ctl=getLosersCtrl();ctl?ctl.setOnClickCallback($scope.onClick):$timeout(attachLosersCb,200)},attachActivesCb=function(){var ctl=getActivesCtrl();ctl?ctl.setOnClickCallback($scope.onClick):$timeout(attachActivesCb,200)};"Widget"!=$scope.template&&($timeout(attachGainersCb),$timeout(attachLosersCb),$timeout(attachActivesCb))}],link:function($scope,$element,$attrs){$element.html($templateCache.get("morningstarGla/morningstarGla"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviMorningstarScreener",["$templateCache","$timeout","sviMorningstar","$filter","eventDispatcher","$compile","$popover","symbol","sviUrl",function($templateCache,$timeout,sviMorningstar,$filter,eventDispatcher,$compile,$popover,symbol,sviUrl){return{replace:!1,scope:{template:"@",height:"@",version:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultString($scope,$attrs,"height",""),svi.ng.defaultString($scope,$attrs,"version","*"),$scope.popover=null,$scope.onClickMenuItem=function(item,event){angular.isDefined(event)&&(event.preventDefault(),event.stopPropagation());var el=$element.find(".dropdown.open");switch(el&&el.dropdown("toggle"),$scope.popover&&$scope.popover.hide(),eventDispatcher.trigger("NAVIGATION.CONTEXT.CHANGED",item),item.type){case"url":angular.isDefined(event)&&(2===event.which||1===event.which&&(event.metaKey||event.ctrlKey))&&sviUrl.href(item.url,"_blank"),sviUrl.href(item.url,item.target,item.specs);break;case"javascript":if(!item.function)throw JSON.stringify(item)+" is missing the required parameters to execute.";for(var fn=item.function.split("."),ref=window,i=0;i<fn.length;i++){if(!angular.isDefined(ref[fn[i]]))throw 0<i?fn[i]+" is not a member of "+fn[i-1]:fn[i]+" is not a member of window";ref=ref[fn[i]]}if("function"!=typeof ref)throw item.function+" is not a function";ref.apply(window,item.params);break;case"event":eventDispatcher.trigger(item.event.name,item.event.data)}},$scope.onClick=function(data){var elementKey="",quoteTicker="";angular.isObject(data)&&data.hasOwnProperty("id")?elementKey=data.id:angular.isObject(data)&&data.hasOwnProperty("secId")&&(elementKey=data.secId),getPopover(elementKey),angular.isObject(data)&&data.hasOwnProperty("ticker")?quoteTicker=data.ticker:angular.isObject(data)&&data.hasOwnProperty("t")&&(quoteTicker=data.t),null===quoteTicker||""===quoteTicker?($scope.popover.$scope.actionMenuData=[],$scope.popover.$promise.then(function(){$scope.popover.show()})):symbol.getQuote(quoteTicker,!0).success(function(response){angular.isObject(response)&&response.hasOwnProperty("symbolQuote")&&angular.isObject(response.symbolQuote)&&response.symbolQuote.hasOwnProperty("instrumentQuotes")&&angular.isArray(response.symbolQuote.instrumentQuotes)&&response.symbolQuote.instrumentQuotes.length&&($scope.popover.$scope.actionMenuData=response.symbolQuote.instrumentQuotes[0].menuItems,$scope.popover.$promise.then(function(){$scope.popover.show()}))})};var getPopover=function(key){var el=angular.element(document.querySelector('td[data-key="'+key+'"] button')),popoverId=key+"-popover";return $scope.popover=$popover(el,{id:popoverId,placement:"bottom-left",container:".svi-bs .modals-section",target:el,trigger:"click",autoClose:!0,templateUrl:"morningstarScreener/popover.tpl.html"}),($scope.popover.$scope=$scope).popover.$scope.id=popoverId,$scope.popover},getScreenerCtrl=svi.ng.getControllerFactory(".screener",$scope,"svi-morningstar","screenerCtrl"),attachScreenerCb=function(){var ctl=getScreenerCtrl();ctl?ctl.setOnClickCallback($scope.onClick):$timeout(attachScreenerCb,200)};"Widget"!=$scope.template&&$timeout(attachScreenerCb)}],link:function($scope,$element,$attrs){$element.html($templateCache.get("morningstarScreener/morningstarScreener"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviMorningstarTinyChart",["$templateCache","$compile",function($templateCache,$compile){return{replace:!1,scope:{template:"@",height:"@",width:"@",version:"@",settings:"@",title:"@",symbol:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultString($scope,$attrs,"height","200px"),svi.ng.defaultString($scope,$attrs,"width","300px"),svi.ng.defaultString($scope,$attrs,"version","~2.11.0"),svi.ng.defaultString($scope,$attrs,"title","Morningstar Chart"),svi.ng.defaultString($scope,$attrs,"settings","{}"),svi.ng.parseJSON($scope,$attrs,"settings",$scope.settings);$scope.settings=$.extend({},{hideVolume:!0,hideSlider:!0,hideMenu:!0,hideCrossHair:!0},$scope.settings)}],link:function($scope,$element,$attrs){$element.html($templateCache.get("morningstarTinyChart/morningstarTinyChart"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviDock",["$templateCache","$timeout","labels","dashboard","cache","$filter","$interval","APP_CONFIG",function($templateCache,$timeout,labels,dashboard,cache,$filter,$interval,APP_CONFIG){return{replace:!1,scope:{dockId:"@",editEnabled:"@"},template:$templateCache.get("dock/dock.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"dockId","1"),svi.ng.defaultTrue($scope,$attrs,"editEnabled")}catch(e){throw"sviDock: "+e}var bodyEl=$("body");bodyEl.addClass("dock-enabled");var checkDockPadding=function(){var el=$(".dock-padding");(0===el.length||el.hasClass("dock-padding-auto"))&&($("body > div:last").hasClass("dock-padding")||($("div.dock-padding-auto").remove(),bodyEl.append('<div class="dock-padding dock-padding-auto"></div>')),$timeout(checkDockPadding,1e3))};checkDockPadding();APP_CONFIG.viewMode&&($scope.editEnabled=$attrs.editEnabled=!1),$scope.config=cache.get("dock"),labels.setupLabels($scope,["dock"],{dockNoConfig:"Dock configuration is unavailable."}),$scope.editing=!1,$scope.dragging=!1,$scope.ariaMsg="",$scope.expanded=svi.ng.strToBoolean(cache.get("dock-expanded"),!$.browser.mobile),$scope.$watch("expanded",function(val){cache.set("dock-expanded",val,0)}),$scope.sortableConfig={"ui-floating":!0,scroll:!1,handle:".drag-handle",containment:".dock-sortable-container",start:function(evt){$scope.$applyAsync("dragging = true")},stop:function(evt){$scope.$applyAsync("dragging = false"),resizeDragOverlays()}};var dashboardUpdate=$.throttle(3e3,function(){dashboard.update("dock",$scope.dockId,$scope.config.resource).then(function(response){200==response.status&&response.data.success?(retryAllowed=!0,cache.set("dock",$scope.config,36e5)):retryAllowed&&(retryAllowed=!1,watchResource())})}),retryAllowed=!0,watchResourceTimeout=null,watchResource=function(newValue,oldValue){if(watchResourceTimeout&&($timeout.cancel(watchResourceTimeout),watchResourceTimeout=null),$scope.config){if($timeout(function(){$element.find($scope.sortableConfig.handle).attr("tabindex",0).off("keydown").on("keydown",$scope.onKeypress)},100),$scope.dragging)return watchResourceTimeout=$timeout(watchResource,500);if(angular.isUndefined(newValue))newValue=$scope.config.resource;else if(angular.equals(newValue,oldValue))return;for(var changed=!1,i=0;i<newValue.layout.length;i++)$scope.config.sections.hasOwnProperty(newValue.layout[i])||(changed=!0,newValue.layout.splice(i--,1));if(changed)return $scope.config.resource=newValue,watchResourceTimeout=$timeout(watchResource,500);dashboardUpdate()}};$scope.editEnabled&&$scope.$watch("config.resource",watchResource,!0);var processSections=function(){if($scope.config&&"object"==typeof $scope.config.sections)for(var x in $scope.config.sections)$scope.config.sections.hasOwnProperty(x)&&$scope.config.sections[x].hasOwnProperty("content")&&($scope.config.sections[x].html=$filter("objectToHTML")($scope.config.sections[x].content))};processSections();var loadCallback=function(invalidateCache){return dashboard.get("dock",$scope.dockId,invalidateCache)},onSuccess=function(data){$scope.config=data,cache.set("dock",$scope.config,36e5),processSections()},onError=function(reason){};this.getLoader=svi.ng.getLoaderFactory($element,$scope),this.load=function(invalidateCache){angular.isUndefined(invalidateCache)&&(invalidateCache=!1);var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError):$timeout($scope.api.load,400)};var resizeDragOverlays=function(setFocus){angular.isUndefined(setFocus)&&(setFocus=!1),$timeout(function(){$element.find(".drag-handle").each(function(){var parentWidth=$(this).parent().outerWidth();if(5<parentWidth){var parentHeight=$(this).parent().outerHeight(),childWidth=$(this).outerWidth(),childHeight=$(this).outerHeight();$(this).show(),$(this).css({left:(parentWidth-childWidth)/2,top:(parentHeight-childHeight)/2})}else $(this).hide()})}),$element.find(".dock-item").find("a, input, button").each(function(){var el=$(this);if(!el.hasClass("dock-no-tabbing")&&!el.hasClass(".drag-handle".substr(1))){var tabindex=el.attr("tabindex");void 0!==tabindex&&el.attr("data-saved-tabindex",tabindex),el.addClass("dock-no-tabbing").attr("tabindex","-1")}}),$timeout(function(){$element.find($scope.sortableConfig.handle).attr("tabindex",0).off("keydown").on("keydown",$scope.onKeypress),setFocus&&$element.find($scope.sortableConfig.handle).first().focus()},100)};this.toggleEdit=function(enabled){enabled=svi.ng.strToBoolean(enabled,!$scope.editing),$scope.$applyAsync("editing = "+(enabled?"true":"false")),enabled?($scope.ariaMsg=$scope.labels.dockEditBeginMsg,resizeDragOverlays(!0)):($scope.ariaMsg=$scope.labels.dockEditEndMsg,$element.find(".dock-no-tabbing").each(function(){var el=$(this);if(el.hasClass("dock-no-tabbing")){el.removeClass("dock-no-tabbing").attr("tabindex",null);var tabindex=el.attr("data-saved-tabindex");void 0!==tabindex&&el.attr("tabindex",tabindex)}}))},this.toggleExpand=function(expanded){expanded=svi.ng.strToBoolean(expanded,!$scope.expanded),$scope.$applyAsync("expanded = "+(expanded?"true":"false"))},this.scrollLeft=function(){var container=$element.find(".dock-sortable-container"),target=container.scrollLeft()-150;container.animate({scrollLeft:0<target?target:0},200)},this.scrollRight=function(){var container=$element.find(".dock-sortable-container"),target=container.scrollLeft()+150,maxWidth=container[0].scrollWidth-container.width();container.animate({scrollLeft:target<maxWidth?target:maxWidth},200)};var scrollPromise=null;$scope.leftScrollMousedown=function(){scrollPromise&&$interval.cancel(scrollPromise),scrollPromise=$interval($scope.api.scrollLeft,200)},$scope.rightScrollMousedown=function(){scrollPromise&&$interval.cancel(scrollPromise),scrollPromise=$interval($scope.api.scrollRight,200)},$scope.scrollMouseup=function(){$interval.cancel(scrollPromise),scrollPromise=null};var resetDockCallback=function(){return dashboard.remove("dock",$scope.dockId)},resetDockSuccess=function(){$scope.api.load(!0)};this.resetDock=function(){$scope.api.toggleEdit(!1),$scope.config=!1;var loader=$scope.api.getLoader();loader?loader.setLoadHandler(resetDockCallback).load().then(resetDockSuccess,onError):$timeout($scope.api.resetDock,400)};var findSection=function(section){var l,i=0;for(i=0,l=$scope.config.resource.layout.length;i<l;i++)if($scope.config.resource.layout[i]==section)return i;return!1},swap=function(a,b){var temp=$scope.config.resource.layout[a];$scope.config.resource.layout[a]=$scope.config.resource.layout[b],$scope.config.resource.layout[b]=temp},focusSection=function(section){$timeout(function(){resizeDragOverlays(),$element.find('[data-section="'+section+'"] '+$scope.sortableConfig.handle).first().focus(),$scope.ariaMsg=$scope.labels.dockCurrentOrder;for(var i=0,l=$scope.config.resource.layout.length;i<l;i++)$scope.ariaMsg+=$filter("sviWords")($scope.config.resource.layout[i]),$scope.config.resource.layout[i]==section&&($scope.ariaMsg+=" is currently focused"),i+1<l&&($scope.ariaMsg+=", ")},100)};$scope.onKeypress=function(evt){var location,section=$(this).attr("data-section");section?37==evt.which||65==evt.which?(evt.stopPropagation(),evt.preventDefault(),!1!==(location=findSection(section))&&$scope.$applyAsync(function(){if(0<location)swap(location,location-1);else{var temp=$scope.config.resource.layout.shift();$scope.config.resource.layout.push(temp)}focusSection(section)})):39!=evt.which&&68!=evt.which||(evt.stopPropagation(),evt.preventDefault(),!1!==(location=findSection(section))&&$scope.$applyAsync(function(){if(location+1<$scope.config.resource.layout.length)swap(location,location+1);else{var temp=$scope.config.resource.layout.pop();$scope.config.resource.layout.unshift(temp)}focusSection(section)})):console.warn("section not found")};var fixedFocus={init:function(fixedElem){fixedFocus.fixedElem=fixedElem,document.body.addEventListener("focusin",fixedFocus.adjust)},adjust:function(e){var fixedTopPos=fixedFocus.fixedElem.getBoundingClientRect().top,rect=e.target.getBoundingClientRect();0<fixedTopPos&&rect.bottom>fixedTopPos&&rect.top+20>=fixedTopPos&&window.scrollBy(0,rect.bottom-fixedTopPos)}},onReadyFixedFocus=function(){var elem=document.querySelector(".svi-dock");elem&&fixedFocus.init(elem)};"loading"!==document.readyState?onReadyFixedFocus():document.addEventListener("DOMContentLoaded",onReadyFixedFocus),$scope.api=this,$timeout(function(){$scope.api.load()},400)}]}}]),angular.module("directives").directive("sviFastFind",["$templateCache","eventDispatcher","piwik",function($templateCache,eventDispatcher,piwik){return{template:$templateCache.get("fastFind/fastFind.tpl.html"),scope:{title:"@",size:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"title","Fast Find"),svi.ng.defaultValidString($scope,$attrs,"size",["sm","md","lg"],"lg"),$scope.active=!1,$scope.id=php.uniqid("fastfind"),($scope.api=this).showModal=function(){piwik.trackPage("fastFind","Fast Find"),$scope.$applyAsync("active = true"),$element.find(".svi-fast-find").modal("show")},this.hideModal=function(){$scope.active&&($element.find(".svi-fast-find").modal("hide"),$scope.$applyAsync("active = false"))},eventDispatcher.on("FASTFIND.SHOW",function(){$scope.api.showModal()},null,$element),eventDispatcher.on("FASTFIND.HIDE",function(){$scope.api.hideModal()},null,$element)}],link:function($scope,$element,$attrs){$("#shortcutFastFind").on("click",$scope.api.showModal)}}}]),angular.module("directives").directive("sviLoginTips",["$templateCache","labels","preferences","bsBreakpoint",function($templateCache,labels,preferences,bsBreakpoint){var tips=[{id:"toggleTable",maxBreakpoint:bsBreakpoint.SM}];return{scope:{},template:$templateCache.get("loginTips/loginTips.tpl.html"),link:function($scope,$element,$attrs){var breakpoint=bsBreakpoint.getBreakpoint(),tipsToShow=[],currentTip=0,tipsSeen=[];$scope.getCurrentTipNum=function(){return currentTip+1},$scope.getTotalTips=function(){return tipsToShow.length},$scope.hasPreviousTip=function(){return 0<currentTip},$scope.hasNextTip=function(){return currentTip<tipsToShow.length-1};var markTipSeen=function(tipIndex){var tipId=tipsToShow[tipIndex].id;-1===tipsSeen.indexOf(tipId)&&tipsSeen.push(tipId)};$scope.showPreviousTip=function(){$scope.hasPreviousTip()&&markTipSeen(--currentTip)},$scope.showNextTip=function(){$scope.hasNextTip()&&markTipSeen(++currentTip)},$scope.getCurrentTipLabel=function(){var label=null;if(0<tipsToShow.length){var key="tips."+tipsToShow[currentTip].id;label=$scope.labels[key]}return label},labels.setupLabels($scope,["loginTipsModal","paging"],{previousPage:"Previous",nextPage:"Next"});var modalInit=!1;$scope.showModal=function(){var modalParameters;modalParameters=modalInit?"show":{backdrop:modalInit=!0,show:!0},$element.find(".svi-login-tips-modal").modal(modalParameters),markTipSeen(currentTip)};$scope.hideModal=function(){preferences.set(["loginTips","seen"],tipsSeen),$element.find(".svi-login-tips-modal").modal("hide")};var prefsCallback=function(response){if(tipsSeen=[],angular.isObject(response)&&response.hasOwnProperty("data")){var data=response.data;angular.isObject(data)&&data.hasOwnProperty("success")&&data.success&&angular.isArray(data.resource)&&(tipsSeen=data.resource)}angular.forEach(tips,function(tip,key){var show=!0;null!==breakpoint&&(tip.maxBreakpoint!==undefined&&breakpoint>tip.maxBreakpoint&&(show=!1),tip.minBreakpoint!==undefined&&breakpoint<tip.minBreakpoint&&(show=!1)),show&&-1===tipsSeen.indexOf(tip.id)&&tipsToShow.push(tip)}),0<tipsToShow.length&&$scope.showModal()};preferences.get(["loginTips","seen"]).then(prefsCallback,prefsCallback)}}}]),angular.module("directives").directive("sviMessageCenterBadge",["$templateCache","$timeout","userMessage","piwik",function($templateCache,$timeout,userMessage,piwik){return{replace:!1,scope:{alertsLabel:"@"},template:$templateCache.get("messageCenterBadge/messageCenterBadge.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"alertsLabel",""),$scope.badgeUrl=null,$scope.unreadMessages="";var loadCallback=function(){return userMessage.getMessagesBadge()},onSuccess=function(data){piwik.trackPage("messageCenterBadge","Message Center Badge",1e3*data._loaderMetadata.elapsedTime),angular.isDefined(data.unreadMessages)&&angular.isDefined(data.badgeUrl)&&($scope.badgeUrl=data.badgeUrl,$scope.unreadMessages=data.unreadMessages)},onError=function(reason){piwik.trackPage("messageCenterBadge/error","Error: Message Center Badge")};this.getLoader=svi.ng.getLoaderFactory($element,$scope),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)},$scope.api=this,$timeout(function(){$scope.api.load()},400)}]}}]),angular.module("directives").directive("sviNavigation",["APP_CONFIG","$templateCache","$compile","$log","sviUrl","accountList","eventDispatcher","$timeout","labels","navigation","cache","waypoints","bsBreakpoint",function(APP_CONFIG,$templateCache,$compile,$log,sviUrl,accountList,eventDispatcher,$timeout,labels,navigation,cache,waypoints,bsBreakpoint){return{replace:!1,scope:{template:"@",config:"@",navJson:"@",stickyEnabled:"@",brandLabel:"@",brandLogo:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"template","bootstrap"),svi.ng.defaultString($scope,$attrs,"config","[]"),svi.ng.defaultString($scope,$attrs,"navLevel","[]"),svi.ng.defaultTrue($scope,$attrs,"stickyEnabled"),svi.ng.defaultString($scope,$attrs,"brandLabel",""),svi.ng.defaultString($scope,$attrs,"brandLogo",""),"legacy"==$scope.template&&bsBreakpoint.getBreakpoint()<bsBreakpoint.SM&&($scope.template=$attrs.template="bootstrap"),$scope.id=php.uniqid("svi-nav");var getNavigationCacheKey=function(){return"navigation-"+accountList.getAccountByIndex($scope.accountIndex)};$scope.accountIndex=accountList.getCurrentAccountIndex();try{svi.ng.parseJSON($scope,$attrs,"config"),angular.isArray($scope.config)||($scope.config=$attrs.config=[])}catch(e){$scope.config=$attrs.config=[]}try{svi.ng.parseJSON($scope,$attrs,"navLevel")}catch(e){$scope.navLevel=$attrs.navLevel=[]}$scope.loaded=!1,labels.setupLabels($scope,["navigation"],{navNoConfig:"Navigation configuration is unavailable."});var waypointWatch=null,setupStickyNav=function(){var bodyEl=$("body");if($scope.stickyEnabled){bodyEl.addClass("sticky-navigation"),$timeout(function(){var navEl=$element.find(".navbar-wrapper");navEl&&waypoints.init($scope,navEl)},100);var initNavbar=function(){$scope.navbarWrapperHeight=(bsBreakpoint.isMobile()?APP_CONFIG.navHeightMobile:APP_CONFIG.navHeight)+"px"};APP_CONFIG.navHeightMobile!==APP_CONFIG.navHeight&&eventDispatcher.on("WINDOW.BREAKPOINT",function(event){initNavbar()}),initNavbar()}else bodyEl.removeClass("sticky-navigation"),$scope.waypoints&&angular.isFunction($scope.waypoints.destroy)&&$scope.waypoints.destroy(),null!==waypointWatch&&(waypointWatch(),waypointWatch=null)},setupDropdownEvents=function(){$timeout(function(){$element.find(".dropdown").off("show.bs.dropdown").off("hide.bs.dropdown").on("show.bs.dropdown",function(evt){$(evt.target).siblings().addClass("unopen")}).on("hide.bs.dropdown",function(evt){$(evt.target).siblings().removeClass("unopen")})})};$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){var navigation=cache.get(getNavigationCacheKey());null!=navigation&&angular.isObject(navigation)&&navigation.hasOwnProperty("config")&&angular.isArray(navigation.config)&&0<navigation.config.length?($scope.config=navigation.config,navigation.hasOwnProperty("brandLabel")&&($scope.brandLabel=navigation.brandLabel),navigation.hasOwnProperty("brandLogo")&&($scope.brandLogo=navigation.brandLogo),$scope.loaded=!0):$scope.loaded=!1,$scope.loader?$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.load,250),setupStickyNav(),setupDropdownEvents()},$timeout($scope.load);var loadCallback=function(){return navigation.getConfig($scope.accountIndex)},onSuccess=function(data){var response=data.data||data;response.navigation.length?(response.hasOwnProperty("brandLabel")&&($scope.brandLabel=response.brandLabel),response.hasOwnProperty("brandLogo")&&($scope.brandLogo=response.brandLogo),$scope.config=response.navigation,cache.set(getNavigationCacheKey(),{brandLabel:$scope.brandLabel,brandLogo:$scope.brandLogo,config:$scope.config},36e5),$scope.loaded=!0,setupStickyNav(),setupDropdownEvents()):$scope.loader.setError($scope.labels.navNoConfig)},onError=function(response){$scope.loader.setError($scope.labels.navNoConfig)};$scope.onFocus=function(item,event){if(!(bsBreakpoint.getBreakpoint()<bsBreakpoint.SM)){var parent=angular.element(event.target).parent();parent.siblings().removeClass("open"),parent.addClass("unopen")}},$scope.onClick=function(item,event){switch(eventDispatcher.trigger("NAVIGATION.CONTEXT.CHANGED",item),"menu"!=item.type&&item.hasOwnProperty("children")&&item.children&&($.browser.mobile||bsBreakpoint.getBreakpoint()<bsBreakpoint.SM)&&(item.type="menu"),item.type){case"url":angular.isDefined(event)&&(event.preventDefault(),event.stopPropagation());var target,url=item.url;item.url.match(/\?/)?url+="&":url+="?",angular.isDefined(event)&&(1!==event.which||event.metaKey||event.ctrlKey)?(2===event.which||1===event.which&&(event.metaKey||event.ctrlKey))&&(target="_blank"):target=item.target,sviUrl.href(url+$.param({navLevel:item.navLevel}),target,item.specs);break;case"javascript":if(angular.isDefined(event)&&(event.preventDefault(),event.stopPropagation()),!item.function)throw item+" is missing the required parameters to execute.";for(var fn=item.function.split("."),ref=window,i=0;i<fn.length;i++){if(!angular.isDefined(ref[fn[i]]))throw fn[i]+" is not a member of "+ref;ref=ref[fn[i]]}if("function"!=typeof ref)throw ref+" is not a function";ref.apply(window,item.params)}},$scope.getNavClass=function(item){if(!angular.isObject(item)){try{$log.warn("sviNavigation: invalid item",item)}catch(e){}return""}angular.isArray($scope.navLevel)||($scope.navLevel=[]),angular.isArray(item.navLevel)||(item.navLevel=[]);var cls="nav-"+item.navLevel.join("-")+" type-"+item.type+" ";item.hasOwnProperty("class")&&item.class&&(cls+=item.class+" ");var scopeLen=$scope.navLevel.length,itemLen=item.navLevel.length;if(0<scopeLen&&0<itemLen){for(var i=0;i<itemLen;i++)if(scopeLen<=i||item.navLevel[i]!=$scope.navLevel[i])return cls+"deselected";return cls+"selected"}return item.hasOwnProperty("selected")&&item.selected?cls+"selected":cls+"deselected"},$scope.getHref=function(item){return item.hasOwnProperty("url")&&item.url?item.hasOwnProperty("children")&&item.children&&($.browser.mobile||bsBreakpoint.getBreakpoint()<bsBreakpoint.SM)?"":item.url:""},setupStickyNav(),setupDropdownEvents(),$scope.onMouseenter=function(event){var target=$(event.currentTarget);target.addClass("over"),target.children("ul").show()},$scope.onMouseleave=function(event){var target=$(event.currentTarget);target.removeClass("over"),target.children("ul").hide()};var getDockCtl=svi.ng.getControllerFactory($(".sviInvestor"),$scope,"svi-dock");$scope.toggleDock=function(){var ctl=getDockCtl();ctl&&ctl.toggleExpand()},eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data.hasOwnProperty("index")&&$scope.accountIndex!=data.index&&($scope.accountIndex=data.index,$scope.load())})}],link:function($scope,$element,$attrs){$element.html($templateCache.get("navigation/"+$scope.template+"Nav.tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviSessionReminder",["$templateCache","$compile","labels","eventDispatcher","session","sviUrl","config","$timeout","piwik",function($templateCache,$compile,labels,eventDispatcher,session,sviUrl,config,$timeout,piwik){return{scope:{mode:"@",size:"@",message:"@",warnSeconds:"@",checkInterval:"@",leadSeconds:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultValidString($scope,$attrs,"mode",["bootstrap","ui-dialog","silent"],"bootstrap"),svi.ng.defaultValidString($scope,$attrs,"size",["sm","md","lg"],"md"),svi.ng.defaultString($scope,$attrs,"message",""),svi.ng.defaultInt($scope,$attrs,"warnSeconds",120,3600,0),svi.ng.defaultInt($scope,$attrs,"checkInterval",600,86400,0),svi.ng.defaultInt($scope,$attrs,"leadSeconds",15,60,5),$scope.active=!1,$scope.expireTimestamp=0,$scope.sessionData=null,$scope.api=this,$scope.warnCountDown=0,$scope.warnCountMinute=0,$scope.id=php.uniqid("sessionReminder"),labels.setupLabels($scope,["sessionReminder"],{});var checkIntervalTimeout=null,warnLeadTimeout=null,warnTimeout=null,logoutTimeout=null,retryCount=0,processResponse=function(response){if(200==response.status&&response.data){$scope.expireTimestamp=response.data.expireTimestamp,$scope.sessionData=response.data,retryCount=0;var secondsRemaining=response.data.secondsRemaining;$scope.leadSeconds&&0<secondsRemaining-$scope.warnSeconds-$scope.leadSeconds-1&&(warnLeadTimeout&&$timeout.cancel(warnLeadTimeout),warnLeadTimeout=$timeout($scope.api.refreshSessionData,1e3*(secondsRemaining-$scope.warnSeconds-$scope.leadSeconds))),$scope.warnSeconds&&!$scope.active&&(0<secondsRemaining-$scope.warnSeconds?(warnTimeout&&$timeout.cancel(warnTimeout),warnTimeout=$timeout($scope.api.showModal,1e3*(secondsRemaining-$scope.warnSeconds))):$scope.api.showModal()),0<secondsRemaining?(logoutTimeout&&$timeout.cancel(logoutTimeout),logoutTimeout=$timeout($scope.api.sessionExpired,1e3*secondsRemaining)):$scope.api.sessionExpired()}else retryCount<3?(retryCount++,response.config.url.contains("keepalive")?$timeout($scope.api.extendSession,15e3):$timeout($scope.api.refreshSessionData,15e3)):0===$scope.expireTimestamp&&$scope.api.sessionExpired();$scope.checkInterval&&(checkIntervalTimeout&&$timeout.cancel(checkIntervalTimeout),checkIntervalTimeout=$timeout($scope.api.refreshSessionData,1e3*$scope.checkInterval))};this.refreshSessionData=function(){checkIntervalTimeout&&($timeout.cancel(checkIntervalTimeout),checkIntervalTimeout=null),warnLeadTimeout&&($timeout.cancel(warnLeadTimeout),warnLeadTimeout=null),session.getTimeRemaining(!1).then(processResponse)},$timeout($scope.api.refreshSessionData),this.extendSession=function(){$scope.api.hideModal(),session.extend().then(processResponse)},this.logout=function(){$scope.api.hideModal(),session.logout()},this.sessionExpired=function(force){if(angular.isUndefined(force)&&(force=!1),!force&&1<$scope.getSecondsRemaining())return!1;$scope.api.hideModal(),session.handleSessionExpired()};var digestTimeout=null,scheduleDigest=function(){$scope.active&&($scope.$applyAsync(),digestTimeout&&$timeout.cancel(digestTimeout),digestTimeout=$timeout(scheduleDigest,1e3))};this.showModal=function(force){return angular.isUndefined(force)&&(force=!1),!($scope.active||!force&&$scope.getSecondsRemaining()>$scope.warnSeconds)&&(force||"silent"!=$scope.mode?(piwik.trackPage("sessionReminder","Session Reminder"),$scope.active=!0,warnTimeout&&($timeout.cancel(warnTimeout),warnTimeout=null),scheduleDigest(),void("ui-dialog"==$scope.mode?$element.find("#divtimeoutTemplate").dialog({autoOpen:!0,appendTo:$element.find(".svi-session-reminder"),draggable:!1,width:350,height:350,modal:!0,buttons:[{text:$scope.labels.sessionExtendButton,click:function(){$scope.api.extendSession()}},{text:$scope.labels.sessionLogoutButton,click:function(){$scope.api.logout()}}]}):$element.find(".svi-session-reminder").modal({backdrop:"static",show:!0}))):(eventDispatcher.trigger("SESSION_REMINDER.EXPIRING",{secondsRemaining:$scope.getSecondsRemaining()}),!1))},this.hideModal=function(){$scope.active&&($scope.active=!1,"ui-dialog"==$scope.mode?$element.find("#divtimeoutTemplate").dialog("close"):$element.find(".svi-session-reminder").modal("hide"))},$scope.getSecondsRemaining=function(){var now=new Date,secondsRemaining=$scope.expireTimestamp-Math.floor(now.getTime()/1e3);return secondsRemaining<0&&(secondsRemaining=0),secondsRemaining},$scope.getTimeRemaining=function(){var secondsRemaining=$scope.getSecondsRemaining(),minutes=Math.floor(secondsRemaining/60),seconds=secondsRemaining%60;return secondsRemaining%10==0&&0!=seconds&&($scope.warnCountDown=minutes+":"+(seconds<10?"0":"")+seconds),0<minutes&&0==seconds&&($scope.warnCountMinute=minutes),minutes+":"+(seconds<10?"0":"")+seconds},eventDispatcher.on("SESSION_REMINDER.SHOW",function(){$scope.api.showModal(!0)},null,$element),eventDispatcher.on("SESSION_REMINDER.HIDE",function(){$scope.api.hideModal()},null,$element),eventDispatcher.on("SESSION_REMINDER.STOP",function(){checkIntervalTimeout&&$timeout.cancel(checkIntervalTimeout),logoutTimeout&&$timeout.cancel(logoutTimeout)},null,$element),eventDispatcher.on("SESSION_REMINDER.START",function(){$timeout($scope.api.refreshSessionData)},null,$element)}],link:function($scope,$element,$attrs){"ui-dialog"==$scope.mode?$element.html($templateCache.get("sessionReminder/sessionReminderUIDialog.tpl.html")).show():$element.html($templateCache.get("sessionReminder/sessionReminder.tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviSubPageNav",["$templateCache","$timeout","state","sviUrl","$sce",function($templateCache,$timeout,state,sviUrl,$sce){return{replace:!1,scope:{stateId:"@",tabs:"@"},template:$templateCache.get("subPageNav/subPageNav.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.required($attrs,"tabs"),svi.ng.defaultString($scope,$attrs,"stateId","current-tab");try{$scope.tabs=$attrs.tabs=JSON.parse($attrs.tabs)}catch(err){$scope.tabs=[]}if(0<$scope.tabs.length){for(var i=0,l=$scope.tabs.length;i<l;i++)$scope.tabs[i].name=$sce.getTrustedHtml($scope.tabs[i].name);var href=sviUrl.href(),hash="";angular.isString(href)&&2==(href=href.split("#")).length&&(hash=href[1].substr(1)),$scope.currentTab=hash||state.get($scope.stateId,hash),""===$scope.currentTab?($scope.currentTab=$scope.tabs[0].id,state.set($scope.stateId,$scope.currentTab)):$scope.currentTab!=$scope.tabs[0].id&&$timeout(function(){$("html,body").animate({scrollTop:$element.offset().top},0)},1e3)}$scope.selectTab=function(id,$event){$scope.currentTab=id,state.set($scope.stateId,$scope.currentTab),$($event.currentTarget).tab("show")},$element.find(".sub-pages").css({"overflow-x":"auto","overflow-y":"hidden"})}],link:function($scope,$element,$attrs){$scope.currentTab&&$timeout(function(){$element.find('a[href="#'+$scope.currentTab+'"]').tab("show")},200)}}}]),angular.module("svi.navigation").directive("sviSymbolNavigator",["eventDispatcher","sviUrl",function(eventDispatcher,sviUrl){return{replace:!1,scope:{eventId:"@",type:"@",csUrl:"@",mfUrl:"@",etfUrl:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"type",["","event","CS","MF","ETF"],""),svi.ng.defaultString($scope,$attrs,"eventId","SYMBOL.SELECTED"),svi.ng.defaultString($scope,$attrs,"csUrl",""),svi.ng.defaultString($scope,$attrs,"mfUrl",""),svi.ng.defaultString($scope,$attrs,"etfUrl","")}catch(e){throw"sviSymbolNavigator: "+e}eventDispatcher.on($scope.eventId,function(evt,data){if(angular.isObject(data)&&data.hasOwnProperty("assetType")&&data.hasOwnProperty("symbol"))if("event"==$scope.type||data.assetType==$scope.type){var output={symbol:data.symbol};switch(data.assetType){case"CS":case"ETF":output.investmentType="Stock";break;case"MF":output.investmentType="MutualFund"}eventDispatcher.trigger("SYMBOL.CONTEXT.CHANGED",output)}else if($scope.hasOwnProperty(data.assetType.toLowerCase()+"Url")){var url=$scope[data.assetType.toLowerCase()+"Url"].replace("_SYMBOL_",data.symbol);sviUrl.href(url)}},null,$element)}]}}]),angular.module("directives").directive("sviUpdateInfo",["$templateRequest","$compile","labels","$timeout","session","preferences","piwik",function($templateRequest,$compile,labels,$timeout,session,preferences,piwik){return{scope:{passwordMeter:"@",antiKeyCapture:"@",forceLogin:"@",expiredLogin:"@",forceTrading:"@",expiredTrading:"@",email:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultTrue($scope,$attrs,"passwordMeter"),svi.ng.defaultFalse($scope,$attrs,"antiKeyCapture"),svi.ng.defaultFalse($scope,$attrs,"forceLogin"),svi.ng.defaultFalse($scope,$attrs,"expiredLogin"),svi.ng.defaultFalse($scope,$attrs,"forceTrading"),svi.ng.defaultFalse($scope,$attrs,"expiredTrading"),svi.ng.defaultFalse($scope,$attrs,"email"),$scope.active=!1,$scope.panels=[],$scope.currentPanel=null,$scope.skipsRemain=0,$scope.skipAllowed=!1,$scope.input={},$scope.id=php.uniqid("updateInfo"),$scope.reloadPanels=function(){$scope.panels=[],$scope.currentPanel=null,$scope.skipAllowed=!1,$scope.forceLogin&&$scope.panels.push("forceLogin"),$scope.forceTrading&&$scope.panels.push("forceTrading"),!$scope.forceLogin&&$scope.expiredLogin&&$scope.panels.push("expiredLogin"),!$scope.forceTrading&&$scope.expiredTrading&&$scope.panels.push("expiredTrading"),$scope.email&&$scope.panels.push("email")},labels.setupLabels($scope,["general"],{}),($scope.api=this).getLoader=svi.ng.getLoaderFactory($element,$scope),this.nextPanel=function(){0<$scope.panels.length?($scope.currentPanel=$scope.panels.shift(),$scope.skipAllowed=-1==$scope.currentPanel.search(/^force/)&&0<$scope.skipsRemain):$scope.api.hideModal()},this.submit=function(){switch($scope.currentPanel){case"forceLogin":case"expiredLogin":if($scope.loginPasswordForm.$untouched||$scope.loginPasswordForm.$invalid)return $scope.api.getLoader().setError($scope.labels.invalidInput),!1;break;case"forceTrading":case"expiredTrading":if($scope.tradingPasswordForm.$untouched||$scope.tradingPasswordForm.$invalid)return $scope.api.getLoader().setError($scope.labels.invalidInput),!1;break;case"email":if($scope.emailForm.$invalid||!$scope.input.email)return $scope.api.getLoader().setError($scope.labels.invalidInput),!1;break;default:return!1}return $scope.api.getLoader().setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){var data;switch($scope.currentPanel){case"forceLogin":case"expiredLogin":return data={oldPassword:$scope.input.oldLoginPassword,password:$scope.input.loginPassword,passwordConfirm:$scope.input.loginPasswordConfirm},$scope.input.challengeAnswer&&(data.challengeAnswer=$scope.input.challengeAnswer),preferences.changePassword(data);case"forceTrading":case"expiredTrading":return data={oldPassword:$scope.input.oldTradingPassword,password:$scope.input.tradingPassword,passwordConfirm:$scope.input.tradingPasswordConfirm},$scope.input.tradingChallengeAnswer&&(data.challengeAnswer=$scope.input.tradingChallengeAnswer),preferences.changeTxnPassword(data);case"email":return data={email:$scope.input.email,emailConfirm:$scope.input.emailConfirm},$scope.input.secondaryEmail&&(data.secondaryEmail=$scope.input.secondaryEmail,data.secondaryEmailConfirm=$scope.input.secondaryEmailConfirm),preferences.changeEmail(data)}},onSuccess=function(response){piwik.trackPage("updateInfo/"+response.action,"Update Info: "+response.action,1e3*response._loaderMetadata.elapsedTime),$scope.api.nextPanel()},onError=function(response){piwik.trackPage("updateInfo/"+response.action+"/error","Error: Update Info: "+response.action,1e3*response._loaderMetadata.elapsedTime)};this.skip=function(){return!!$scope.skipAllowed&&$scope.api.getLoader().setLoadHandler(skipCallback).load().then(onSkipSuccess,onError)};var skipCallback=function(){return preferences.skip()},onSkipSuccess=function(response){piwik.trackPage("updateInfo/"+response.action,"Update Info: "+response.action,1e3*response._loaderMetadata.elapsedTime),$scope.api.hideModal()},modalInit=!1;this.showModal=function(force){if(angular.isUndefined(force)&&(force=!1),$scope.active||-1==$scope.skipsRemain&&!force)return!1;$scope.active=!0,modalInit?$element.find(".svi-update-info").modal("show"):(modalInit=!0,$element.find(".svi-update-info").modal({backdrop:"static",show:!0,keyboard:!1}),$scope.passwordMeter&&(svi.DynamicLoader.loadCSS("PWD_METER_CSS"),svi.DynamicLoader.register(["PWD_METER_JS"],function(){var e=document.createElement("style");if(e.innerHTML="#meter-container { margin: 10px auto 20px 100px; } .meterSpacing { padding-top: 0; }",e.type="text/css",document.getElementsByTagName("head")[0].appendChild(e),$element.find("#login-pwd-meter").length)new svi.PasswordMeter({id:"updateInfo-loginPassword",target:"login-pwd-meter"});if($element.find("#trading-pwd-meter").length)new svi.PasswordMeter({id:"updateInfo-tradingPassword",target:"trading-pwd-meter"})},this)))},this.hideModal=function(){$scope.active&&($scope.active=!1,$element.find(".svi-update-info").modal("hide"))}}],link:function($scope,$element,$attrs){session.getAll().then(function(response){if(response&&200==response.status&&response.hasOwnProperty("data")){var data=response.data,skips=parseInt(data.skipsRemain);if($scope.skipsRemain=isNaN(skips)||skips<-1||100<skips?0:skips,$scope.forceLogin=$scope.forceLogin||1==data.forceChange||1==data.reset,$scope.expiredLogin=$scope.expiredLogin||1==data.loginExpired,$scope.forceTrading=$scope.forceTrading||1==data.resetTrading,$scope.expiredTrading=$scope.expiredTrading||1==data.tradingExpired,$scope.email=$scope.email||1==data.emailExpired,$scope.input.email=data.emailAddress1,$scope.input.emailConfirm=data.emailAddress1,data.emailAddress2&&($scope.input.secondaryEmail=data.emailAddress2,$scope.input.secondaryEmailConfirm=data.emailAddress2),$scope.reloadPanels(),0<$scope.panels.length){$templateRequest("navigation/updateInfo/updateInfo.tpl.phtml",{}).then(function(data){$element.html(data).show(),$compile($element.contents())($scope),$scope.api.nextPanel(),$scope.api.showModal()});var addValidators=function(){var formFound=!1;$scope.loginPasswordForm&&(formFound=!0,$scope.loginPasswordForm.oldLoginPassword.$validators.different=function(modelValue,viewValue){return $scope.loginPasswordForm.loginPassword.$validate(),!0},$scope.loginPasswordForm.loginPassword.$validators.different=function(modelValue,viewValue){return(modelValue||viewValue)!=$scope.loginPasswordForm.oldLoginPassword.$viewValue},$scope.loginPasswordForm.loginPassword.$validators.matches=function(modelValue,viewValue){return $scope.loginPasswordForm.loginPasswordConfirm.$validate(),!0},$scope.loginPasswordForm.loginPasswordConfirm.$validators.matches=function(modelValue,viewValue){return(modelValue||viewValue)==$scope.loginPasswordForm.loginPassword.$viewValue}),$scope.tradingPasswordForm&&(formFound=!0,$scope.tradingPasswordForm.oldTradingPassword.$validators.different=function(modelValue,viewValue){return $scope.tradingPasswordForm.tradingPassword.$validate(),!0},$scope.tradingPasswordForm.tradingPassword.$validators.different=function(modelValue,viewValue){return(modelValue||viewValue)!=$scope.tradingPasswordForm.oldTradingPassword.$viewValue},$scope.tradingPasswordForm.tradingPassword.$validators.matches=function(modelValue,viewValue){return $scope.tradingPasswordForm.tradingPasswordConfirm.$validate(),!0},$scope.tradingPasswordForm.tradingPasswordConfirm.$validators.matches=function(modelValue,viewValue){return(modelValue||viewValue)==$scope.tradingPasswordForm.tradingPassword.$viewValue}),$scope.emailForm&&(formFound=!0,$scope.emailForm.email.$validators.matches=function(modelValue,viewValue){return $scope.emailForm.emailConfirm.$validate(),$scope.emailForm.hasOwnProperty("secondaryEmail")&&$scope.emailForm.secondaryEmail.$validate(),!0},$scope.emailForm.emailConfirm.$validators.matches=function(modelValue,viewValue){return(modelValue||viewValue)==$scope.emailForm.email.$viewValue},$scope.emailForm.hasOwnProperty("secondaryEmail")&&($scope.emailForm.secondaryEmail.$validators.different=function(modelValue,viewValue){return(modelValue||viewValue)!=$scope.emailForm.email.$viewValue},$scope.emailForm.secondaryEmail.$validators.matches=function(modelValue,viewValue){return $scope.emailForm.secondaryEmailConfirm.$validate(),!0},$scope.emailForm.secondaryEmailConfirm.$validators.matches=function(modelValue,viewValue){return(modelValue||viewValue)==$scope.emailForm.secondaryEmail.$viewValue})),formFound||$timeout(addValidators,250)};$timeout(addValidators)}}})}}}]),angular.module("directives").directive("sviWelcomeMessage",["$templateCache","piwik","session","preferences",function($templateCache,piwik,session,preferences){return{template:$templateCache.get("welcomeMessage/welcomeMessage.tpl.html"),scope:{id:"@",title:"@",message:"@",version:"@",size:"@",hideForeverBtn:"@",hideSessionBtn:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"id",php.uniqid("welcomeMessage")),svi.ng.defaultString($scope,$attrs,"title","Welcome"),svi.ng.defaultString($scope,$attrs,"message",""),svi.ng.defaultInt($scope,$attrs,"version",1,null,1),svi.ng.defaultValidString($scope,$attrs,"size",["sm","md","lg"],"md"),svi.ng.defaultString($scope,$attrs,"hideForeverBtn","Do not show again"),svi.ng.defaultString($scope,$attrs,"hideSessionBtn","Ok"),$scope.active=!1,($scope.api=this).showModal=function(){$scope.message&&(piwik.trackPage("welcomeMessage",$scope.title),$scope.active=!0,$element.find(".svi-welcome-message").modal("show"))},this.hideModal=function(){$scope.active&&($element.find(".svi-welcome-message").modal("hide"),$scope.active=!1)},this.hideSession=function(){$scope.id&&session.set("welcomeMessage-"+$scope.id,$scope.version),$scope.api.hideModal()},this.hideForever=function(){$scope.id&&(session.set("welcomeMessage-"+$scope.id,$scope.version),preferences.set(["welcomeMessages",$scope.id],$scope.version)),$scope.api.hideModal()}}],link:function($scope,$element,$attrs){if($scope.id){var processPreferencesResponse=function(response){if(response&&200==response.status&&response.hasOwnProperty("data")&&response.data&&response.data.hasOwnProperty("resource")){var value=response.data.resource;session.set("welcomeMessage-"+$scope.id,value),("N"==value||value<$scope.version)&&$scope.api.showModal()}else session.set("welcomeMessage-"+$scope.id,"N"),preferences.set(["welcomeMessages",$scope.id],"N"),$scope.api.showModal()};session.get("welcomeMessage-"+$scope.id).then(function(response){if(response&&200==response.status&&response.hasOwnProperty("data")){var data=response.data;data&&data.hasOwnProperty("welcomeMessage-"+$scope.id)&&null!=data["welcomeMessage-"+$scope.id]?("N"==data["welcomeMessage-"+$scope.id]||data["welcomeMessage-"+$scope.id]<$scope.version)&&$scope.api.showModal():preferences.get(["welcomeMessages",$scope.id]).then(processPreferencesResponse,processPreferencesResponse)}})}}}}]),angular.module("directives").directive("sviOrderStatusContainer",["$templateCache","$compile","$timeout","orders","accountList","eventDispatcher","actionMenu","state","labels","tags","$log","sviUrl","piwik",function($templateCache,$compile,$timeout,orders,accountList,eventDispatcher,actionMenu,state,labels,tags,$log,sviUrl,piwik){return{replace:!1,scope:{template:"@",account:"@",bucketView:"@",columns:"@",columnPriority:"@",responsiveColumns:"@",pageSize:"@",showPaging:"@",sortable:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultFalse($scope,$attrs,"bucketView"),svi.ng.defaultString($scope,$attrs,"columns",'["orderID","securityType","action","originalQty","remainingQty","desc","symbol","price","duration","instructions","originDateTime","orderStatus","executedQty","executedPrice","actionMenu"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["orderID","symbol","orderStatus","securityType","action","originalQty","remainingQty","desc","price","duration","instructions","originDateTime","executedQty","executedPrice","actionMenu"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),svi.ng.defaultTrue($scope,$attrs,"showPaging"),svi.ng.defaultTrue($scope,$attrs,"sortable"),$scope.bucketView?$scope.pageSize=$attrs.pageSize=0:svi.ng.defaultInt($scope,$attrs,"pageSize",0)}catch(e){throw"sviOrderStatusContainer: "+e}var securityType,status,orderType;$scope.sortDir=state.get("orderStatus-sortDir","desc"),$scope.sortField=state.get("orderStatus-sortField","originDateTime"),$scope.currentPage=0,$scope.pageSize&&($scope.currentPage=state.get("orderStatus-pageNum",1)),$scope.totalPages=0,$scope.pageCacheID="",$scope.refocus=null,labels.setupLabels($scope,["general","orderStatus"],{}),$scope.initComplete=!1,$scope.orderStatus=!1;try{(securityType=state.get("orderStatus-securityType"))||(securityType=[])}catch(e){securityType=[]}try{(status=state.get("orderStatus-orderStatus"))||(status=[])}catch(e){status=[]}try{(orderType=state.get("orderStatus-orderType"))||(orderType=[])}catch(e){orderType=[]}$scope.filters={securityType:securityType,orderStatus:status,orderType:orderType};try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.warn("sviOrderStatusContainer: ",e),$scope.columns=$attrs.columns=[]}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviOrderStatusContainer: Error parsing columnPriority: ",e,$attrs.columnPriority)}$scope.$watch("sortField",function(val){state.set("orderStatus-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("orderStatus-sortDir",val).save()}),$scope.$watch("currentPage",function(val){state.set("orderStatus-pageNum",val).save()}),$scope.$watch("filters.securityType",function(val){state.set("orderStatus-securityType",val).save()}),$scope.$watch("filters.orderStatus",function(val){state.set("orderStatus-orderStatus",val).save()}),$scope.$watch("filters.orderType",function(val){state.set("orderStatus-orderType",val).save()}),$scope.getLoadParameters=function(){var i,data={sortField:$scope.sortField,sortDir:$scope.sortDir};$scope.pageSize&&(data.pageSize=$scope.pageSize,data.pageNum=$scope.currentPage,data.pageCacheID=$scope.pageCacheID);var len=$scope.filters.securityType.length,filterCount=0;if(len){for(0===filterCount&&(data.filterField=[],data.filterValue=[]),data.filterField.push("order.instrument.securityType"),data.filterValue.push([]),i=0;i<len;i++)data.filterValue[filterCount].push($scope.filters.securityType[i].value);filterCount++}if(len=$scope.filters.orderStatus.length){for(0===filterCount&&(data.filterField=[],data.filterValue=[]),data.filterField.push("orderStatus"),data.filterValue.push([]),i=0;i<len;i++)data.filterValue[filterCount].push($scope.filters.orderStatus[i].value);filterCount++}if(len=$scope.filters.orderType.length){for(0===filterCount&&(data.filterField=[],data.filterValue=[]),data.filterField.push("order.orderType"),data.filterValue.push([]),i=0;i<len;i++)data.filterValue[filterCount].push($scope.filters.orderType[i].value);filterCount++}return data},this.getLoader=svi.ng.getLoaderFactory($element,$scope,"loader"),this.load=function(invalidateCache){if($scope.initComplete){angular.isUndefined(invalidateCache)&&(invalidateCache=!1);var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError):$timeout($scope.api.load,200)}};var loadCallback=function(invalidateCache){"Widget"!=$scope.template&&$("html,body").animate({scrollTop:0},0);var data=$scope.getLoadParameters();return orders.getAccountOrders($scope.account,data,invalidateCache)},onSuccess=function(response){piwik.trackPage("orderStatusContainer","Order Status Container",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.orderStatus=response.orders,$scope.currentPage=$scope.orderStatus.pageNum,$scope.totalPages=$scope.orderStatus.pageCount,$scope.pageCacheID=$scope.orderStatus.pageCacheID,$scope.orderStatus.orderStatus.length?($scope.orderStatus.symbolList&&tags.getBySymbol($scope.orderStatus.symbolList).success(function(response){if(response.success){tags.ignoreUpdates(!0);var symbol="";for(i=0,l=$scope.orderStatus.orderStatus.length;i<l;i++)try{symbol=$scope.orderStatus.orderStatus[i].order.instrument.symbol,$scope.orderStatus.orderStatus[i].tags=response.tags[symbol]}catch(e){$scope.orderStatus.orderStatus[i].tags=[]}$timeout(function(){tags.ignoreUpdates(!1)})}}),$timeout(function(){svi.ui.pulse(".orderStatus-grid, .orderStatus-grid tr"),$scope.refocus&&$timeout(function(){$element.find($scope.refocus).focus(),$scope.refocus=null},250)})):$scope.api.getLoader().setMessage($scope.labels.noOrderStatusData)},onError=function(reason){piwik.trackPage("orderStatusContainer/error","Error: Order Status Container",!1,[{name:"numAccounts",index:1,value:1}])};this.more=function(){sviUrl.href(["accountOrders",{action:"default"}])},$scope.api=this,$timeout(function(){$scope.initComplete=!0,!$scope.orderStatus&&$scope.api&&$scope.api.load()},400),eventDispatcher.on("ORDER_STATUS.ACTION.ZOOM",function(e,data){e&&actionMenu.startHoldingZoom(data)},!0),eventDispatcher.on("ORDER_STATUS.ACTION.TRADE",function(e,data){actionMenu.startTradeWidget(data)},!0),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.orderStatus=!1,$scope.pageSize&&($scope.currentPage=1),$scope.api&&$scope.api.load())},!0),eventDispatcher.on("ORDER_STATUS.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.refocus='.svi-column-header[data-event="ORDER_STATUS.'+data.field+'"]',$scope.api&&$scope.api.load())},!0),eventDispatcher.on("ORDER_STATUS.PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.currentPage=data,$scope.api&&$scope.api.load())},!0),eventDispatcher.on("ORDER_STATUS.SECURITY_TYPE.FILTER.CHANGED",function(e,data){if(!data||0===data.length)return 0===$scope.filters.securityType.length?void 0:($scope.filters.securityType=[],void($scope.api&&$scope.api.load()));if($scope.filters.securityType!==data){if($scope.filters.securityType.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.filters.securityType[i].value!==data[i].value){same=!1;break}if(same)return}$scope.filters.securityType=data,$scope.pageSize&&($scope.currentPage=1),$scope.api&&$scope.api.load()}},!0),eventDispatcher.on("ORDER_STATUS.ORDER_STATUS.FILTER.CHANGED",function(e,data){if(!data||0===data.length)return 0===$scope.filters.orderStatus.length?void 0:($scope.filters.orderStatus=[],void($scope.api&&$scope.api.load()));if($scope.filters.orderStatus!==data){if($scope.filters.orderStatus.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.filters.orderStatus[i].value!==data[i].value){same=!1;break}if(same)return}$scope.filters.orderStatus=data,$scope.pageSize&&($scope.currentPage=1),$scope.api&&$scope.api.load()}},!0),eventDispatcher.on("ORDER_STATUS.ORDER_TYPE.FILTER.CHANGED",function(e,data){if(!data||0===data.length)return 0===$scope.filters.orderType.length?void 0:($scope.filters.orderType=[],void($scope.api&&$scope.api.load()));if($scope.filters.orderType!==data){if($scope.filters.orderType.length===data.length){for(var same=!0,i=0,l=data.length;i<l;i++)if($scope.filters.orderType[i].value!==data[i].value){same=!1;break}if(same)return}$scope.filters.orderType=data,$scope.pageSize&&($scope.currentPage=1),$scope.api&&$scope.api.load()}},!0),eventDispatcher.on("ORDER_STATUS.REFRESH",function(){$scope.api&&$scope.api.load(!0)}),eventDispatcher.on("ORDER_STATUS.EXPORT",function(){var data=$scope.getLoadParameters();data.columns=JSON.stringify($scope.columns),orders.exportAccountOrderStatus($scope.account,data)})}],link:function($scope,$element,$attrs){$element.html($templateCache.get("orderStatusContainer/orderStatusContainer"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviOrderStatusGrid",["$templateRequest","$compile","labels","floatThead",function($templateRequest,$compile,labels,floatThead){return{replace:!1,scope:{template:"@",title:"@",statusType:"@",columns:"=",columnPriority:"=",responsiveColumns:"@",orderStatus:"=",sortField:"=?",sortDir:"=?",sortable:"="},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{if(svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultString($scope,$attrs,"statusType",""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),$scope.statusType){var index=$scope.columns.indexOf("orderStatus");-1!=index&&$scope.columns.splice(index,1)}}catch(e){throw"sviOrderStatusGrid: "+e}labels.setupLabels($scope,["assetTypes","orderStatus","orderStatusTypes"],{}),$scope.calculateTotals=function(){if($scope.totals={},$scope.totals.marketValueChange=0,$scope.totals.marketValue=0,$scope.totals.gainLoss=0,$scope.orderStatus)for(var i=0,l=$scope.orderStatus.orderStatus.length;i<l;i++)$scope.statusType&&$scope.statusType!=$scope.orderStatus.orderStatus[i].ordersStatus||($scope.totals.marketValueChange+=$scope.orderStatus.orderStatus[i].marketValueChange,$scope.totals.marketValue+=$scope.orderStatus.orderStatus[i].marketValue,$scope.totals.gainLoss+=$scope.orderStatus.orderStatus[i].gainLoss)},$scope.calculateTotals(),$scope.$watch("orderStatus",$scope.calculateTotals,!0),floatThead.init($scope,$element),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{actionMenu:!1},breakpoints:{xs:3,sm:8,md:12}}}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("orderStatus/orderStatusGrid/orderStatusGrid"+$scope.template+".tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviPaLoan",["$templateCache","$timeout","paLoans","accountList","eventDispatcher","labels","piwik",function($templateCache,$timeout,paLoans,accountList,eventDispatcher,labels,piwik){return{replace:!1,scope:{account:"@",loan:"@",showOriginalLoanAmount:"@"},template:$templateCache.get("paLoan/paLoan.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"loan",""),$scope.initComplete=!1,$scope.loans=!1,$scope.loanAccounts=!1,$scope.selectedLoan=!1,labels.setupLabels($scope,["paLoan"],{}),svi.ng.defaultTrue($scope,$attrs,"showOriginalLoanAmount"),$scope.setLoader=function(loader){$scope.loader=loader}}],link:function($scope,$element,$attrs){var load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout(load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}},loadCallback=function(invalidateCache){return $("html,body").animate({scrollTop:0},0),paLoans.getPaLoans($scope.account,!1,invalidateCache)},onSuccess=function(response){if(piwik.trackPage("paLoan","PA Loan",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),$scope.selectedLoan=!1,$scope.loans=response.loans.loans,$scope.loans.length){var nickname;$scope.loanAccounts={};for(var i=0,l=$scope.loans.length;i<l;i++)nickname="",$scope.loans[i].firstName&&(nickname+=" - "+$scope.loans[i].firstName),$scope.loans[i].lastName&&(0<nickname.length?nickname+=" "+$scope.loans[i].lastName:nickname+=" - "+$scope.loans[i].lastName),($scope.loans[i].coFirstName||$scope.loans[i].coLastName)&&(0<nickname.length?nickname+=", ":nickname+=" - ",$scope.loans[i].coFirstName&&(nickname+=$scope.loans[i].coFirstName),$scope.loans[i].coLastName&&(nickname+=" "+$scope.loans[i].coLastName)),$scope.loanAccounts[$scope.loans[i].loanAcctNo]={index:i,label:$scope.loans[i].loanAcctNo+nickname};$scope.loan&&$scope.loanAccounts.hasOwnProperty($scope.loan)&&($scope.selectedLoan=$scope.loans[$scope.loanAccounts[$scope.loan].index]),$scope.selectedLoan||($scope.selectedLoan=$scope.loans[0],$scope.loan=$scope.selectedLoan.loanAcctNo)}else $scope.loader.setMessage($scope.labels.noPALoanData)},onError=function(reason){piwik.trackPage("paLoan/error","Error: PA Loan",!1,[{name:"numAccounts",index:1,value:1}])};$scope.$watch("loan",function(value,oldValue){$scope.selectedLoan&&$scope.selectedLoan.loanAcctNo==value||!$scope.loanAccounts.hasOwnProperty(value)||($scope.selectedLoan=$scope.loans[$scope.loanAccounts[value].index])}),$scope.onLoanSelect=function(e){if("A"===e.target.nodeName){var loan=$(e.target).attr("data-loan-key");angular.isDefined(loan)&&($scope.loan=loan)}},$timeout(function(){$scope.initComplete=!0,$scope.loans||load()},400),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.loans=!1,load())},!0),eventDispatcher.on("PALOAN.REFRESH",function(){load(!0)})}}}]),angular.module("directives").directive("sviPaLoanSummary",["$templateCache","$timeout","accountList","labels","paLoanSummary","piwik",function($templateCache,$timeout,accountList,labels,paLoanSummary,piwik){return{replace:!1,scope:{accounts:"@",switchAccounts:"@",paLoanUrl:"@"},template:$templateCache.get("paLoanSummary/paLoanSummary.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"accounts","all"),svi.ng.defaultFalse($scope,$attrs,"switchAccounts"),svi.ng.defaultString($scope,$attrs,"paLoanUrl",""),$scope.paSummary=0,$scope.pledgeAcctLoans=null,labels.setupLabels($scope,["paLoanSummary"],{}),labels.loadScreenText($scope,"disclaimerWithLoans","DASHBOARD","PA_LOAN_DISCLOSURE"),labels.loadScreenText($scope,"disclaimerNoLoans","DASHBOARD","NO_PA_LOAN_DISCLOSURE"),$scope.onClick=function(data){var accountIndex=accountList.getAccountIndex(data.defaultAccount),loanAcctNo=data.pledgeAccountLoan[0].loanAcctNo;$scope.paLoanUrl="/Web/account/"+accountIndex+"/paLoan/default/"+loanAcctNo},$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)};var loadCallback=function(invalidateCache){var data={switchAccounts:$scope.switchAccounts?"Y":"N"};return paLoanSummary.getPaLoanSummary($scope.accounts,data,invalidateCache)},onSuccess=function(response){piwik.trackPage("paLoanSummary","PA Loan Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:"all"==$scope.accounts?"all":angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.paSummary=response.paSummary.paSummary;var pledgeAcctLoansList=$scope.paSummary.pledgeAccountLoanDetails;if(pledgeAcctLoansList.length){for(var pledgeAccountList,investmentAccts,coName,i=0;i<pledgeAcctLoansList.length;i++){pledgeAcctLoansList[i].pledgeAccountLoan[0].firstName&&(pledgeAcctLoansList[i].pledgeAccountLoan[0].name=pledgeAcctLoansList[i].pledgeAccountLoan[0].firstName,pledgeAcctLoansList[i].pledgeAccountLoan[0].lastName&&(pledgeAcctLoansList[i].pledgeAccountLoan[0].name+=" "+pledgeAcctLoansList[i].pledgeAccountLoan[0].lastName)),pledgeAcctLoansList[i].pledgeAccountLoan[0].coFirstName&&(coName=pledgeAcctLoansList[i].pledgeAccountLoan[0].coFirstName,pledgeAcctLoansList[i].pledgeAccountLoan[0].coLastName&&(coName+=" "+pledgeAcctLoansList[i].pledgeAccountLoan[0].coLastName),pledgeAcctLoansList[i].pledgeAccountLoan[0].name+=", "+coName),pledgeAccountList=pledgeAcctLoansList[i].acctInfo,pledgeAcctLoansList[i].defaultAccount=pledgeAccountList[0].account,investmentAccts=pledgeAcctLoansList[i].defaultAccount;for(var j=1;j<pledgeAccountList.length;j++)investmentAccts+=", "+pledgeAccountList[j].account;pledgeAcctLoansList[i].pledgeAccountLoan[0].invAcctNo=investmentAccts}$scope.pledgeAcctLoans=pledgeAcctLoansList}else $scope.loader.setMessage($scope.labels.noPALoanSummaryData)},onError=function(response){piwik.trackPage("paLoanSummary/error","Error: PA Loan Summary",!1,[{name:"numAccounts",index:1,value:"all"==$scope.accounts?"all":angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.loader.setError($scope.labels.dataRenderError)};$timeout(function(){$scope.load()},300)}]}}]),angular.module("directives").directive("sviHistoricalAllocationChart",["$tooltip","bsBreakpoint","$timeout","$templateCache","accountList","Colors","highcharts","labels","$filter","dateRange","eventDispatcher","sqopeHoldings","performance","risk","pieDataParser","ColorMapper","piwik",function($tooltip,bsBreakpoint,$timeout,$templateCache,accountList,Colors,highcharts,labels,$filter,dateRange,eventDispatcher,sqopeHoldings,performance,risk,pieDataParser,ColorMapper,piwik){return{restrict:"A",template:$templateCache.get("historicalAllocationChart/historicalAllocationChart.tpl.html"),scope:{type:"@",asof:"@",range:"="},controller:["$scope","$attrs",function($scope,$attrs){try{svi.ng.required($attrs,"type"),svi.ng.required($attrs,"range")}catch(e){throw"sviHistoricalAllocationChart: "+e}$scope.accounts=accountList.getCurrentAccountIndexList(),$scope.id=php.uniqid("historicalAllocationChart"),$scope.initComplete=!1}],link:function($scope,elem){$scope.setLoader=function(loader){$scope.loader=loader},$scope.filteredHoldings=null;var loadCallback=function(){if($scope.filteredHoldings)return"RISK"===$scope.type?risk.getAggregateRisk("BETA",$scope.filteredHoldings):"PERFORMANCE"===$scope.type?performance.getPerformanceSummary($scope.accounts,null,"CUMULATIVE",$scope.filteredHoldings):void 0;var rangeObj=dateRange.getRange($scope.range);return sqopeHoldings.getSqopeHoldings($scope.accounts,rangeObj,"BETA",$scope.asof)},onSuccess=function(response){var pieData=null;if(piwik.trackPage("historicalAllocationChart","Historical Allocation Chart",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.filteredHoldings)switch($scope.type){case"RISK":pieData=pieDataParser.parseRisk($scope.filteredHoldings,{riskMeasure:"BETA",min:0,minLow:.2,maxLow:.75,minHigh:1.3,maxHigh:1.85,max:5},response.aggregateRisk),$scope.render(pieData);break;case"PERFORMANCE":var performanceSummary=response.performanceSummary;pieData=pieDataParser.parsePerformance($scope.filteredHoldings);var performance=performanceSummary[dateRange.getRange($scope.range).propertyName];pieData.text=$filter("percent")(performance.twrr),pieData.twr=performance.twrr,pieData.mwr=performance.mwr,$scope.render(pieData)}else switch($scope.filteredHoldings=response.sqopeHoldings.sqopeHoldings.filter(function(sqopeHolding){return 0<sqopeHolding.quantity}),$scope.type){case"RISK":case"PERFORMANCE":$scope.load();break;case"SECTOR":pieData=pieDataParser.parseSector($scope.filteredHoldings,ColorMapper.createSectorMapper($scope.filteredHoldings)),$scope.render(pieData);break;case"ASSET_TYPE":pieData=pieDataParser.parseType($scope.filteredHoldings),$scope.render(pieData)}},onError=function(err){$scope.loader.labels.newLoadWhileInProgress!==err.message&&($scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("historicalAllocationChart/error","Error: Historical Allocation Chart",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]))};$scope.load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}};var myPop,chartSettings={chart:{type:"pie",height:300,renderTo:elem.find(".svi-historical-allocation-chart")[0]},title:{text:"RISK"===$scope.type?"Total Beta:":"Total:",align:"center",verticalAlign:"middle",y:-8,style:{fontSize:13,color:Colors.colorMap["pr-dark-grey-2"]}},subtitle:{text:null,align:"center",verticalAlign:"middle",y:6,style:{fontSize:13,fontWeight:"bold",color:Colors.colorMap["pr-dark-grey-2"]}},accessibility:{landmarkVerbosity:"disabled"},credits:{enabled:!1},exporting:{enabled:!1},legend:{enabled:!1},plotOptions:{pie:{borderWidth:1}},series:[{name:"",size:"100%",innerSize:"50%",dataLabels:{color:"white",distance:-30,style:{width:10}}}]},chart=highcharts.getChart(chartSettings);$scope.render=function(pieData){chart.setTitle({},{text:pieData.text}),chart.series[0].update({name:pieData.name},!1),chart.tooltip.options.formatter=pieData.settings.tooltip.formatter,highcharts.replaceSeries(chart,[pieData.data]),pieData.mwr&&!bsBreakpoint.isMobile()&&elem.find(".highcharts-subtitle").on("mouseover",function(){myPop||$timeout(function(){$scope.twr=pieData.twr,$scope.mwr=pieData.mwr,myPop=$tooltip(elem.find(".highcharts-subtitle"),{animation:"",scope:$scope,placement:"right",template:$templateCache.get("shared/returnList/returnListPopup.tpl.html"),trigger:"hover",show:!0,delay:{show:1e3},container:"body"})},1e3)}),chart.reflow()},labels.setupLabels($scope,["general"]),$scope.$on("$destroy",function(){myPop&&myPop.destroy()}),$scope.$watchGroup(["accounts","range"],function(newValue,oldValue){$scope.accounts&&0!==$scope.accounts.length&&$scope.range&&(angular.equals(newValue,oldValue)||($scope.filteredHoldings=null,$scope.load()))}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data&&data.hasOwnProperty("currentAccount")&&($scope.accounts=data.currentAccount.map(function(acct){return String(acct)}))},!1,elem),$timeout(function(){$scope.initComplete=!0,$scope.load()},100)}}}]),angular.module("directives").directive("sviHistoricalAllocationChartContainer",["APP_CONFIG","$templateCache","dateRange","eventDispatcher","widget","labels","$timeout","$compile",function(APP_CONFIG,$templateCache,dateRange,eventDispatcher,widget,labels,$timeout,$compile){return{replace:!1,scope:{range:"@",template:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.api=this;try{svi.ng.defaultString($scope,$attrs,"range","YTD"),svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],"")}catch(e){throw"sviHistoricalAllocationChartContainer: "+e}var getTabCtrl=svi.ng.getControllerFactory($element,$scope,"svi-tabs");labels.setupLabels($scope,["general","historicalAllocationChartContainer"]).then(function(){var tabs=getTabCtrl();tabs&&$timeout(tabs.updateTabs)});var ranges=[];dateRange.getAllRanges().forEach(function(r){dateRange.isCustom(r)||ranges.push({value:r.periodName,display:r.displayName})}),$scope.rangeDropdown=JSON.stringify(ranges),$scope.launchInvestments=function(){svi.sqope.launch("investments")},widget.attach($scope,$element)}],link:function($scope,elem){eventDispatcher.on("HISTORICAL_ALLOCATION_CHART_CONTAINER.RANGE.FILTER.CHANGED",function(e,data){data&&data.hasOwnProperty("value")&&($scope.range=data.value)},!0);var template=$templateCache.get("historicalAllocationChartContainer/historicalAllocationChartContainer"+$scope.template+".tpl.html");elem.html(template).show(),$compile(elem.contents())($scope)}}}]),angular.module("directives").directive("sviHistoricalPerformanceChartReport",["APP_CONFIG","$templateCache","$timeout","labels","widget",function(APP_CONFIG,$templateCache,$timeout,labels,widget){return{replace:!1,scope:{benchmark:"@",benchmarks:"@"},template:$templateCache.get("historicalPerformanceChartReport/historicalPerformanceChartReport.tpl.html"),controller:["$scope","$element",function($scope,$element){($scope.api=this).name="historicalPerformanceChartReport",this.friendlyName="Historical Performance Chart Report",$timeout(function(){labels.setupLabels($scope,["general","historicalPerformanceChartReport"]),widget.attach($scope,$element)},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("directives").directive("sviPerformanceChart",["$log","$templateCache","$timeout","$filter","accountList","performance","highcharts","eventDispatcher","dateRange","queryTypes","collections","piwik","labels",function($log,$templateCache,$timeout,$filter,accountList,performance,highcharts,eventDispatcher,dateRange,queryTypes,collections,piwik,labels){return{restrict:"A",scope:{benchmarks:"@",benchmark:"@",range:"@"},template:$templateCache.get("performanceChart/performanceChart.tpl.html"),replace:!0,controller:["$scope","$attrs",function($scope,$attrs){try{svi.ng.defaultString($scope,$attrs,"benchmark","SPX"),svi.ng.defaultString($scope,$attrs,"benchmarks","[]"),svi.ng.defaultString($scope,$attrs,"range","YTD")}catch(e){throw"performanceChart: "+e}$scope.accounts=accountList.getCurrentAccountIndexList(),$scope.id=php.uniqid("performanceChart");try{$attrs.benchmarks=JSON.parse($attrs.benchmarks)}catch(e){$log.error("performanceChart: Error parsing benchmarks",e,$attrs.benchmarks),$attrs.benchmarks=[]}$scope.benchmarks=$attrs.benchmarks,$scope.initComplete=!1}],link:function($scope,elem){$scope.nav=null,$scope.period=null;var ranges=[];dateRange.getAllRanges().forEach(function(r){dateRange.isCustom(r)||ranges.push({value:r.periodName,display:r.displayName})}),$scope.rangeDropdown=JSON.stringify(ranges),$scope.loaded=!1,labels.setupLabels($scope,["general"]),$scope.benchmarkDropdown=JSON.stringify($scope.benchmarks);var chartSettings={chart:{renderTo:elem.find(".svi-performance_chart")[0],type:"line",background:"white",borderRadius:0,zoomType:"x",marginRight:40},title:{text:null},accessibility:{landmarkVerbosity:"disabled",description:"Chart showing performance of portfolio versus benchmark"},navigator:{enabled:!1},scrollbar:{enabled:!1},rangeSelector:{enabled:!1},credits:{enabled:!1},legend:{enabled:!1,align:"right",verticalAlign:"top",floating:!0,layout:"horizontal",borderWidth:0},tooltip:{shared:!0,split:!0,crosshairs:!0,shape:"square",formatter:function(){var s="<b>"+$filter("sviDate")(new Date(this.x),"MM/dd/yyyy")+"</b>";return this.points.forEach(function(point){s+="<br/>"+point.series.name+": "+(100*point.y).toFixed(2)+"%"}),s}},plotOptions:{column:{pointPadding:0,groupPadding:.2}},xAxis:{type:"datetime",gridLineWidth:1,tickmarkPlacement:"between"},yAxis:{title:{text:null},labels:{align:"right",x:30,formatter:function(){return(100*this.value).toFixed(0)+"%"}},offset:0,lineWidth:1,gridLineWidth:0,tickLength:10,tickWidth:1,tickPosition:"outside",tickPixelInterval:36},series:[{color:"black",name:"Account",marker:{enabled:!1}},{color:"red",name:"Benchmark",marker:{enabled:!1}}]},chart=highcharts.getChart(chartSettings,!0);$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout($scope.load,200);$scope.nav&&$scope.period&&(chart.series[0].setData(null,!1),chart.series[1].setData(null,!1),$scope.loaded=!1,chart.zoomOut()),$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}};var loadCallback=function(invalidateCache){if($scope.nav){if($scope.period){var rangeObj=dateRange.getRange($scope.range),fullRangeObj=dateRange.getFullRange(rangeObj,$scope.nav.performanceSummary,$scope.period.performanceSummary);return performance.getHistoricalSummary($scope.accounts,fullRangeObj,queryTypes.CUMULATIVE,$scope.benchmark,!1,!1,null,null,null,null,invalidateCache)}return performance.getPerformanceSummary($scope.accounts,null,queryTypes.PERIOD,null,!1,!1,!1,invalidateCache)}return performance.getPerformanceSummary($scope.accounts,null,queryTypes.NAV,null,!1,!1,!1,invalidateCache)},toPercentage=function(v){return v/100},onSuccess=function(response){if($scope.nav)if($scope.period){piwik.trackPage("performanceChart","Performance Chart",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]);var historicalSummary=response.historicalSummary,aggregatedReturn=historicalSummary.values.find(function(element){return"AGGREGATED RETURN"===element.name});aggregatedReturn=aggregatedReturn.data.map(toPercentage);var dates=historicalSummary.dates;dates=dates.map(function(d){return new Date(d).getTime()});var ror=collections.zip(dates,aggregatedReturn),benchmarkReturn=historicalSummary.values.find(function(element){return element.name===$scope.benchmark});benchmarkReturn=benchmarkReturn.data.map(toPercentage);var benchmarkSeries=null;"NB"!==$scope.benchmark&&(benchmarkSeries=collections.zip(dates,benchmarkReturn)),highcharts.replaceSeries(chart,[ror,benchmarkSeries],!1),$scope.loaded=!0,chart.zoomOut(),chart.reflow()}else $scope.period=response,$scope.load();else $scope.nav=response,$scope.load()},onError=function(error){$log.error(error),$scope.loader.setError($scope.labels.dataRenderError),$scope.loaded=!1,piwik.trackPage("performanceChart/error","Error: Performance Chart",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}])};$scope.$watchGroup(["benchmark","accounts","range"],function(newValue,oldValue){$scope.accounts&&0!==$scope.accounts.length&&$scope.benchmark&&$scope.range&&(angular.equals(newValue,oldValue)||$scope.load())}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data&&data.hasOwnProperty("currentAccount")&&($scope.accounts=data.currentAccount.map(function(acct){return String(acct)}))},!1,elem),eventDispatcher.on("PERFORMANCE_CHART.RANGE.FILTER.CHANGED",function(e,data){data&&data.hasOwnProperty("value")&&($scope.range=data.value)},!0),eventDispatcher.on("PERFORMANCE_CHART.BENCHMARK.FILTER.CHANGED",function(e,data){data&&data.hasOwnProperty("value")&&($scope.benchmark=data.value)},!0),$timeout(function(){$scope.initComplete=!0,$scope.load()},100)}}}]),angular.module("directives").directive("sviPeriodReport",["APP_CONFIG","$templateCache","$timeout","accountList","labels","performance","eventDispatcher","dateRange","piwik",function(APP_CONFIG,$templateCache,$timeout,accountList,labels,performance,eventDispatcher,dateRange,piwik){return{restrict:"A",scope:{range:"@"},template:$templateCache.get("periodReport/periodReport.tpl.html"),replace:!0,controller:["$scope","$attrs","$element",function($scope,$attrs,$element){svi.ng.defaultString($scope,$attrs,"range","YTD"),$scope.accounts=accountList.getCurrentAccountIndexList(),labels.setupLabels($scope,["general","periodReport"],{beginningPositionValue:"Beginning Position Value",endingPositionValue:"Ending Position Value",positionValueChange:"Position Value Change",positionInOutflows:"Position In/Outflows",interest:"Interest",dividends:"Dividends"}),$scope.initComplete=!1,$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}};var loadCallback=function(invalidateCache){delete $scope.endingMarketValue,delete $scope.beginningMarketValue,delete $scope.dnw,delete $scope.dividends,delete $scope.interest,delete $scope.mvd;var rangeObj=dateRange.getRange($scope.range);return performance.getPeriodReport($scope.accounts,rangeObj,invalidateCache)},onSuccess=function(report){piwik.trackPage("periodReport","Period Report",1e3*report._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]),report=report.historicalSummary,$scope.endingMarketValue=report.endingMarketValue,$scope.beginningMarketValue=report.beginningMarketValue,$scope.dnw=report.deposits-report.withdrawals,$scope.dividends=report.dividends,$scope.interest=report.interest,$scope.mvd=report.pnl},onError=function(err){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("periodReport/error","Error: Period Report",!1,[{name:"numAccounts",index:1,value:1}])};$scope.$watchGroup(["accounts","range"],function(newValue,oldValue){$scope.accounts&&0!==$scope.accounts.length&&$scope.range&&(angular.equals(newValue,oldValue)||($scope.filteredHoldings=null,$scope.load()))}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data&&data.hasOwnProperty("currentAccount")&&($scope.accounts=data.currentAccount.map(function(acct){return String(acct)}))},!1,$element),eventDispatcher.on("PERFORMANCE_CHART.RANGE.FILTER.CHANGED",function(e,data){data&&data.hasOwnProperty("value")&&($scope.range=data.value)},!0),$timeout(function(){$scope.initComplete=!0,$scope.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("directives").directive("sviPortfolioSummary",["$templateCache","eventDispatcher","APP_CONFIG","$timeout","totalPortfolioMovers","accountList","labels","piwik","state","$log","$compile",function($templateCache,eventDispatcher,APP_CONFIG,$timeout,totalPortfolioMovers,accountList,labels,piwik,state,$log,$compile){return{replace:!1,scope:{showReturnSince:"@",template:"@",allAccountsSelectText:"@",buttonConfiguration:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){if(svi.ng.defaultFalse($scope,$attrs,"showReturnSince"),svi.ng.defaultValidString($scope,$attrs,"template",["","Top"],""),svi.ng.defaultString($scope,$attrs,"allAccountsSelectText","All Accounts"),APP_CONFIG.accountClasses&&($scope.accountClasses=APP_CONFIG.accountClasses),$attrs.buttonConfiguration){try{$attrs.buttonConfiguration=JSON.parse($attrs.buttonConfiguration)}catch(e){$log.error("sviPortfolioSummary: Error parsing buttonConfiguration",e,$attrs.buttonConfiguration),$attrs.buttonConfiguration={}}$scope.buttonConfiguration=$attrs.buttonConfiguration}else $scope.buttonConfiguration=null;$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.accountData=$scope.$parent.accountData,$scope.productId=!1,$scope.loaded=!1,$scope.marketValue=0,$scope.marketValueChange=0,$scope.percentChange=0,$scope.cash=0,labels.setupLabels($scope,["general","portfolioSummary"],{portfolioSummaryTotalPortfolioValue:"Total Portfolio Value",portfolioSummaryDayChange:"Day Change",portfolioSummaryCash:"Cash"}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(options){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){var sortDir=state.get("acctSummary-sortDir","asc"),data={sortField:state.get("acctSummary-sortField","account"),sortDir:sortDir};return!1!==$scope.productId&&(data.productId=null!==$scope.productId?$scope.productId:"NULL"),totalPortfolioMovers.getAllAccountsSummary($scope.accounts,data)},onSuccess=function(response){piwik.trackPage("portfolioSummary","Portfolio Summary",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.isDowntick=!1,$scope.marketValue=response.totalPortfolioMovers.marketValue,$scope.marketValueChange=response.totalPortfolioMovers.marketValueChange,$scope.percentChange=response.totalPortfolioMovers.percentChange,$scope.cash=response.totalPortfolioMovers.cash,$scope.marketValueChange<0&&($scope.isDowntick=!0),$scope.loaded=!0},onError=function(response){piwik.trackPage("portfolioSummary/error","Error: Portfolio Summary",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.loader.setError($scope.labels.dataRenderError)};$timeout(function(){$scope.load()},300),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,data.hasOwnProperty("productId")?$scope.productId=data.productId:$scope.productId=!1,1<$scope.accounts.length||data.group?$scope.accountData={number:$scope.accounts.length+" Accounts",nickname:data.group?data.group.nickname:$scope.allAccountsSelectText}:$scope.accountData={number:data.account,nickname:data.nickname},0<$scope.accounts.length&&($scope.loaded=!1,$scope.load())}),$scope.triggerButtonEvent=function(){eventDispatcher.trigger($scope.buttonConfiguration.eventName,$scope.buttonConfiguration.eventData)}}],link:function($scope,$element,$attrs){$element.html($templateCache.get("portfolioSummary/portfolioSummary"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviPortfolioValueChart",["APP_CONFIG","$templateCache","highcharts","eventDispatcher","$timeout","widget","portfolioValue","accountList","labels","$filter","piwik","$log","$modal","$compile",function(APP_CONFIG,$templateCache,highcharts,eventDispatcher,$timeout,widget,portfolioValue,accountList,labels,$filter,piwik,$log,$modal,$compile){return{replace:!1,scope:{chartColorBegin:"@",chartColorEnd:"@",yAxisFontColor:"@",useGradient:"@",viewAllActivityUrl:"@",enableActivityMarkers:"@",activityCategories:"@",enableEndingBalanceTitle:"@",title:"@",selected:"@",template:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.chartColorBegin=$attrs.chartColorBegin||null,svi.ng.defaultTrue($scope,$attrs,"useGradient"),svi.ng.defaultFalse($scope,$attrs,"enableActivityMarkers"),svi.ng.defaultFalse($scope,$attrs,"enableEndingBalanceTitle"),svi.ng.defaultString($scope,$attrs,"chartColorBegin","#FFFFFF"),svi.ng.defaultString($scope,$attrs,"activityCategories","[]"),svi.ng.defaultString($scope,$attrs,"chartColorEnd",$attrs.useGradient?"#FFFFFF":$scope.chartColorBegin),svi.ng.defaultString($scope,$attrs,"yAxisFontColor","#6D869F"),svi.ng.defaultString($scope,$attrs,"viewAllActivityUrl",null),svi.ng.defaultString($scope,$attrs,"selected",5),svi.ng.defaultValidString($scope,$attrs,"template",["","Widget"],""),$scope.api=this;try{$attrs.activityCategories=JSON.parse($attrs.activityCategories)}catch(e){$log.error("sviPortfolioValueChart: Error parsing columns",e,$attrs.activityCategories),$attrs.activityCategories=[]}$scope.activityCategories=$attrs.activityCategories,$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),$scope.chart=null,$scope.chartData=null,$scope.activitySuccess=!1,$scope.activity=null,$scope.id=php.uniqid("portfolioValueChart"),$scope.rangeSelected="",labels.setupLabels($scope,["general","portfolioValueChart"],{portfolioValueChartTitle:"Portfolio Value",cashflow:"Cash",dividend:"Dividends",interest:"Interest",viewAllActivityLink:"View All Activity",tooltipLinkInfo:"Click for details"}),$attrs.title&&$scope.$watch("labels.portfolioValueChartTitle",function(){$scope.labels.portfolioValueChartTitle=$attrs.title}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)},$scope.activityTooltipStyle={};var loadCallback=function(){$scope.hideActivityTooltip();var date=new Date,sd=php.date("Y-m-d",php.strtotime("18 months ago")),ed=php.date("Y-m-d",date);return portfolioValue.getPortfolioValue($scope.accounts,sd,ed,$scope.enableActivityMarkers,$scope.activityCategories)},onSuccess=function(data){var response=data.data||data;if(response.performance.length){var seriesData=processData(response.performance),options=$.extend(!0,{},$scope.options(!1));$.browser.msie&&options&&options.series&&(delete options.series[0].fillColor,options.series[0].fillOpacity=.2),$scope.chart=highcharts.getStockChart(options),$scope.chartData=response.performance,$scope.seriesData=seriesData,$scope.enableActivityMarkers&&response.hasOwnProperty("transactionsStatus")?$scope.activitySuccess=response.transactionsStatus.success:$scope.activitySuccess=!1,highcharts.replaceSeries($scope.chart,[$scope.seriesData]),$timeout(function(){$scope.chart.reflow()},APP_CONFIG.autoLoadDelay)}else $scope.loader.setError($scope.labels.dataRenderError)},onError=function(){$scope.loader.setError($scope.labels.chartRenderError)},processData=function(data){for(var _data=[],i=$scope.minValue=0;i<data.length;i++)data[i].marketValue<$scope.minValue&&($scope.minValue=data[i].marketValue),_data.push([data[i].date,data[i].marketValue]);return _data};widget.attach($scope,$element),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&$scope.load($scope.options)});var currencyFilter=$filter("sviCurrency"),dateFilter=$filter("date"),formatDateParameter=function(input){return dateFilter(input,"yyyy-MM-dd","UTC")};$scope.showActivityTooltip=function(event){if(event&&event.point){var isModal=!1;this.chart.announcerContainer&&this.chart.announcerContainer.parentElement&&-1<this.chart.announcerContainer.parentElement.className.indexOf("modal")&&(isModal=!0);var point=event.point,activityDate=point.x,categoriesData=(balanceDate=point.x,dataElement=$filter("filter")($scope.chartData,{date:balanceDate},!0)[0],categories=[],angular.forEach($scope.activityCategories,function(category){var valuesArray;valuesArray={name:category,value:dataElement[category]},categories.push(valuesArray)}),categories);$scope.activity={date:new Date(activityDate),balance:point.y,categories:categoriesData},isModal&&($scope.modalScope.activity=$scope.activity),$scope.$apply(function(){isModal?($scope.modalScope.activityTooltipVisible=!0,$scope.viewAllActivityUrl&&($scope.modalScope.activityUrl=$scope.viewAllActivityUrl.replace("%FROM_DATE%",formatDateParameter(new Date(point.x))).replace("%TO_DATE%",formatDateParameter(new Date(point.x))).replace("%ACTIVITY_CATEGORIES%",$scope.modalScope.activityCategories.join(","))),$timeout(function(){var x=point.clientX,top=$scope.chartModal.plotTop+point.plotY,modalElement=angular.element(document).find("#portfolioValueChartModal"),chartModalElement=modalElement.find(".value-chart-modal"),popover=modalElement.find(".popover"),popoverWidth=popover.innerWidth(),popoverHeight=popover.innerHeight();$scope.chartModal.chartHeight-top<popoverHeight?($scope.modalScope.activityTooltipClass="top",top-=popoverHeight):$scope.modalScope.activityTooltipClass="bottom";var left=point.clientX-popoverWidth/2;left=Math.max(-12,left);var arrowLeft=x-(left=Math.min(left,chartModalElement.innerWidth()-popoverWidth+12))-2;$scope.modalScope.activityTooltipStyle={position:"absolute",top:top,left:left,display:"block"},$scope.modalScope.activityTooltipArrowStyle={left:arrowLeft}})):($scope.activityTooltipVisible=!0,$scope.viewAllActivityUrl&&($scope.activityUrl=$scope.viewAllActivityUrl.replace("%FROM_DATE%",formatDateParameter(new Date(point.x))).replace("%TO_DATE%",formatDateParameter(new Date(point.x))).replace("%ACTIVITY_CATEGORIES%",$scope.activityCategories.join(","))),$timeout(function(){var x=point.clientX,top=$scope.chart.plotTop+point.plotY,popover=$element.find(".popover"),popoverWidth=popover.innerWidth(),popoverHeight=popover.innerHeight();$scope.chart.chartHeight-top<popoverHeight?($scope.activityTooltipClass="top",top-=popoverHeight):$scope.activityTooltipClass="bottom";var left=point.clientX-popoverWidth/2;left=Math.max(-12,left);var arrowLeft=x-(left=Math.min(left,$element.innerWidth()-popoverWidth+12))-2;$scope.activityTooltipStyle={position:"absolute",top:top,left:left,display:"block"},$scope.activityTooltipArrowStyle={left:arrowLeft}}))})}var balanceDate,dataElement,categories},$scope.hideActivityTooltip=function(){$timeout(function(){$scope.activityTooltipVisible=!1,$scope.modalScope&&($scope.modalScope.activityTooltipVisible=!1)})},$scope.options=function(isModal){return{chart:{renderTo:isModal?angular.element(document).find("#portfolioValueChartModal .value-chart-modal")[0]:$element.find(".value-chart")[0],marginTop:0,marginLeft:0,height:300,events:{click:function(){$scope.hideActivityTooltip(),0!==Object.keys(this.pane[0].chart).length&&$scope.chart.pointer.drop()}}},accessibility:{description:"Chart displaying historical market value for a list of accounts.",landmarkVerbosity:"disabled",announceNewData:{enabled:!0,interruptUser:!0,inAnnounceInterval:0},keyboardNavigation:{order:["rangeSelector","series","chartMenu"]}},credits:{enabled:!1},exporting:{csv:{dateFormat:"%Y-%m-%d"}},scrollbar:{enabled:!1},navigator:{enabled:!1},rangeSelector:{selected:+$scope.selected,inputEnabled:!1,allButtonsEnabled:!0,buttons:[{type:"month",title:"1 Month",count:1,text:"1m",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]},events:{click:function(){$scope.rangeSelected="1 month button clicked"}}},{type:"month",title:"3 Month",count:3,text:"3m",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]},events:{click:function(){$scope.rangeSelected="3 month button clicked"}}},{type:"month",title:"6 Month",count:6,text:"6m",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]},events:{click:function(){$scope.rangeSelected="6 month button clicked"}}},{type:"ytd",title:"Year to Date",text:"YTD",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]},events:{click:function(){$scope.rangeSelected="year to date button clicked"}}},{type:"year",title:"1 Year",count:1,text:"1y",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]},events:{click:function(){$scope.rangeSelected="1 year button clicked"}}},{type:"month",title:"18 Month",count:18,text:"18m",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]},events:{click:function(){$scope.rangeSelected="18 month button clicked"}}}]},title:{text:""},tooltip:{shared:!0,split:!1,useHTML:!0,crosshairs:[{width:1,dashStyle:"dash",color:"black"},!1],xDateFormat:"%b %d, %Y",formatter:function(){return $scope.enableActivityMarkers?'<table><tr><td class="tooltipInfo">'+dateFilter(this.x+864e5)+'</td></tr><tr><td class="tooltipInfo">'+currencyFilter(this.y)+'</td></tr><tr><td class="tooltipLinkInfo">'+$scope.labels.tooltipLinkInfo+"</td></tr></table>":dateFilter(this.x+864e5)+"<br><b>"+$scope.labels.portfolioValueChartTitle+":"+currencyFilter(this.y)+"</b>"}},xAxis:{type:"datetime",title:{text:"Date",style:{display:"none"}},events:{afterSetExtremes:function(e){$scope.hideActivityTooltip()}}},yAxis:{floor:$scope.minValue,startOnTick:!1,labels:{formatter:function(){return currencyFilter(this.value,null,null,0)},style:{color:$scope.yAxisFontColor}},plotLines:[{color:"#666666",width:2,value:1}]},series:[{id:"portfolio",name:"Portfolio",data:[],tooltip:{valueDecimals:2},type:"area",threshold:null,color:$scope.enableActivityMarkers?"":$scope.chartColorBegin,shadow:!!$scope.enableActivityMarkers,lineColor:$scope.enableActivityMarkers?"#0F57C2":"#666666",lineWidth:$scope.enableActivityMarkers?2:1,fillColor:{linearGradient:$scope.enableActivityMarkers?{x1:0,x2:0,y1:0,y2:1}:[0,0,0,500],stops:[[0,$scope.chartColorBegin],[1,$scope.enableActivityMarkers?$scope.chartColorEnd:new Highcharts.Color($scope.chartColorEnd).setOpacity(0).get("rgba")]]},events:{click:$scope.showActivityTooltip}}]}},$scope.displayModal=function(){$scope.modal?($scope.modalScope.labels=$scope.labels,$scope.modalScope.id="portfolioValueChart",$scope.modalScope.rangeSelected=$scope.rangeSelected,$scope.modalScope.activityTooltipVisible=$scope.activityTooltipVisible,$scope.modal.$promise.then($scope.modal.show)):($scope.modalScope=$scope.$new(),$scope.modalScope.labels=$scope.labels,$scope.modalScope.id="portfolioValueChart",$scope.modalScope.rangeSelected=$scope.rangeSelected,$scope.modalScope.activityTooltipVisible=$scope.activityTooltipVisible,$scope.modal=$modal({scope:$scope.modalScope,templateUrl:"portfolioValueChart/portfolioValueChartModal.tpl.html",container:".modals-section",backdrop:!1,animation:"",show:!0})),$timeout(function(){$scope.chartModal&&$scope.chartModal.destroy();var options=$.extend(!0,{},$scope.options(!0));$.browser.msie&&options&&options.series&&(delete options.series[0].fillColor,options.series[0].fillOpacity=.2),$scope.chartModal=highcharts.getStockChart(options),highcharts.replaceSeries($scope.chartModal,[$scope.seriesData])})},this.hide=function(){$scope.modal&&$scope.modal.$isShown&&($("body").removeClass("modal-open"),$scope.modal.hide())}}],link:function($scope,$element,$attrs){var template=$templateCache.get("portfolioValueChart/portfolioValueChart"+$scope.template+".tpl.html");$element.html(template).show(),$compile($element.contents())($scope),$timeout(function(){$scope.load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviTargetedMarketingMessages",["$templateCache","$timeout","eventDispatcher","siteMessages","$sce","piwik",function($templateCache,$timeout,eventDispatcher,siteMessages,$sce,piwik){return{replace:!1,scope:{section:"@"},template:$templateCache.get("targetedMarketingMessages/targetedMarketingMessages.tpl.html"),controller:["$scope","$attrs","$element",function($scope,$attrs,$element){try{svi.ng.defaultString($scope,$attrs,"section","portfolioSummary")}catch(e){throw"sviTargetedMarketingMessages: "+e}$scope.messages=[],$scope.productId=null,$scope.setLoader=function(loader){$scope.loader=loader};var loadCallback=function(){return siteMessages.getMarketingMessages($scope.section,$scope.productId)},onSuccess=function(response){piwik.trackPage("targetedMarketingMessages","Targeted Marketing Messages",1e3*response._loaderMetadata.elapsedTime),angular.isArray(response.messages)&&($scope.messages=[],response.messages.forEach(function(message){$scope.messages.push($sce.trustAsHtml(message))}))},onError=function(reason){};$scope.load=function(){if($scope.messages=[],!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)},$timeout(function(){$scope.load()},300),eventDispatcher.on("PRODUCT_TYPE.CHANGED",function(e,data){$scope.messages=[],data.hasOwnProperty("productId")&&($scope.productId=data.productId||"NULL",$scope.load())})}]}}]),angular.module("directives").directive("sviTopmovers",["$templateCache","$compile","$timeout","topmovers","eventDispatcher","accountList","labels","piwik",function($templateCache,$compile,$timeout,topmovers,eventDispatcher,accountList,labels,piwik){return{replace:!1,scope:{template:"@",showTitle:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"template",["","Classic","Widget"],"")}catch(e){throw"sviTopmovers: "+e}var uptickCount=1,downtickCount=1;$scope.upticks=[],$scope.downticks=[],$scope.topmovers=[],$scope.topmover={},$scope.dateAsof=null,$scope.tooltip=null,$scope.accounts=$scope.$parent.accounts,$scope.accounts||($scope.accounts=[accountList.getCurrentAccountIndex()]),svi.ng.defaultTrue($scope,$attrs,"showTitle"),$scope.loaded=!1,labels.setupLabels($scope,["general","topmovers"],{});this.getLoader=svi.ng.getLoaderFactory($element,$scope,"loader"),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,200)};var loadCallback=function(){return downtickCount=uptickCount=1,$scope.upticks=[],$scope.downticks=[],$scope.topmovers=[],topmovers.getTopMovers($scope.accounts,10)},onSuccess=function(response){if(piwik.trackPage("topmovers","Top Movers",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]),!response.topMovers.positions.length)return $scope.api.getLoader().setWarning($scope.labels.topmoversNoMovers),void eventDispatcher.trigger("TOPMOVERS.SYMBOLS.CHANGED",{instrumentList:[],symbolList:[],upticks:[],downticks:[]});var positions=response.topMovers.positions;positions[0]&&($scope.dateAsof=positions[0].dateAsOf);for(var symbolList=[],instrumentList=[],i=0;i<positions.length;i++)0<=positions[i].marketValueChange?$scope.upticks.push(positions[i]):$scope.downticks.push(positions[i]),$scope.topmovers[positions[i].instrument.symbol]=positions[i],instrumentList.push(positions[i].instrument),symbolList.push(positions[i].instrument.symbol);$scope.loaded=!0;for(var u=0;u<$scope.upticks.length;u++)$scope.upticks.reverse(),$scope.upticks[u].classes="uptick-"+uptickCount,$scope.upticks.reverse(),uptickCount=10<(uptickCount+=Math.round(10/$scope.upticks.length))?10:uptickCount;$scope.downticks.reverse();for(var d=0;d<$scope.downticks.length;d++)$scope.downticks[d].classes="downtick-"+downtickCount,downtickCount=10<(downtickCount+=Math.round(10/$scope.downticks.length))?10:downtickCount;eventDispatcher.trigger("TOPMOVERS.SYMBOLS.CHANGED",{instrumentList:instrumentList,symbolList:symbolList,upticks:$scope.upticks,downticks:$scope.downticks})},onError=function(response){piwik.trackPage("topmovers/error","Error: Top Movers",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.accounts)?$scope.accounts.length:1}]),$scope.api.getLoader().setError($scope.labels.dataRenderError)},qtipClasses="Classic"==$scope.template?"qtip-bootstrap qtip-svi topmover-hover":"qtip-bootstrap qtip-svi-nogradient topmover-hover-nogradient";$scope.$watch("loaded",function(){$scope.tooltip=$($element).find(".top-mover").qtip({prerender:!1,overwrite:!0,content:{text:getContent},position:{viewport:$(window),container:$(".topmovers-qtip-container"),my:"top center",at:"bottom center",adjust:{method:"shift none"}},style:{tip:{corner:!0},classes:qtipClasses},events:{hidden:function(event,api){var target=api.elements.target;$(target).removeAttr("aria-describedby"),$(target).attr("aria-expanded","false")},show:function(event,api){}}}),$scope.loaded=!1});var getContent=function(){var ticker=$(this).attr("data-ticker"),topmover=$scope.topmovers[ticker];return $scope.topmover.symbol==topmover.instrument.symbol&&$scope.topmover.asOfDate==topmover.dateAsOf||$scope.$apply(function(){$scope.topmover.asOfDate=topmover.dateAsOf,$scope.topmover.symbol=topmover.instrument.symbol,$scope.topmover.closingPrice=topmover.closingPrice,$scope.topmover.securityPctDayChange=topmover.securityPctDayChange,$scope.topmover.securityDayChange=topmover.securityDayChange,$scope.topmover.percentChange=topmover.percentChange,$scope.topmover.quantity=topmover.quantity,$scope.topmover.marketValueChange=topmover.marketValueChange,$scope.topmover.marketValue=topmover.marketValue}),$element.find(".svi-top-movers-hover").html()};$scope.toggleTooltip=function(evt){if(evt&&evt.target){var el=$(evt.target),ticker=el.attr("data-ticker");if(ticker||(el=$(evt.target).parents("[data-ticker]")),el.length){if("true"==el.attr("aria-expanded")?el.attr("aria-expanded","false"):el.attr("aria-expanded","true"),(ticker=el.attr("data-ticker"))&&$scope.topmovers.hasOwnProperty(ticker)){var topmover=$scope.topmovers[ticker];$scope.topmover.asOfDate=topmover.dateAsOf,$scope.topmover.symbol=topmover.instrument.symbol,$scope.topmover.closingPrice=topmover.closingPrice,$scope.topmover.securityPctDayChange=topmover.securityPctDayChange,$scope.topmover.securityDayChange=topmover.securityDayChange,$scope.topmover.percentChange=topmover.percentChange,$scope.topmover.quantity=topmover.quantity,$scope.topmover.marketValueChange=topmover.marketValueChange,$scope.topmover.marketValue=topmover.marketValue}$timeout(function(){var tooltip=el.qtip("api");tooltip.rendered||tooltip.render();var qtipId=tooltip._id,qtip=$("#"+qtipId);$(qtip).removeAttr("aria-describedby"),$(qtip).removeAttr("role"),$(qtip).removeAttr("aria-live"),$(el).attr("aria-describedby",qtipId),tooltip.toggle(),closeQtips(qtipId)})}}};var closeQtips=function(id){var openQtipsSelector=":not(#"+id+")";$(".topmovers-qtip-container").children(openQtipsSelector).qtip("hide")};$scope.api=this,$timeout(function(){$scope.api.load()},300),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.accounts=data.currentAccount,0<$scope.accounts.length&&$scope.api.load()}),$scope.changeSymbol=function(e,data){$(e.target).find("a").length?$(e.target).find("a"):$(e.target),$element.find("table tbody tr").removeClass("active"),$(e.target).closest("tr").addClass("active"),e.preventDefault()}}],link:function($scope,$element,$attrs){$element.html($templateCache.get("topmovers/topmovers"+$scope.template+".tpl.html")).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviTopMoversAndNewsContainer",["APP_CONFIG","$templateCache","$timeout","labels","widget",function(APP_CONFIG,$templateCache,$timeout,labels,widget){return{scope:{useModal:"@",newsEventName:"@",newsLimit:"@",newsLimitDisplay:"@"},template:$templateCache.get("topMoversAndNewsContainer/topMoversAndNewsContainer.tpl.html"),controller:["$scope","$element",function($scope,$element){($scope.api=this).name="historicalPerformanceChartReport",this.friendlyName="Historical Performance Chart Report",$timeout(function(){labels.setupLabels($scope,["general","topMoversAndNewsContainer"]),widget.attach($scope,$element)},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("directives").directive("sviProjectedIncomeContainer",["$templateCache","$timeout","$log","projectedIncome","accountList","eventDispatcher","labels","piwik",function($templateCache,$timeout,$log,projectedIncome,accountList,eventDispatcher,labels,piwik){return{replace:!1,scope:{account:"@",columns:"@",columnPriority:"@",responsiveColumns:"@"},template:$templateCache.get("projectedIncomeContainer/projectedIncomeContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"columns",'["expander","month","year","symbol","dateScheduled","transactionType","securityDesc","disbursementIncomeAmt","disbursementPrincipalAmt","interest","principal","dividends","total"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["symbol","interest","principal","dividends","total","month","year","dateScheduled","transactionType","securityDesc","disbursementIncomeAmt","disbursementPrincipalAmt","expander"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns"),labels.setupLabels($scope,["projectedIncome"],{}),$scope.initComplete=!1,$scope.projectedIncome=!1;try{$attrs.columns=JSON.parse($attrs.columns)}catch(e){$log.warn("sviProjectedIncomeContainer: Error parsing columns: ",e,$attrs.columns),$attrs.columns=[]}$scope.columns=$attrs.columns;try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviProjectedIncomeContainer: Error parsing columnPriority: ",e,$attrs.columnPriority)}$scope.setLoader=function(loader){$scope.loader=loader},$scope.getLoadParameters=function(){return{}}}],link:function($scope,$element,$attrs){var load=function(){if($scope.initComplete)return $scope.loader?void $scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout(load,200)},loadCallback=function(invalidateCache){return $("html,body").animate({scrollTop:0},0),projectedIncome.getProjectedIncome($scope.account,invalidateCache)},onSuccess=function(response){piwik.trackPage("projectedIncomeContainer","Projected Income Container",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}]),$scope.projectedIncome=response.projectedIncome,response.projectedIncome.sumRowData.length?$timeout(function(){svi.ui.pulse(".projected-income-grid, .projected-income-grid tr")}):$scope.loader.setMessage($scope.labels.noProjectedIncomeData)},onError=function(reason){piwik.trackPage("projectedIncomeContainer/error","Error: Projected Income Container",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}])};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.projectedIncome=!1,load())},!0),eventDispatcher.on("PMI.REFRESH",function(){load()}),$timeout(function(){$scope.initComplete=!0,$scope.projectedIncome||load()},400)}}}]),angular.module("directives").directive("sviProjectedIncomeGrid",["$templateRequest","$compile","labels","expander",function($templateRequest,$compile,labels,expander){return{replace:!1,scope:{title:"@",columns:"=",columnPriority:"=",responsiveColumns:"@",projectedIncome:"="},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns")}catch(e){throw"sviProjectedIncomeGrid: "+e}labels.setupLabels($scope,["projectedIncome"],{}),expander.init($scope,"PMIGRID",$element),$scope.$watch("projectedIncome",function(){$scope.projectedIncome&&0<$scope.projectedIncome.sumRowData.length&&expander.expand($scope,$scope.projectedIncome.sumRowData[0].expandId)}),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{expander:!1}}}],link:function($scope,$element,$attrs){var config={columns:$scope.columns};$templateRequest("projectedIncome/projectedIncomeGrid/projectedIncomeGrid.tpl.phtml",config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)})}}}]),angular.module("directives").directive("sviProjectedMonthlyIncomeChart",["$templateCache","$log","projectedIncome","highcharts","eventDispatcher","$filter","accountList","labels","$timeout","$window","piwik",function($templateCache,$log,projectedIncome,highcharts,eventDispatcher,$filter,accountList,labels,$timeout,$window,piwik){return{replace:!1,scope:{account:"@",chartType:"@",chartColors:"@",height:"@",title:"@",seriesList:"@"},template:$templateCache.get("projectedMonthlyIncomeChart/projectedMonthlyIncomeChart.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"chartType","column","column"),svi.ng.defaultString($scope,$attrs,"title",""),svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultString($scope,$attrs,"chartColors","[]"),svi.ng.defaultInt($scope,$attrs,"height",225),svi.ng.defaultString($scope,$attrs,"seriesList",["Interest","Principal","Dividends"])}catch(e){throw"sviProjectedMonthlyIncomeChart: "+e}var currencyFilter=$filter("sviCurrency"),pctFilter=$filter("percent"),seriesArray=[];try{svi.ng.parseJSON($scope,$attrs,"seriesList")}catch(e){$log.error("sviProjectedMonthlyIncomeChart: Error parsing seriesList",e,$attrs.seriesList)}for(i=0;i<$scope.seriesList.length;i++){var series={name:$scope.seriesList[i],data:[]};seriesArray.push(series)}$scope.id=php.uniqid("projectedMonthlyIncomeChart"),$scope.monthNames=[],$scope.chart=null,$scope.options={chart:{reflow:!1,type:$scope.chartType,renderTo:$($element).find(".chart")[0],dataLabels:{enabled:0!==this.value},height:$scope.height},accessibility:{description:"Bar chart showing projected monthly income for an account."},credits:{enabled:!1},title:{text:""},xAxis:{categories:$scope.monthNames,allowDecimals:!1,endOnTick:!0,tickInterval:1},yAxis:{min:0,minRange:50,title:{text:"Income"},stackLabels:{style:{color:"black"},enabled:!0,formatter:function(){return currencyFilter(this.total)}}},tooltip:{pointFormatter:function(){return this.series.name+": <b>"+currencyFilter(this.y)+"</b> ("+pctFilter(this.percentage,1)+")<br/>"}},plotOptions:{series:{stacking:"normal"},column:{colors:$scope.chartColors}},series:seriesArray,responsive:{rules:[{condition:{callback:function(){return 6<$scope.monthNames.length&&$("#chart-wrapper").width()<500}},chartOptions:{xAxis:{labels:{step:2,rotation:-45}}}}]}},$scope.showChart=!1,$scope.chart=highcharts.getChart($scope.options);var resizeHandler=function(e){var width=$("#chart-wrapper").width();$scope.chart.setSize(width,$scope.height,!0)};angular.element($window).on("resize",resizeHandler),$scope.$on("$destroy",function(){angular.element($window).off("resize",resizeHandler)}),$scope.setLoader=function(loader){$scope.loader=loader},labels.setupLabels($scope,["general","assetTypes"],{}),$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return projectedIncome.getProjectedIncome($scope.account)},onSuccess=function(response){piwik.trackPage("projectedMonthlyIncomeChart","Projected Monthly Income Chart",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}]);var dividendAmounts=[],principalAmounts=[],interestAmounts=[];if(response.hasOwnProperty("projectedIncome")&&response.projectedIncome.sumRowData.length){var monthCounter=0;angular.forEach(response.projectedIncome.sumRowData,function(row,index){if(!1===row.isChild){var monthName=$filter("month")(row.month,!1);dividendAmounts[monthCounter]=[monthName,row.dividendAmt],principalAmounts[monthCounter]=[monthName,row.principalAmt],interestAmounts[monthCounter]=[monthName,row.interestAmt],$scope.monthNames[monthCounter]=monthName+"<br/>"+row.year,void 0===dividendAmounts[monthCounter]&&(dividendAmounts[monthCounter]=[monthName,0]),void 0===principalAmounts[monthCounter]&&(principalAmounts[monthCounter]=[monthName,0]),void 0===interestAmounts[monthCounter]&&(interestAmounts[monthCounter]=[monthName,0]),monthCounter++}})}else $scope.loader.setError($scope.labels.noProjectedIncomeData);setChartData(interestAmounts,principalAmounts,dividendAmounts)},onError=function(response){piwik.trackPage("projectedMonthlyIncomeChart/error","Error: Projected Monthly Income Chart",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1}]),setChartData(),$scope.loader.setError($scope.labels.chartRenderError)},hasData=function(value){return Array.isArray(value)&&value.length},setChartData=function(interestAmounts,principalAmounts,dividendAmounts){for(i=0;i<$scope.seriesList.length;i++)"Interest"==$scope.seriesList[i]?$scope.chart.series[i].setData(interestAmounts,!1):"Principal"==$scope.seriesList[i]?$scope.chart.series[i].setData(principalAmounts,!1):"Dividends"==$scope.seriesList[i]&&$scope.chart.series[i].setData(dividendAmounts,!1);$scope.showChart=hasData(interestAmounts)||hasData(principalAmounts)||hasData(dividendAmounts),$scope.chart.redraw()};eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){$scope.account!==data.currentAccount&&($scope.account=data.currentAccount,$scope.projectedIncome=!1,$scope.load())},!0),eventDispatcher.on("PMI.REFRESH",function(){$scope.load()}),$timeout(function(){$scope.load()},300)}]}}]),angular.module("svi.research").directive("sviAddToWatchlist",["APP_CONFIG","$templateCache","$timeout","labels","loader","eventDispatcher","piwik","watchlist","symbol",function(APP_CONFIG,$templateCache,$timeout,labels,loader,eventDispatcher,piwik,watchlist,symbol){var SECURITY_TYPE_OPTION="Option";return{replace:!1,scope:{symbol:"@",viewWatchlistLink:"@",manualShowDropdown:"@",symbolInstrument:"@",shouldShowLoader:"@"},template:$templateCache.get("addToWatchlist/addToWatchlist.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="AddToWatchlist",this.friendlyName="Add To Watchlist",labels.setupLabels($scope,["addToWatchlist"]),$scope.actionsDone=!1,$scope.options=null,$scope.watchlistName="DEFAULT",$scope.watchlists=[],$scope.selected=[],$scope.hasAdded=null,$scope.maxAlertLeftOffset=165,$scope.maxAlertTopOffset=80;try{$scope.result=null,svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"viewWatchlistLink",""),svi.ng.defaultFalse($scope,$attrs,"manualShowDropdown"),svi.ng.defaultTrue($scope,$attrs,"shouldShowLoader"),svi.ng.parseJSON($scope,$attrs,"symbolInstrument")}catch(e){throw"addToWatchlist: "+e}$scope.listLoader=null,$scope.getListLoader=function(loader){$scope.listLoader=loader},this.getWatchlists=function(){piwik.trackEvent("GetAllWatchlists","Get List",$scope.symbol),$scope.options||($scope.listLoader?$scope.listLoader.setLoadHandler(getWatchlistsCallback).load(!0).then(onGetListSuccess,onError):$timeout($scope.api.getWatchlists,200))};var getWatchlistsCallback=function(invalidateCache){return watchlist.getList(invalidateCache)},onError=function(er){console.error("error",er)},listProcessData=function(){var result=[],data=$scope.watchlists;data.forEach(function(list,index){var obj={display:list.name,value:index.toString(),isChecked:!1};list.securities.forEach(function(item){var initialSymbol,itemInstrument,symbolInstrument;initialSymbol=$scope.symbol,itemInstrument=item.instrument,symbolInstrument=$scope.symbolInstrument,(itemInstrument.symbol===initialSymbol&&itemInstrument.securityType!==SECURITY_TYPE_OPTION||symbolInstrument&&symbolInstrument.securityType===SECURITY_TYPE_OPTION&&symbol.compareTwoOptionSymbols(symbolInstrument,itemInstrument))&&($scope.selected.push(list.name),obj.isChecked=!0)}),result.push(obj)}),1<data.length&&($scope.options=result)},onGetListSuccess=function(data){piwik.trackDataLoad($scope,data);try{$scope.watchlists=data.watchlists.watchList,0===$scope.watchlists.length&&$scope.watchlists.push({name:"DEFAULT",securities:[]}),$scope.options||listProcessData()}catch(e){$scope.options=[]}};this.addSymbolToSingleWatchlist=function(){1===$scope.watchlists.length?$scope.api.addOrRemoveFromWatchlist($scope.watchlists[0].name):$scope.manualShowDropdown&&$(".add-to-watchlist-dropdown").find(".dropdown-menu").is(":hidden")&&$timeout($(".dropdown-toggle.add-to-watchlist-dropdown-toggle").dropdown("toggle"),300)},$scope.addOrRemoveLoader=null,$scope.addOrRemoveSymbolLoader=function(loader){$scope.addOrRemoveLoader=loader},this.addOrRemoveFromWatchlist=function(watchlistName){if(piwik.trackEvent("AddToWatchlist","Get List",$scope.symbol),$scope.watchlistName=watchlistName,$scope.addOrRemoveLoader)if(-1<$scope.selected.indexOf(watchlistName)){var index=$scope.selected.indexOf(watchlistName);$scope.selected.splice(index,1),$scope.addOrRemoveLoader.setLoadHandler(removeFromWatchlistCallback).load().then(onRemoveSymbolSuccess,onError)}else $scope.selected.push(watchlistName),$scope.addOrRemoveLoader.setLoadHandler(addToWatchlistCallback).load().then(onAddSymbolSuccess,onError);else $timeout($scope.api.addOrRemoveFromWatchlist,200)};var addToWatchlistCallback=function(){return watchlist.addSymbol($scope.watchlistName,$scope.symbol)},onAddSymbolSuccess=function(data){piwik.trackDataLoad($scope,data),calculateAlertPosition(),$scope.actionsDone=!0,$scope.hasAdded=!0,eventDispatcher.trigger("SYMBOL.IN.WATCHLIST.ADDED",{symbol:data.symbol,watchlistName:data.name}),$timeout(function(){$element.find(".svi-add-to-watchlist .alert-wrapper button.close")[0].focus()},200)},calculateAlertPosition=function(){var wrapperElement=$element.find(".watchlist-wrapper"),offset=wrapperElement.offset();offset.left&&offset.left>$scope.maxAlertLeftOffset&&wrapperElement.find(".alert-wrapper").css({right:"0"}),offset.top&&offset.top<$scope.maxAlertTopOffset&&wrapperElement.find(".alert-wrapper").css({top:"1.5em"})},removeFromWatchlistCallback=function(){return watchlist.removeSymbol($scope.watchlistName,$scope.symbol)},onRemoveSymbolSuccess=function(data){piwik.trackDataLoad($scope,data),calculateAlertPosition(),$scope.actionsDone=!0,$scope.hasAdded=!1,eventDispatcher.trigger("SYMBOL.IN.WATCHLIST.REMOVED",{symbol:data.symbol,watchlistName:data.name}),$timeout(function(){$element.find(".svi-add-to-watchlist .alert-wrapper button.close")[0].focus()},200)};$scope.closeAlert=function(){$scope.actionsDone=!1},$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&($scope.options=null,$scope.selected=[],$scope.actionsDone=!1,listProcessData())}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.watchlists.length||$scope.api.getWatchlists()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviAnalystConsensus",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","eventDispatcher","piwik","stockInfo","highcharts",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,eventDispatcher,piwik,stockInfo,highcharts){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("analystConsensus/analystConsensus.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="AnalystConsensus",this.friendlyName="Analyst Consensus",$scope.chart=null,$scope.positionsForSeriesLabel=[{top:10},{top:6},{top:5},{top:8},{top:6}],labels.setupLabels($scope,["analystConsensus"]);try{$scope.result=null,svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"analystConsensus: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl",""),$scope.renderIcons=function(){var index=$scope.index,centerX=this.plotWidth/2+this.plotLeft,centerY=this.plotHeight/2+this.plotTop,circleRadius=this.plotHeight/215*14,positionsObject={};if($scope.averageRating<=5){var radius=this.series[0].points[0].shapeArgs.innerR+(circleRadius/2+.1*circleRadius);positionsObject=calculatePositions(radius,centerX,centerY,$scope.averageRating-1),this.renderer.circle(positionsObject.xPoint,positionsObject.yPoint,circleRadius).attr({fill:"#fff",stroke:index<5?this.series[index].points[0].color:"#000","stroke-width":7,zIndex:20}).add();for(var i=0;i<this.series.length;i++){var html='<p style="color: #fff;font-size: 10px; transform: rotate('+(positionsObject=calculatePositions(radius,centerX,centerY,i)).radians+'rad)">'+this.series[i].name+"</p>",xPoint=positionsObject.xPoint-2.83*this.series[i].name.length;this.renderer.text(html,xPoint,positionsObject.yPoint+$scope.positionsForSeriesLabel[i].top,!0).add()}}this.renderer.text($scope.name,centerX,centerY).attr({align:"center"}).css({color:index<5?this.series[index].points[0].color:"#000",fontSize:index<5?"1.7em":"1.5em"}).add()};var calculatePositions=function(radius,centerX,centerY,pointValue){var radians=1.05*pointValue*Math.PI/4-Math.PI/2;return{xPoint:centerX+radius*Math.sin(radians),radians:radians,yPoint:centerY-radius*Math.cos(radians)}};$scope.getOptions=function(){return{chart:{type:"solidgauge",animation:!1,renderTo:$element.find(".gauge-chart")[0],height:$element.find(".gauge-chart").height()||300,width:$element.find(".gauge-chart").width()||300,events:{render:$scope.renderIcons}},exporting:{enabled:!1},title:{text:""},tooltip:{enabled:!1},accessibility:{landmarkVerbosity:"disabled",keyboardNavigation:{enabled:!1}},pane:{startAngle:-120,endAngle:120,background:{borderWidth:0,backgroundColor:"none"}},yAxis:{min:0,max:100,lineWidth:0,tickPositions:[]},plotOptions:{solidgauge:{dataLabels:{enabled:!1},linecap:"round",stickyTracking:!1,rounded:!0},series:{enableMouseTracking:!1,states:{hover:{enabled:!1}}}},series:[{name:$scope.labels.buy,animation:!1,data:[{color:APP_CONFIG.chartColors.consensusColors[4],radius:"100%",innerRadius:"80%",y:100}]},{name:$scope.labels.outperform,animation:!1,data:[{color:APP_CONFIG.chartColors.consensusColors[3],radius:"100%",innerRadius:"80%",y:80}]},{name:$scope.labels.hold,animation:!1,data:[{color:APP_CONFIG.chartColors.consensusColors[2],radius:"100%",innerRadius:"80%",tooltip:{enabled:!1},y:60}]},{name:$scope.labels.underperform,animation:!1,data:[{color:APP_CONFIG.chartColors.consensusColors[1],radius:"100%",innerRadius:"80%",y:40}]},{name:$scope.labels.sell,animation:!1,data:[{color:APP_CONFIG.chartColors.consensusColors[0],radius:"100%",innerRadius:"80%",y:20}]}]}};var processData=function(data){$scope.averageRating=data.averageRating;var dataForChart={buy:data.buy,outperform:data.outperform,hold:data.hold,underperform:data.underperform,sell:data.sell};$scope.circle={};var barTitles=Object.keys(dataForChart);$scope.maxValue=function(data){var keyMax=Object.keys(data).reduce(function(a,b){return data[a]>data[b]?a:b});return data[keyMax]}(dataForChart),$scope.maxValueTitles=barTitles.filter(function(item){return dataForChart[item]===$scope.maxValue});var result=[];for(var key in barTitles){var titleName=barTitles[key];(data[titleName]||0===data[titleName])&&result.push({name:titleName,value:data[titleName],color:APP_CONFIG.chartColors.consensusColors[key],barWidth:100*data[titleName]/$scope.maxValue+"%",ariaLabel:titleName+" "+data[titleName]})}var consensus=$scope.averageRating;return 1<=consensus&&consensus<=1.5?($scope.index=4,$scope.name=$scope.labels.buy):1.5<consensus&&consensus<=2.5?($scope.index=3,$scope.name=$scope.labels.outperform):2.5<consensus&&consensus<=3.5?($scope.index=2,$scope.name=$scope.labels.hold):3.5<consensus&&consensus<=4.5?($scope.index=1,$scope.name=$scope.labels.underperform):4.5<consensus&&consensus<6?($scope.index=0,$scope.name=$scope.labels.sell):($scope.index=5,$scope.name=$scope.labels.insufficientData),result};loader.attach($scope,$element,function(invalidateCache){return $scope.analystData=null,stockInfo.getAnalystConsensus($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.barChart=processData(data.analystConsensus.analystConsensus),$scope.analystData=data.analystConsensus.analystConsensus,$timeout(function(){var options=$.extend(!0,{},$scope.getOptions());$scope.chart&&$scope.chart.destroy(),$scope.chart=highcharts.getChart(options)})}catch(e){$scope.analystData=[]}}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!=data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.api.isReadyToLoad=function(){return null!==$scope.symbol&&!1!==$scope.symbol&&""!==$scope.symbol},$timeout(function(){$scope.analystData||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviAverageAnnualReturns",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","eventDispatcher","piwik","fundInfo","highcharts","$filter",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,eventDispatcher,piwik,fundInfo,highcharts,$filter){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("averageAnnualReturns/averageAnnualReturns.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="averageAnnualReturns",this.friendlyName="Average Annual Returns",$scope.chartAnnualized=null,$scope.colors=APP_CONFIG.chartColors.graphicColors.map(function(colorItem){return colorItem.color}),labels.setupLabels($scope,["averageAnnualReturns"]);try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"averageAnnualReturns: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl","");$scope.getOptions=function(){return{chart:{renderTo:$element.find(".chart")[0],type:"column",background:"white",borderRadius:0,marginRight:0,height:300},colors:$scope.colors,title:{text:null},tooltip:{formatter:function(){return"<b>"+this.series.name+": "+this.y+"%</b>"}},accessibility:{landmarkVerbosity:"disabled"},navigator:{enabled:!1},scrollbar:{enabled:!1},rangeSelector:{enabled:!1},credits:{enabled:!1},subtitle:{text:""},plotOptions:{column:{allowPointSelect:!0,cursor:"pointer"}},xAxis:{categories:[],labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{formatter:function(){return this.value+"%"},style:{fontSize:"12px"}},offset:0,lineWidth:1,gridLineWidth:1,tickLength:10,tickWidth:1,tickPosition:"outside",tickPixelInterval:36},series:[]}},loader.attach($scope,$element,function(invalidateCache){$scope.annualData=null;var params={includeBenchmarks:"Y",symbolFormat:$scope.symbolFormat};return fundInfo.getPerformance($scope.symbol,params,invalidateCache)},function(data){if(piwik.trackDataLoad($scope,data),data.performance.performance&&data.performance.performance.averageAnnual){var seriesData=function(data){var performance=data.performance.performance,anuallizedKeys=["3y","5y","10y"],dataAnnual=[],dataAnnualItem=[];return anuallizedKeys.map(function(key){performance.averageAnnual[key]&&performance.averageAnnual[key].value?dataAnnualItem.push(parseFloat($filter("number")(performance.averageAnnual[key].value,2))):dataAnnualItem.push("")}),dataAnnual.push({data:dataAnnualItem,showInLegend:!1,name:performance.name}),data.performance.benchmarks.map(function(item){var benchmarkItems=[];anuallizedKeys.map(function(key){item.averageAnnual[key]&&item.averageAnnual[key].value?(benchmarkItems.push(parseFloat($filter("number")(item.averageAnnual[key].value,2))),!$scope.asOfDate&&item.averageAnnual[key].endDate&&($scope.asOfDate=item.averageAnnual[key].endDate)):benchmarkItems.push("")}),dataAnnual.push({data:benchmarkItems,showInLegend:!1,name:item.name})}),{annual:{categories:anuallizedKeys=anuallizedKeys.map(function(x){return x.toUpperCase()}),data:dataAnnual}}}(data),options=$.extend(!0,{},$scope.getOptions());$scope.chartSeries=seriesData.annual.data,options.series=seriesData.annual.data,options.xAxis.categories=seriesData.annual.categories,$scope.anuallizedColumnTitles=seriesData.annual.categories,$scope.chartAnnualized&&$scope.chartAnnualized.destroy(),$scope.chartAnnualized=highcharts.getChart(options),$scope.annualTitles=seriesData.annual.categories,$scope.annualData=JSON.parse(JSON.stringify(seriesData.annual.data))}}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!=data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.api.isReadyToLoad=function(){return null!==$scope.symbol&&!1!==$scope.symbol&&""!==$scope.symbol},$timeout(function(){$scope.annualData||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviCompanyOverview",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","eventDispatcher","piwik","stockInfo","$window",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,eventDispatcher,piwik,stockInfo,$window){return{replace:!1,scope:{symbol:"@",moreUrl:"@"},template:$templateCache.get("companyOverview/companyOverview.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="CompanyOverview",this.friendlyName="Company Overview",labels.setupLabels($scope,["general","companyOverview"]);try{$scope.expanded=!1,$scope.showMoreLess=!1,svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"companyOverview: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl",""),this.toggle=function(){$scope.expanded=!$scope.expanded},this.indexFilter=function(index){return!index.ric.startsWith(".TR")};var showHideMoreLessButton=function(){var strategyTextElement=$element.find(".strategy-text"),strategyTextExpandedElement=$element.find(".strategy-text-expanded");strategyTextElement.length?($scope.strategyTextHeight=strategyTextElement[0].offsetHeight,$scope.showMoreLess=strategyTextElement[0].offsetHeight<strategyTextElement[0].scrollHeight):$scope.strategyTextHeight&&strategyTextExpandedElement&&($scope.strategyTextHeight<strategyTextExpandedElement[0].offsetHeight?$scope.showMoreLess=!0:($scope.expanded=!1,$scope.showMoreLess=!1))};angular.element($window).bind("resize",function(e){showHideMoreLessButton(),$scope.$applyAsync()}),loader.attach($scope,$element,function(invalidateCache){return $scope.info=null,stockInfo.getInfo($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.info=data.stockInfo.info,angular.isObject($scope.info)||($scope.info={})}catch(e){$scope.info={}}$timeout(showHideMoreLessButton,300)}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!=data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.api.isReadyToLoad=function(){return null!==$scope.symbol&&!1!==$scope.symbol&&""!==$scope.symbol},$timeout(function(){$scope.info||$scope.api.load()},APP_CONFIG.autoLoadDelay)}],link:function($scope,$element,$attrs){}}}]),angular.module("svi.research").directive("sviDividendsEventsTable",["APP_CONFIG","$templateCache","$timeout","labels","fundInfo","piwik","loader","eventDispatcher","widget","grid","dateUtils",function(APP_CONFIG,$templateCache,$timeout,labels,fundInfo,piwik,loader,eventDispatcher,widget,grid,dateUtils){return{replace:!1,scope:{dateRange:"@",eventId:"@",pageEventId:"@"},template:$templateCache.get("dividendsEventsTable/dividendsEventsTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="dividendsEventsTable",this.friendlyName="Dividends Events Table",this.eventName="DIVIDENDS",$scope.companies=null,$scope.sortable=!0,$scope.category="Dividends",$scope.totalRecords=null,$scope.currentPage=1,$scope.pageSize=20,svi.ng.defaultString($scope,$attrs,"eventId","DIVIDENDS_EVENTS"),svi.ng.defaultString($scope,$attrs,"pageEventId","DIVIDENDS_PAGING");try{svi.ng.parseJSON($scope,$attrs,"dateRange")}catch(e){throw"Unable to parse JSON: "+e}labels.setupLabels($scope,["general","dividendsEventsTable"]),$scope.responsiveColumns=!0,$scope.columnPriority=["symbol","dividendAmount","paymentDate","exDate","recordDate","company"],grid.attachSorting($scope,$element,$attrs,"company","asc"),grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){return $scope.companies=[],fundInfo.getEventsTable($scope.category,dateUtils.normalizeDate($scope.dateRange.start,"yyyy-MM-dd"),dateUtils.normalizeDate($scope.dateRange.end,"yyyy-MM-dd"),$scope.sortDir,$scope.sortField,$scope.pageSize,$scope.currentPage,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{data.eventsTable.dividends&&data.eventsTable.dividends.length?($scope.companies=data.eventsTable.dividends,$scope.totalRecords=data.eventsTable.totalRecords,$scope.totalPages=Math.ceil($scope.totalRecords/$scope.pageSize)):$scope.loader.setMessage($scope.labels.dividendsNoData)}catch(e){throw"sviDividendsEventsTable: "+e}}),widget.attach($scope,$element),eventDispatcher.on($scope.eventId+".DATE_RANGE.FILTER.CHANGED",function(e,data){angular.isDefined(data.from)&&angular.isDefined(data.to)&&(eventDispatcher.trigger($scope.pageEventId+".PAGE.CHANGED",1),$scope.dateRange={start:dateUtils.normalizeDate(data.from,"yyyy-MM-dd"),end:dateUtils.normalizeDate(data.to,"yyyy-MM-dd")})},null,$element),eventDispatcher.on($scope.pageEventId+".PAGE.CHANGED",function(e,data){data&&$scope.currentPage!==data&&($scope.currentPage=data)},null,$element),$scope.$watch("currentPage",function(newVal,oldVal){newVal&&newVal!==oldVal&&""!==newVal&&$scope.api.load()}),$scope.$watch("dateRange",function(newVal,oldVal){null!==newVal&&""!==newVal&&newVal!==oldVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.companies||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviEarningsEventsTable",["APP_CONFIG","$templateCache","$timeout","labels","fundInfo","piwik","loader","widget","grid","eventDispatcher","dateUtils","$modal","stockInfo",function(APP_CONFIG,$templateCache,$timeout,labels,fundInfo,piwik,loader,widget,grid,eventDispatcher,dateUtils,$modal,stockInfo){return{replace:!1,scope:{dateRange:"@",eventId:"@",pageEventId:"@"},template:$templateCache.get("earningsEventsTable/earningsEventsTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="earningsEventsTable",this.friendlyName="Earnings Events Table",this.eventName="EARNINGS",$scope.companies=null,$scope.earningsCAPData=null,$scope.sortable=!0,$scope.earningsReleasesCategory="EarningsReleases",$scope.earningsCallsAndPresentationsCategory="EarningsCallsAndPresentations",$scope.totalRecords=null,$scope.currentPage=1,$scope.pageSize=20,$scope.totalPages=null,$scope.modal=null,$scope.modalScope=null,$scope.modalChart=null,$scope.chartLegend=["Estimate","Actual"],svi.ng.defaultString($scope,$attrs,"eventId","EARNINGS_EVENTS"),svi.ng.defaultString($scope,$attrs,"pageEventId","EARNINGS_PAGINATION");try{svi.ng.parseJSON($scope,$attrs,"dateRange")}catch(e){throw"Unable to parse JSON: "+e}labels.setupLabels($scope,["general","earningsEventsTable"]),$scope.responsiveColumnsSettings={enabled:!0,priority:["releaseDate","symbol","actualEps","expectedEps","variance","earningsCallHistory","company"],breakpoints:{xs:3,sm:3,md:8}},grid.attachSorting($scope,$element,$attrs,"company","asc"),grid.attachGrid($scope,$element),$scope.processChartData=function(data,ric){var chosenSymbol=data.filter(function(item){return item.ric===ric&&"EarningsReleases"===item.type})[0];if(chosenSymbol.periods){var sortedPeriods=chosenSymbol.periods.sort(function(a,b){return a.relativePeriod.number>b.relativePeriod.number?1:-1}),estimated=[],reported=[];return sortedPeriods.forEach(function(item){var timespan=new Date(item.calendarYear,item.calendarMonth).getTime();estimated.push([timespan,item.actuals[0].surpriseMean]),reported.push([timespan,item.actuals[0].reported])}),[estimated,reported]}};$scope.displayModal=function(item){$scope.modalScope=$scope.$new();var ric=item.ric,company=item.company,earningsCall={};item.callAndPresentation&&(earningsCall={recentReport:item.callAndPresentation.name,releaseDate:item.callAndPresentation.releaseDate,start:item.callAndPresentation.webcastStart,end:item.callAndPresentation.webcastEnd,url:function(item){var live=item.liveWebcastUrl,replay=item.replayWebcastUrl;return live||replay?live&&!replay?live:!live&&replay?replay:live&&replay?live:void 0:""}(item.callAndPresentation)}),$scope.modalScope.id=ric,$scope.modalScope.title=company||"Company Name",$scope.modalScope.ric=ric||"Ric Symbol",$scope.modalScope.callInfo=earningsCall||null,$scope.modalScope.close=close||"Close",$scope.modal=$modal({scope:$scope.modalScope,templateUrl:"earningsEventsTable/earningsEventsModal.tpl.html",container:".modals-section",backdrop:!1,animation:"",show:!0}),$scope.chartData=JSON.stringify({data:$scope.processChartData($scope.companies,ric)}),eventDispatcher.trigger("EARNINGS.EVENTS.MODAL.OPEN",$scope.chartData)},$scope.hide=function(){$scope.modal&&$scope.modal.$isShown&&($("body").removeClass("modal-open"),$scope.modal.hide(),$scope.chartData=null,$scope.modalScope=null)};var processData=function(data){var rics=[],result=data.map(function(comp){return comp.periodEnding=comp.calendarYear&&comp.calendarMonth?new Date(comp.calendarYear,comp.calendarMonth):"-",comp.ric&&rics.push(comp.ric),comp});return $scope.ricsForCAP=rics.filter(Boolean).join(","),result};loader.attach($scope,$element,function(invalidateCache){return $scope.companies=[],fundInfo.getEventsTable($scope.earningsReleasesCategory,dateUtils.normalizeDate($scope.dateRange.start,"yyyy-MM-dd"),dateUtils.normalizeDate($scope.dateRange.end,"yyyy-MM-dd"),$scope.sortDir,$scope.sortField,$scope.pageSize,$scope.currentPage,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{data.eventsTable.earnings&&data.eventsTable.earnings.length?($scope.companies=processData(data.eventsTable.earnings),$scope.totalRecords=data.eventsTable.totalRecords,$scope.totalPages=Math.ceil($scope.totalRecords/$scope.pageSize),$scope.api.getEarningsCAPData()):$scope.loader.setMessage($scope.labels.earningsNoData)}catch(e){throw"sviEarningsEventsTable: "+e}}),widget.attach($scope,$element),$scope.setEarningsCAPDLoader=function(loader){$scope.earningsCAPLoader=loader},this.getEarningsCAPData=function(){piwik.trackEvent("getEarningsCallsAndPresentations","Get Earnings Calls And Presentations","Earnings"+$scope.dateRange.start+$scope.dateRange.end+$scope.currentPage),$scope.earningsCAPLoader?$scope.earningsCAPLoader.setLoadHandler(getEarningsCAPCallback).load(!0).then(getEarningsCAPSuccess):$timeout($scope.api.getEarningsCAPData,200)};var getEarningsCAPCallback=function(invalidateCache){return stockInfo.getEventHeadlines($scope.ricsForCAP,dateUtils.normalizeDate($scope.dateRange.start,"yyyy-MM-dd"),dateUtils.normalizeDate($scope.dateRange.end,"yyyy-MM-dd"),$scope.earningsCallsAndPresentationsCategory,invalidateCache,"ric")},getEarningsCAPSuccess=function(data){if(piwik.trackDataLoad($scope,data),data.eventHeadlines&&data.eventHeadlines.earnings&&data.eventHeadlines.earnings.length){var earningsCAPData=processData(data.eventHeadlines.earnings);$scope.companies.forEach(function(earningsRelease){earningsCAPData.forEach(function(earningsCAP){earningsRelease.ric===earningsCAP.ric&&(earningsRelease.callAndPresentation=earningsCAP)})})}};eventDispatcher.on($scope.eventId+".DATE_RANGE.FILTER.CHANGED",function(e,data){angular.isDefined(data.from)&&angular.isDefined(data.to)&&(eventDispatcher.trigger($scope.pageEventId+".PAGE.CHANGED",1),$scope.dateRange={start:dateUtils.normalizeDate(data.from,"yyyy-MM-dd"),end:dateUtils.normalizeDate(data.to,"yyyy-MM-dd")})},!0,$element),eventDispatcher.on($scope.pageEventId+".PAGE.CHANGED",function(e,data){data&&$scope.currentPage!==data&&($scope.currentPage=data)},null,$element),$scope.$watch("currentPage",function(newVal,oldVal){newVal&&newVal!==oldVal&&""!==newVal&&$scope.api.load()}),$scope.$watch("dateRange",function(newVal,oldVal){newVal&&newVal!==oldVal&&""!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.companies||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviEconomicEventsTable",["APP_CONFIG","$templateCache","$timeout","labels","fundInfo","piwik","loader","eventDispatcher","widget","grid","dateUtils",function(APP_CONFIG,$templateCache,$timeout,labels,fundInfo,piwik,loader,eventDispatcher,widget,grid,dateUtils){return{replace:!1,scope:{dateRange:"@",eventId:"@",pageEventId:"@"},template:$templateCache.get("economicEventsTable/economicEventsTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="economicEventsTable",this.friendlyName="Economic Events Table",this.eventName="ECONOMIC",$scope.companies=null,$scope.sortable=!0,$scope.category="Economic",$scope.totalRecords=null,$scope.currentPage=1,$scope.pageSize=20,svi.ng.defaultString($scope,$attrs,"eventId","ECONOMIC_EVENTS"),svi.ng.defaultString($scope,$attrs,"pageEventId","ECONOMIC_PAGING");try{svi.ng.parseJSON($scope,$attrs,"dateRange")}catch(e){throw"Unable to parse JSON: "+e}labels.setupLabels($scope,["general","economicEventsTable"]),$scope.responsiveColumns=!0,$scope.columnPriority=["name","date","period","actual","expected","previous","change","lastUpdate","classification","country"],grid.attachSorting($scope,$element,$attrs,"name","asc"),grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){return $scope.companies=[],fundInfo.getEventsTable($scope.category,dateUtils.normalizeDate($scope.dateRange.start,"yyyy-MM-dd"),dateUtils.normalizeDate($scope.dateRange.end,"yyyy-MM-dd"),$scope.sortDir,$scope.sortField,$scope.pageSize,$scope.currentPage,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{data.eventsTable.economic&&data.eventsTable.economic.length?($scope.companies=data.eventsTable.economic.map(function(company){return{name:company.name.replace("United States-",""),classification:company.classification.replace(/([A-Z]+)/g," $1").replace(/([A-Z][a-z])/g," $1"),country:company.country,date:company.date,period:company.period.replace("w/o","As of "),actual:company.actual,expected:company.expected,previous:company.previous,change:company.change,lastUpdate:company.lastUpdate}}),$scope.totalRecords=data.eventsTable.totalRecords,$scope.totalPages=Math.ceil($scope.totalRecords/$scope.pageSize)):$scope.loader.setMessage($scope.labels.economicNoData)}catch(e){throw"sviDividendsEventsTable: "+e}}),widget.attach($scope,$element),eventDispatcher.on($scope.eventId+".DATE_RANGE.FILTER.CHANGED",function(e,data){angular.isDefined(data.from)&&angular.isDefined(data.to)&&(eventDispatcher.trigger($scope.pageEventId+".PAGE.CHANGED",1),$scope.dateRange={start:dateUtils.normalizeDate(data.from,"yyyy-MM-dd"),end:dateUtils.normalizeDate(data.to,"yyyy-MM-dd")})},null,$element),eventDispatcher.on($scope.pageEventId+".PAGE.CHANGED",function(e,data){data&&$scope.currentPage!==data&&($scope.currentPage=data)},null,$element),$scope.$watch("currentPage",function(newVal,oldVal){newVal&&newVal!==oldVal&&""!==newVal&&$scope.api.load()}),$scope.$watch("dateRange",function(newVal,oldVal){null!==newVal&&""!==newVal&&newVal!==oldVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.companies||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviEtfDetails",["APP_CONFIG","$templateCache","$timeout","loader","fundInfo","piwik","labels","eventDispatcher","widget",function(APP_CONFIG,$templateCache,$timeout,loader,fundInfo,piwik,labels,eventDispatcher,widget){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("etfDetails/etfDetails.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="EtfDetails",this.friendlyName="ETF Details";try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"etfDetails: "+e}labels.setupLabels($scope,["etfDetails"]);loader.attach($scope,$element,function(invalidateCache){$scope.data=null;var params={symbolFormat:$scope.symbolFormat};return fundInfo.getInfo($scope.symbol,invalidateCache,params)},function(data){piwik.trackDataLoad($scope,data),data.fundInfo.premiumOrDiscountPctAbsValue=Math.abs(data.fundInfo.premiumOrDiscountPct),$scope.data=data.fundInfo}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!=data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.api.isReadyToLoad=function(){return null!==$scope.symbol&&!1!==$scope.symbol&&""!==$scope.symbol},$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}],link:function($scope,$element,$attrs){}}}]),angular.module("svi.research").directive("sviEtfSymbolName",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","eventDispatcher","fundInfo",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,eventDispatcher,fundInfo){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("etfSymbolName/etfSymbolName.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="ETFSymbolName",this.friendlyName="ETF Symbol & Name";try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"sviStockSymbolName: "+e}$scope.data=null,labels.setupLabels($scope,["general","fundSymbolName"]);loader.attach($scope,$element,function(invalidateCache){$scope.data=null;var params={symbolFormat:$scope.symbolFormat};return fundInfo.getInfo($scope.symbol,invalidateCache,params)},function(data){piwik.trackDataLoad($scope,data);try{$scope.data=data.fundInfo}catch(e){throw"sviEtfSymbolName: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviEventsTableContainer",["APP_CONFIG","$templateCache","$timeout","labels","$filter","eventDispatcher","$document","dateUtils","sviUrl",function(APP_CONFIG,$templateCache,$timeout,labels,$filter,eventDispatcher,$document,dateUtils,sviUrl){return{replace:!1,scope:{eventId:"@",parentTabId:"@",defaultTab:"@"},template:$templateCache.get("eventsTableContainer/eventsTableContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="eventsTableContainer",this.friendlyName="Events Table Container",$scope.dateFormat="M/d/yyyy",$scope.findTabToggleCount=0,$scope.findTabToggleMaxCount=10,svi.ng.defaultString($scope,$attrs,"eventId",""),svi.ng.defaultString($scope,$attrs,"parentTabId",""),svi.ng.defaultString($scope,$attrs,"defaultTab","");var today=new Date,updateDropdownOptions=function(){var t,d,day,diff;$scope.dropdownOptions=[{display:$scope.labels.dateRange,value:"custom"},{display:$scope.labels.today,value:{from:today.getTime(),to:today.getTime()}},{display:$scope.labels.thisWeek,value:{from:(d=today,day=(d=new Date(d)).getDay(),diff=d.getDate()-day+(0===day?-6:1),new Date(d.setDate(diff))).getTime(),to:(t=today.getDate()+(6-today.getDay()-1),(new Date).setDate(t))}},{display:$scope.labels.thisMonth,value:{from:new Date(today.getFullYear(),today.getMonth(),1).getTime(),to:new Date(today.getFullYear(),today.getMonth()+1,0).getTime()}}]},getTabCtrl=svi.ng.getControllerFactory($element,$scope,"svi-tabs");if(labels.setupLabels($scope,["general","eventsTableContainer"],{dateRange:"Date Range",today:"Today",thisWeek:"This Week",thisMonth:"This Month"}).then(function(){var tabs=getTabCtrl();tabs&&$timeout(tabs.updateTabs),updateDropdownOptions()}),updateDropdownOptions(),this.switchToTab=function(targetId){if(0<$element.find(".tab-controls a.nav-link").length){var targetIndex=!1,tabEl=$element.find('.tab-controls a.nav-link[data-tab-id="'+targetId+'"]');tabEl&&(targetIndex=parseInt(tabEl.attr("data-tab-index")));var tabs=getTabCtrl();tabs&&!1!==targetIndex&&!isNaN(targetIndex)&&tabs.selectTab(targetIndex)}else $scope.findTabToggleCount<=$scope.findTabToggleMaxCount&&$timeout(function(){$scope.api.switchToTab(targetId)},APP_CONFIG.autoLoadDelay)},sviUrl.getSearchParamsFromQuery().date){var date=sviUrl.getSearchParamsFromQuery().date;$scope.dateRange={start:$filter("sviDate")(date,$scope.dateFormat,!1),end:$filter("sviDate")(date,$scope.dateFormat,!1)}}else $scope.dateRange={start:$filter("sviDate")(today,$scope.dateFormat,!1),end:$filter("sviDate")(today,$scope.dateFormat,!1)};$scope.$watch("dateRange",function(newVal,oldVal){null!==newVal&&newVal!==oldVal&&($scope.dateRange=newVal)}),eventDispatcher.on("EVENTS.DATE_RANGE.FILTER.CHANGED",function(e,data){if(data.hasOwnProperty("from")&&data.hasOwnProperty("to")){var from=dateUtils.normalizeDate(data.from,$scope.dateFormat),to=dateUtils.normalizeDate(data.to,$scope.dateFormat);$scope.dateRange.start===from&&$scope.dateRange.end===to||($scope.dateRange.start=from,$scope.dateRange.end=to,$scope.pageSize&&eventDispatcher.trigger("EVENTS.PAGE.CHANGED",1),data.hasOwnProperty("fromQuickDateRange")&&data.fromQuickDateRange||eventDispatcher.trigger("EVENTS.QUICK_DATE_RANGE.FILTER.CHANGED",{value:"custom"}))}},!0,$element),eventDispatcher.on("EVENTS.QUICK_DATE_RANGE.FILTER.CHANGED",function(e,data){data.hasOwnProperty("value")&&angular.isObject(data.value)&&data.value.hasOwnProperty("from")&&data.value.hasOwnProperty("to")&&(data.value.fromQuickDateRange=!0,eventDispatcher.trigger("EVENTS.DATE_RANGE.FILTER.CHANGED",data.value))},!0,$element),$scope.eventId&&eventDispatcher.on($scope.eventId+".SELECT.TAB",function(e,data){angular.isString(data)&&""!==data&&($scope.parentTabId&&$document.find('.nav-tabs a[href="#'+$scope.parentTabId+'"]').tab("show"),$scope.api.switchToTab(data))}),$scope.$watch("dateRange",function(newVal,oldVal){null!==newVal&&newVal!==oldVal&&($scope.dateRange=newVal)})}],link:function($scope,$element,$attrs){$scope.defaultTab&&$timeout(function(){$scope.api.switchToTab($scope.defaultTab)},APP_CONFIG.autoLoadDelay)}}}]),angular.module("svi.research").directive("sviFundAssetAllocation",["APP_CONFIG","$templateCache","$timeout","labels","loader","fundInfo","highcharts","piwik","eventDispatcher","widget",function(APP_CONFIG,$templateCache,$timeout,labels,loader,fundInfo,highcharts,piwik,eventDispatcher,widget){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("fundAssetAllocation/fundAssetAllocation.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundAssetAllocation",this.friendlyName="Fund Asset Allocation",svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),$scope.funds=null,$scope.date=null,labels.setupLabels($scope,["general","fundAssetAllocation"]);$scope.getOptions=function(){return{chart:{type:"pie",renderTo:$element.find(".asset-allocation-pie")[0],height:$element.find(".asset-allocation-pie").height()||250,width:$element.find(".asset-allocation-pie").height()||250},title:null,credits:{enabled:!1},scrollbar:{enabled:!1},rangeSelector:{enabled:!1},tooltip:{pointFormat:"{point.name}: <b>{point.y:.2f}%</b>",headerFormat:null},accessibility:{point:{valueSuffix:"%"},landmarkVerbosity:"disabled",description:"Pie chart showing the Fund Asset Allocation"},exporting:{chartOptions:{title:{text:$scope.labels.fundAssetAllocationTitle}}},plotOptions:{pie:{dataLabels:{enabled:!1},innerSize:150,size:"110%"}},series:[{type:"pie",innerSize:"60%",data:[]}]}};var processData=function(data){return data.map(function(item,index){return{name:item.name,y:item.value,color:APP_CONFIG.chartColors.graphicColors[index].color}})};loader.attach($scope,$element,function(invalidateCache){$scope.funds=null;var params={symbolFormat:$scope.symbolFormat};return fundInfo.getFundAssetAllocation($scope.symbol,invalidateCache,params)},function(data){piwik.trackPage($scope,data);try{$scope.date=data.assetAllocation.asOf,$scope.funds=processData(data.assetAllocation.assetAllocation);var options=$.extend(!0,{},$scope.getOptions());options.series[0].data=processData(data.assetAllocation.assetAllocation),$scope.chart&&$scope.chart.destroy(),$scope.chart=highcharts.getChart(options)}catch(e){throw"sviFundAssetAllocation: "+e}}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.funds||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundDetails",["APP_CONFIG","$templateCache","$timeout","labels","loader","fundInfo","piwik","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,fundInfo,piwik,eventDispatcher){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("fundDetails/fundDetails.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="keyFundDetails",this.friendlyName="Key Fund Details",this.showLoad=!0;try{svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"sviFundDetails: "+e}labels.setupLabels($scope,["general","fundDetails"]);var setLoad=function(tags){return tags.frontEndLoad?$scope.labels.frontEndLoad:tags.institutionalLoad?APP_CONFIG.naValue:tags.backEndLoad?$scope.labels.backEndLoad:tags.levelLoad?$scope.labels.levelLoad:tags.noLoad?$scope.labels.noLoad:void 0};loader.attach($scope,$element,function(invalidateCache){return $scope.data=null,fundInfo.getInfo($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data),$scope.data=data.fundInfo,$scope.data.load=setLoad(data.fundInfo.tags)}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&(data.symbol=data.symbol.toUpperCase(),$scope.symbol!=data.symbol&&($scope.symbol=data.symbol))},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundDistribution",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","fundInfo","piwik","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,fundInfo,piwik,eventDispatcher){return{scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("fundDistribution/fundDistribution.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundDistribution",this.friendlyName="Fund Distribution",$scope.dividends=null,$scope.totalRecords=5,labels.setupLabels($scope,["general","fundDistribution"]),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto");loader.attach($scope,$element,function(invalidateCache){$scope.dividends=null;var params={perCategory:$scope.totalRecords,symbolFormat:$scope.symbolFormat};return fundInfo.getFundDistributions($scope.symbol,params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.dividends=data.fundDistributions.dividends}catch(e){throw"sviFundDistribution: "+e}}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&(data.symbol=data.symbol.toUpperCase(),$scope.symbol!=data.symbol&&($scope.symbol=data.symbol))},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.dividends||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundEsgTable",["APP_CONFIG","$templateCache","$timeout","$templateRequest","loader","labels","eventDispatcher","piwik","fundInfo","$filter","floatThead","grid",function(APP_CONFIG,$templateCache,$timeout,$templateRequest,loader,labels,eventDispatcher,piwik,fundInfo,$filter,floatThead,grid){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("fundEsgTable/fundEsgTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundESGTable",this.friendlyName="Fund ESG Table",$scope.esgData=null,$scope.esgTableHeader=null,$scope.sortable=!1,svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),$scope.responsiveColumnsSettings={enabled:!0,priority:["scoringMeasures","M1","M2","M3","M4","M5","M6","M7","M8","M9","M10","M11","M12"],breakpoints:{xs:3,sm:4,md:4}},labels.setupLabels($scope,["fundESGTable"]),floatThead.init($scope,$element),grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){$scope.esgData=null;var params={symbolFormat:$scope.symbolFormat,timespan:"-1 year"};return fundInfo.getLipperFundESGSummary($scope.symbol,invalidateCache,params)},function(data){piwik.trackDataLoad($scope,data),labels.get(["fundESGTable"]).then(function(){if(data.lipperFundESGSummary.esgSummaries&&data.lipperFundESGSummary.esgSummaries.length){var seriesData=function(data){var headers=[],result={};return $scope.colspan=data.length+1,result[$scope.labels.esgScore]={isHeader:!0,data:[]},result[$scope.labels.esgCoverageValue]={isHeader:!0,data:[],isLast:!0},result[$scope.labels.environmentalPillarScore]={isHeader:!0,data:[]},result[$scope.labels.resourceUseScore]={isHeader:!1,data:[]},result[$scope.labels.emissionsScore]={isHeader:!1,data:[]},result[$scope.labels.environmentalInnovationScore]={isHeader:!1,data:[],isLast:!0},result[$scope.labels.socialPillarScore]={isHeader:!0,data:[]},result[$scope.labels.workforceScore]={isHeader:!1,data:[]},result[$scope.labels.humanRightsScore]={isHeader:!1,data:[]},result[$scope.labels.communityScore]={isHeader:!1,data:[]},result[$scope.labels.productResponsibilityScore]={isHeader:!1,data:[],isLast:!0},result[$scope.labels.governancePillarScore]={isHeader:!0,data:[]},result[$scope.labels.managementScore]={isHeader:!1,data:[]},result[$scope.labels.shareholdersScore]={isHeader:!1,data:[]},result[$scope.labels.csrStrategyScore]={isHeader:!1,data:[]},data.reverse().forEach(function(item){headers.push($filter("sviDate")(item.date,"MM/dd/yyyy")),result[$scope.labels.esgScore].data.push($filter("sviNumber")(item.esg,1,!0)),result[$scope.labels.environmentalPillarScore].data.push($filter("sviNumber")(item.environmental,1,!0)),result[$scope.labels.resourceUseScore].data.push($filter("sviNumber")(item.resourceUse,1,!0)),result[$scope.labels.emissionsScore].data.push($filter("sviNumber")(item.emissions,1,!0)),result[$scope.labels.environmentalInnovationScore].data.push($filter("sviNumber")(item.environmentalInnovation,1,!0)),result[$scope.labels.socialPillarScore].data.push($filter("sviNumber")(item.social,1,!0)),result[$scope.labels.workforceScore].data.push($filter("sviNumber")(item.workforce,1,!0)),result[$scope.labels.humanRightsScore].data.push($filter("sviNumber")(item.humanRights,1,!0)),result[$scope.labels.communityScore].data.push($filter("sviNumber")(item.community,1,!0)),result[$scope.labels.productResponsibilityScore].data.push($filter("sviNumber")(item.productResponsibility,1,!0)),result[$scope.labels.governancePillarScore].data.push($filter("sviNumber")(item.governance,1,!0)),result[$scope.labels.managementScore].data.push($filter("sviNumber")(item.management,1,!0)),result[$scope.labels.shareholdersScore].data.push($filter("sviNumber")(item.shareholders,1,!0)),result[$scope.labels.csrStrategyScore].data.push($filter("sviNumber")(item.csrStrategy,1,!0)),result[$scope.labels.esgCoverageValue].data.push($filter("percent")(item.coverage,1))}),{headers:headers,esgSummaries:result}}(data.lipperFundESGSummary.esgSummaries);$scope.esgTableHeader=seriesData.headers,$scope.esgData=seriesData.esgSummaries}})}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){$scope.data=null,angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$timeout(function(){$scope.initComplete=!0,$scope.esgData||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundExpenseRatios",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","fundInfo","$filter","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,fundInfo,$filter,eventDispatcher){return{scope:{symbol:"@"},template:$templateCache.get("fundExpenseRatios/fundExpenseRatios.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundExpenseRatios",this.friendlyName="Fund Expense Ratios",$scope.header=null,$scope.funds=null,$scope.colspan=null,$scope.years=5,$scope.sortable=!1,$scope.responsiveColumnsSettings={enabled:!0,priority:["name","Y1","Y2","Y3","Y4","Y5","Y6","Y7","Y8","Y9","Y10"]},labels.setupLabels($scope,["fundExpenseRatios"]);loader.attach($scope,$element,function(invalidateCache){$scope.funds=null;var params={years:$scope.years};return fundInfo.getFundExpenses($scope.symbol,params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{labels.get(["fundExpenseRatios"]).then(function(){var expenses,header,result,seriesData=(expenses=data.fundExpenses.expenses,header=[],(result={})[$scope.labels.prospectusGross12b1FeeRatio]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.prospectusGrossOtherExpenseRatio]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.prospectusGrossAcquiredFundExpenseRatio]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.prospectusGrossExpenseRatio]={isHeader:!1,isBold:!0,isLast:!0,data:[]},result[$scope.labels.prospectusNetManagementFeeRatio]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.prospectusNet12b1FeeRatio]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.prospectusNetOtherExpenseRatio]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.prospectusNetAcquiredFundExpenseRatio]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.prospectusNetExpenseRatio]={isHeader:!1,isBold:!0,isLast:!0,data:[]},result[$scope.labels.totalNetExpensesPct]={isHeader:!1,isBold:!0,isLast:!1,data:[]},expenses.forEach(function(item){header.push(item.year),result[$scope.labels.prospectusGross12b1FeeRatio].data.push($filter("sviNumber")(item.prospectusGross12b1FeeRatio,2,!0,!1)),result[$scope.labels.prospectusGrossOtherExpenseRatio].data.push($filter("sviNumber")(item.prospectusGrossOtherExpenseRatio,2,!0,!1)),result[$scope.labels.prospectusGrossAcquiredFundExpenseRatio].data.push($filter("sviNumber")(item.prospectusGrossAcquiredFundExpenseRatio,2,!0,!1)),result[$scope.labels.prospectusGrossExpenseRatio].data.push($filter("sviNumber")(item.prospectusGrossExpenseRatio,2,!0,!1)),result[$scope.labels.prospectusNetManagementFeeRatio].data.push($filter("sviNumber")(item.prospectusNetManagementFeeRatio,2,!0,!1)),result[$scope.labels.prospectusNet12b1FeeRatio].data.push($filter("sviNumber")(item.prospectusNet12b1FeeRatio,2,!0,!1)),result[$scope.labels.prospectusNetOtherExpenseRatio].data.push($filter("sviNumber")(item.prospectusNetOtherExpenseRatio,2,!0,!1)),result[$scope.labels.prospectusNetAcquiredFundExpenseRatio].data.push($filter("sviNumber")(item.prospectusNetAcquiredFundExpenseRatio,2,!0,!1)),result[$scope.labels.prospectusNetExpenseRatio].data.push($filter("sviNumber")(item.prospectusNetExpenseRatio,2,!0,!1)),result[$scope.labels.totalNetExpensesPct].data.push($filter("sviNumber")(item.totalNetExpensesPct,2,!0,!1))}),{header:header,expenses:result,colspan:header.length+1});$scope.header=seriesData.header,$scope.funds=seriesData.expenses,$scope.colspan=seriesData.colspan})}catch(e){throw"sviFundExpenseRatios: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.funds||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundExpenseRatioSummary",["APP_CONFIG","$templateCache","$timeout","labels","loader","fundInfo","piwik","eventDispatcher","$filter",function(APP_CONFIG,$templateCache,$timeout,labels,loader,fundInfo,piwik,eventDispatcher,$filter){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("fundExpenseRatioSummary/fundExpenseRatioSummary.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundExpenseRatioSummary",this.friendlyName="Fund Expense Ratio Summary",$scope.years=5,$scope.displayLimit=3,$scope.funds=null;try{svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"sviFundExpenseRatioSummary: "+e}$scope.sortable=!1,$scope.responsiveColumnsSettings={enabled:!0,priority:["name","Y1","Y2","Y3"]},labels.setupLabels($scope,["fundExpenseRatioSummary"]),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto");loader.attach($scope,$element,function(invalidateCache){$scope.funds=null;var params={years:$scope.years,symbolFormat:$scope.symbolFormat};return fundInfo.getFundExpenses($scope.symbol,params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{labels.get(["fundExpenseRatioSummary"]).then(function(){if(data.fundExpenses.expenses.length){var seriesData=(expenses=data.fundExpenses.expenses,header=[],(result={})[$scope.labels.grossExpenseRatio]=[],result[$scope.labels.netExpenseRatio]=[],result[$scope.labels.totalNetExpensesPct]=[],expenses.slice(0,$scope.displayLimit).forEach(function(item){header.push(item.year),result[$scope.labels.grossExpenseRatio].push($filter("sviNumber")(item.prospectusGrossExpenseRatio,2,!0,!1)),result[$scope.labels.netExpenseRatio].push($filter("sviNumber")(item.prospectusNetExpenseRatio,2,!0,!1)),result[$scope.labels.totalNetExpensesPct].push($filter("sviNumber")(item.totalNetExpensesPct,2,!0,!1))}),{header:header,expenses:result,colspan:header.length+1});$scope.header=seriesData.header,$scope.funds=seriesData.expenses,$scope.colspan=seriesData.colspan}var expenses,header,result})}catch(e){throw"sviFundExpenseRatioSummary: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&(data.symbol=data.symbol.toUpperCase(),$scope.symbol!=data.symbol&&($scope.symbol=data.symbol))},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),$timeout(function(){$scope.funds||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundGeographicExposure",["APP_CONFIG","$templateCache","$timeout","labels","loader","fundInfo","highcharts","piwik","eventDispatcher","widget",function(APP_CONFIG,$templateCache,$timeout,labels,loader,fundInfo,highcharts,piwik,eventDispatcher,widget){return{scope:{symbol:"@",parentTabSelector:"@",symbolFormat:"@"},template:$templateCache.get("fundGeographicExposure/fundGeographicExposure.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundGeographicExposure",this.friendlyName="Fund Geographic Exposure",$scope.countries=null,$scope.region=null,$scope.countryChart=null,$scope.asOf=null,$scope.countriesLimit=10,svi.ng.defaultString($scope,$attrs,"parentTabSelector",'.svi-sub-page-nav a[data-toggle="tab"]'),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),labels.setupLabels($scope,["general","fundGeographicExposure"]),$scope.getOptions=function(elem){return{chart:{map:"custom/world",type:"map",height:$element.find(elem).height()||300,renderTo:$element.find(elem)[0]},title:null,subtitle:null,accessibility:{landmarkVerbosity:"disabled"},xAxis:{visible:!1},yAxis:{visible:!1},legend:{enabled:!1},credits:{enabled:!1},exporting:{enabled:!1},scrollbar:{enabled:!1},rangeSelector:{enabled:!1},mapNavigation:{enabled:!0,buttonOptions:{verticalAlign:"bottom"}},series:[{name:"World",type:"map",nullColor:"#f8f8f8",enableMouseTracking:!1},{type:"mapbubble",joinBy:["iso-a3","code3"],data:[],minSize:4,color:"#337ab7",maxSize:"12%",tooltip:{useHTML:!0,valueDecimals:2,pointFormat:"<b>{point.properties.name}:</b> {point.z}%",headerFormat:null}}]}};loader.attach($scope,$element,function(invalidateCache){$scope.countries=[];var params={symbolFormat:$scope.symbolFormat};return fundInfo.getFundGeographicExposure($scope.symbol,invalidateCache,params)},function(data){piwik.trackDataLoad($scope,data);try{highcharts.loadMap("custom/world").then(function(){if(!data.geographicExposure.geographicExposure.length&&$scope.countryChart)$scope.countryChart.destroy();else{var options=$.extend(!0,{},$scope.getOptions(".country-view-map"));options.series[1].data=data.geographicExposure.geographicExposure.map(function(country){return{code:country.name,z:country.value,code3:country.code}}),$scope.countries=options.series[1].data,$scope.asOf=data.geographicExposure.asOf,$scope.countryChart=highcharts.getMapChart(options)}})}catch(e){throw $scope.countryChart&&$scope.countryChart.destroy(),"sviFundGeographicExposure: "+e}},function(reason){piwik.trackPage("fundGeographicExposure/error","Error: Fund Geographic Exposure",!1),$scope.countryChart&&$scope.countryChart.destroy()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.countryChart||($scope.api.load(),$scope.parentTabSelector&&angular.element($scope.parentTabSelector).on("shown.bs.tab",function(e){$scope.countryChart&&$scope.countryChart.reflow()}))},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundGrowth",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","fundInfo","piwik","highcharts","$filter","eventDispatcher","$compile",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,fundInfo,piwik,highcharts,$filter,eventDispatcher,$compile){var rangeButtons=[{type:"month",count:1,text:"1M",title:"1 Month",filter:"OneMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:3,text:"3M",title:"3 Month",filter:"ThreeMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:6,title:"6 Month",text:"6M",filter:"SixMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"ytd",text:"YTD",title:"Year to date",filter:"YTD",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:12,title:"1 Year",text:"1Y",filter:"OneYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:36,title:"3 Year",text:"3Y",filter:"ThreeYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:60,title:"5 Year",text:"5Y",filter:"FiveYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"all",title:"10 Year",text:"10Y",filter:"TenYear"}];return{replace:!1,scope:{symbol:"@",timespan:"@",includeBenchmarks:"@",moreUrl:"@",initRange:"@",parentTabSelector:"@",template:"@",symbolFormat:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundGrowthOf10K",this.friendlyName="Fund Growth of 10K";$scope.chart=null;try{svi.ng.defaultTrue($scope,$attrs,"includeBenchmarks"),svi.ng.defaultValidString($scope,$attrs,"timespan",["Today","WTD","MTD","YTD","OneDay","OneWeek","OneMonth","ThreeMonth","SixMonth","OneYear","ThreeYear","FiveYear","TenYear"],"TenYear"),svi.ng.defaultValidString($scope,$attrs,"TenYear",["TenYear","FiveYear","ThreeYear","OneYear"]),svi.ng.defaultString($scope,$attrs,"parentTabSelector",'.svi-sub-page-nav a[data-toggle="tab"]'),svi.ng.defaultValidString($scope,$attrs,"template",["","Chart"],""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"sviFundGrowth: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl",""),labels.setupLabels($scope,["general","fundGrowth"]),$scope.getOptions=function(){var currencyFilter=$filter("sviCurrency");return{chart:{type:"line",renderTo:$element.find(".fund-growth-chart")[0],height:$element.find(".fund-growth-chart").height()||400,reflow:!0,marginTop:30,events:{render:function(evt){this.currentSymbol=this.renderer.g().add();var symbolMarkup='<span style="font-size:15px; font-weight: bold">'+$scope.symbol+"</span>";this.renderer.text(symbolMarkup,10,15).add(this.currentSymbol),this.rangeDropdownLabel&&(this.rangeDropdownLabel.destroy(),this.rangeDropdownLabel=undefined),evt.target.rangeSelector.hasVisibleDropdown?($element.find(".fund-growth-chart div select > option[disabled]").css({display:"none"}),0===this.rangeSelector.options.buttonPosition.x&&(this.rangeSelector.options.buttonPosition.x=-15,this.rangeSelector.render()),this.rangeDropdownLabel=this.renderer.g().add(),this.renderer.text('<span style="font-size:12px; color: #666666">'+this.options.lang.rangeSelectorZoom+"</span>",0,evt.target.rangeSelector.dropdown.offsetTop+12).add(this.rangeDropdownLabel)):this.rangeDropdownLabel&&(this.rangeDropdownLabel.destroy(),this.rangeDropdownLabel=null)}}},accessibility:{landmarkVerbosity:"disabled",description:"Chart showing Fund Growth of 10K"},title:{text:" "},credits:{enabled:!1},scrollbar:{enabled:!1},rangeSelector:{enabled:!0,allButtonsEnabled:!0,inputEnabled:!1,buttons:rangeButtons,verticalAlign:"bottom",selected:highcharts.getSelectedTimespanIndex(rangeButtons,$scope.timespan),buttonTheme:highcharts.getRangeSelectorButtonsStyle()},xAxis:{type:"datetime",minRange:36e5,title:null,tickLength:0,dateTimeLabelFormats:{month:"%b '%y",year:"%Y"},events:{setExtremes:function(evt){if(angular.isDefined(evt.rangeSelectorButton)){var isCurrentActive=!1;return this.chart.rangeSelector.buttons.forEach(function(btn){2===btn.state&&evt.rangeSelectorButton.text===btn.textStr&&(isCurrentActive=!0)}),$scope.api.setTimespan(evt.rangeSelectorButton.filter),isCurrentActive&&$timeout($scope.api.load(),APP_CONFIG.autoLoadDelay),!1}}},crosshair:{width:2,dashStyle:"LongDash"},labels:{style:{fontSize:"12px"}}},yAxis:{title:null,opposite:!1,tickPositioner:function(){var max=this.dataMax,baseTicks=[0,1e4];return max<=6e4?baseTicks.push(25e3,5e4):max<=11e4?baseTicks.push(25e3,5e4,75e3,1e5):max<=16e4?baseTicks.push(5e4,1e5,15e4):max<=21e4&&baseTicks.push(5e4,1e5,15e4,2e5),baseTicks},labels:{formatter:function(){return"$"+this.value/1e3+"k"},style:{fontSize:"12px"}},plotLines:[{color:"#697A8B",width:2,value:1e4,dashStyle:"LongDash"}]},legend:{enabled:!0,align:"right",itemStyle:{textDecoration:"none",color:"#05c"},itemHoverStyle:{textDecoration:"underline"}},plotOptions:{series:{showInNavigator:!0,marker:{enabled:!1}}},tooltip:{pointFormatter:function(){return"<b>"+currencyFilter(this.y)+"</b>"},headerFormat:null},exporting:{chartOptions:{title:{text:$scope.labels.fundGrowthTitle}}},series:[{name:$scope.symbol,data:[],color:APP_CONFIG.chartColors.graphicColors[0].color}]}};this.setTimespan=function(timespan){$scope.$applyAsync(function(){$scope.timespan=timespan})};var processData=function(data){return data.map(function(item){return[1e3*moment(item.date).unix(),item.value]})};loader.attach($scope,$element,function(invalidateCache){var params={includeBenchmarks:$scope.includeBenchmarks?"Y":"N",timespan:$scope.timespan,symbolFormat:$scope.symbolFormat};return fundInfo.getFundGrowth($scope.symbol,params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{var options=$.extend(!0,{},$scope.getOptions()),performance=data.performance.performance;options.series[0].data=processData(performance),$scope.includeBenchmarks&&data.performance.benchmarks.map(function(benchmark,index){return benchmark&&benchmark.performance&&(benchmark.performance=benchmark.performance.filter(function(item){return new Date(item.date)>=(data=performance,Math.min.apply(null,data.map(function(item){return new Date(item.date)})));var data}),options.series.push({name:benchmark.name,data:processData(benchmark.performance),color:APP_CONFIG.chartColors.graphicColors[index+1].color})),benchmark.name}),options.xAxis.range="TenYear"===$scope.initRange?0:"FiveYear"===$scope.initRange?15778476e4:"ThreeYear"===$scope.initRange?94670856e3:"OneYear"===$scope.initRange?31556952e3:0,$scope.chart=highcharts.getStockChart(options)}catch(e){throw $scope.chart&&($scope.chart.destroy(),$scope.chart=null),"sviFundGrowth: "+e}},function(){piwik.trackPage("fundGrowth/error","Error: Fund Growth",!1),$scope.chart&&$scope.chart.destroy()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.$watch("timespan",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)}}],link:function($scope,$element){var template=$templateCache.get("fundGrowth/fundGrowth"+$scope.template+".tpl.html");$element.html(template).show(),$compile($element.contents())($scope),$timeout(function(){$scope.chart||($scope.api.load(),$scope.parentTabSelector&&angular.element($scope.parentTabSelector).on("shown.bs.tab",function(){$scope.chart&&$scope.chart.reflow()}))},APP_CONFIG.autoLoadDelay)}}}]),angular.module("svi.research").directive("sviFundHoldingsTable",["APP_CONFIG","$templateCache","$timeout","loader","labels","eventDispatcher","piwik","fundInfo","grid",function(APP_CONFIG,$templateCache,$timeout,loader,labels,eventDispatcher,piwik,fundInfo,grid){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("fundHoldingsTable/fundHoldingsTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundHoldingsTable",this.friendlyName="Fund Holdings Table",$scope.pageEventId="FUND.HOLDINGS.TABLE",$scope.currentPage=1,$scope.pageSize=25,$scope.fundHoldings=null,$scope.sortable=!1,$scope.naValue=APP_CONFIG.naValue,svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),labels.setupLabels($scope,["fundHoldingsTable"]),$scope.responsiveColumnsSettings={enabled:!0,priority:["ticker","holding","price","dayChangePercent","dayHighLow","volume","weekHighLow52","dayChange","currency","portfolioWeight"]},$scope.colspan=$scope.responsiveColumnsSettings.priority.length,grid.attachSorting($scope,$element,$attrs,"ticker","asc"),grid.attachGrid($scope,$element);this.getTicker=function(){return"<span>"+$scope.labels.ticker+"</span><sup>1</sup>"},loader.attach($scope,$element,function(invalidateCache){$scope.fundHoldings=null;var params={includeQuotes:"Y",pageSize:$scope.pageSize,pageNum:$scope.currentPage,symbolFormat:$scope.symbolFormat};return fundInfo.getTopHoldings($scope.symbol,params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data),$scope.fundHoldings=data.holdings.topHoldings,$scope.totalRecords=data.holdings.totalRecords,$scope.totalPages=data.holdings.pageCount}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){$scope.data=null,angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),eventDispatcher.on($scope.pageEventId+".PAGE.CHANGED",function(e,data){data&&$scope.currentPage!==data&&($scope.currentPage=data)},null,$element),$scope.$watch("currentPage",function(newVal,oldVal){newVal&&newVal!==oldVal&&""!==newVal&&$scope.api.load()}),$timeout(function(){$scope.initComplete=!0,$scope.fundHoldings||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundLoadAndMinimums",["APP_CONFIG","$templateCache","$timeout","loader","widget","labels","eventDispatcher","piwik","fundInfo",function(APP_CONFIG,$templateCache,$timeout,loader,widget,labels,eventDispatcher,piwik,fundInfo){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("fundLoadAndMinimums/fundLoadAndMinimums.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundLoadAndMinimums",this.friendlyName="Fund Load and Minimums",$scope.minimums=null,$scope.loads=null,$scope.maxLoad=null,$scope.tags=null,labels.setupLabels($scope,["general","fundLoadAndMinimums"]),svi.ng.defaultString($scope,$attrs,"symbol","");loader.attach($scope,$element,function(invalidateCache){return $scope.loads=[],$scope.maxLoad=null,$scope.load=null,$scope.minimums=null,fundInfo.getInfo($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.minimums=data.fundInfo,$scope.loads=data.fundInfo.breakpoints?data.fundInfo.breakpoints.map(function(item){return(item.from||item.to)&&(item.from||(item.from=0)),item}):null,$scope.maxLoad=$scope.loads?function(loads){return Math.max.apply(this,loads.map(function(item){return item.value}))}($scope.loads):0,$scope.load=((tags=data.fundInfo.tags).indexTracking=!1,tags.sociallyResponsible=!1,tags.etf=!1,2<=function(tags,val){return tags.filter(function(tag){return tag===val}).length}(Object.values(tags),!0)?$scope.labels.levelLoad:tags.backEndLoad?$scope.labels.backEndLoad:tags.frontEndLoad?$scope.labels.frontEndLoad:tags.levelLoad?$scope.labels.levelLoad:(tags.noLoad,$scope.labels.noLoad))}catch(e){throw"sviFundLoadSchedule: "+e}var tags}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.loads||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundMonthlyPriceHistory",["APP_CONFIG","$templateCache","$timeout","loader","labels","eventDispatcher","piwik","symbol","grid",function(APP_CONFIG,$templateCache,$timeout,loader,labels,eventDispatcher,piwik,symbol,grid){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("fundMonthlyPriceHistory/fundMonthlyPriceHistory.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="FundMonthlyPriceHistory",this.friendlyName="Fund Monthly Price History",this.eventName="FUND.MONTHLY.PRICE.HISTORY",$scope.fundMonthlyPriceHistory=null,$scope.sortable=!1,svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"timespan","OneYear"),svi.ng.defaultString($scope,$attrs,"interval",""),svi.ng.defaultString($scope,$attrs,"calcOhlc",""),labels.setupLabels($scope,["fundMonthlyPriceHistory"]),$scope.responsiveColumnsSettings={enabled:!0,priority:["name","open","close","low","high"]},$scope.colspan=$scope.responsiveColumnsSettings.priority.length,grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){return $scope.fundMonthlyPriceHistory=null,symbol.getMonthPriceHistory($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data),$scope.fundMonthlyPriceHistory=function(data){var result=[];return data.map(function(item){item.extendedQuote&&result.push(item)}),result.sort(function(a,b){return a.quoteTime<b.quoteTime?1:-1})}(data.symbolHistory.quotes)}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$timeout(function(){$scope.initComplete=!0,$scope.fundMonthlyPriceHistory||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundOverview",["APP_CONFIG","$templateCache","$timeout","loader","fundInfo","piwik","labels","eventDispatcher","widget","$window",function(APP_CONFIG,$templateCache,$timeout,loader,fundInfo,piwik,labels,eventDispatcher,widget,$window){return{replace:!1,scope:{symbol:"@",moreUrl:"@",symbolFormat:"@"},template:$templateCache.get("fundOverview/fundOverview.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundOverview",this.friendlyName="Fund Overview",$scope.overview=null,labels.setupLabels($scope,["general","fundOverview"]);try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),$scope.expanded=!1,$scope.showMoreLess=!1}catch(e){throw"fundOverview: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl",""),this.toggle=function(){$scope.expanded=!$scope.expanded};var showHideMoreLessButton=function(){var strategyTextElement=$element.find(".strategy-text"),strategyTextExpandedElement=$element.find(".strategy-text-expanded");strategyTextElement.length?($scope.strategyTextHeight=strategyTextElement[0].offsetHeight,$scope.showMoreLess=strategyTextElement[0].offsetHeight<strategyTextElement[0].scrollHeight):$scope.strategyTextHeight&&strategyTextExpandedElement&&($scope.strategyTextHeight<strategyTextExpandedElement[0].offsetHeight?$scope.showMoreLess=!0:($scope.expanded=!1,$scope.showMoreLess=!1))};angular.element($window).bind("resize",function(e){showHideMoreLessButton(),$scope.$applyAsync()}),loader.attach($scope,$element,function(invalidateCache){$scope.overview=null;var params={symbolFormat:$scope.symbolFormat};return fundInfo.getInfo($scope.symbol,invalidateCache,params)},function(data){piwik.trackDataLoad($scope,data);try{$scope.overview=data.fundInfo,angular.isObject($scope.overview)||($scope.overview={})}catch(e){$scope.overview={}}$timeout(showHideMoreLessButton,300)}),widget.attach($scope,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.overview||$scope.api.load()},APP_CONFIG.autoLoadDelay),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element)}]}}]),angular.module("svi.research").directive("sviFundPerformanceAAG",["APP_CONFIG","$templateCache","$timeout","loader","fundInfo","piwik","labels","eventDispatcher","widget",function(APP_CONFIG,$templateCache,$timeout,loader,fundInfo,piwik,labels,eventDispatcher,widget){return{replace:!1,scope:{symbol:"@",moreUrl:"@"},template:$templateCache.get("fundPerformanceAAG/fundPerformanceAAG.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundPerformanceAAG",this.friendlyName="Fund Performance At A Glance",$scope.performance=null,$scope.includeBenchmarks=!0,labels.setupLabels($scope,["fundPerformanceAAG"]);try{svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"fundPerformanceAAG: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){throw"sviFundPerformanceAAG: "+e}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl","");loader.attach($scope,$element,function(invalidateCache){$scope.performance=null;var params={includeBenchmarks:$scope.includeBenchmarks?"Y":"N"};return fundInfo.getPerformance($scope.symbol,params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.performance=data.performance.performance,angular.isObject($scope.performance)||($scope.performance={})}catch(e){$scope.performance={}}}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.performance||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundRiskAnalysis",["APP_CONFIG","$templateCache","$templateRequest","$timeout","labels","widget","loader","grid","piwik","fundInfo","eventDispatcher","config",function(APP_CONFIG,$templateCache,$templateRequest,$timeout,labels,widget,loader,grid,piwik,fundInfo,eventDispatcher,config){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("fundRiskAnalysis/fundRiskAnalysis.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="sviFundRiskAnalysis",this.friendlyName="Fund Risk Analysis",$scope.data=null;try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"sviTopFundHoldings: "+e}$scope.responsiveColumns=!0,$scope.includeBenchmarks=!1,$scope.message="",$scope.years=["1y","3y","5y"],$scope.risks=["alpha","beta","rSquared","standardDeviation"],labels.setupLabels($scope,["general","fundRiskAnalysis"]),config.getConfig(["fundRiskAnalysis"]).then(function(response){200===response.status&&response.data.success&&angular.isObject(response.data.config)&&($scope.config=response.data.config,$scope.message=response.data.config.riskAnalysis.helpText)}),grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){$scope.data=null;var params={includeBenchmarks:$scope.includeBenchmarks?"Y":"N",symbolFormat:$scope.symbolFormat};return fundInfo.getFundRiskAnalysis($scope.symbol,params,invalidateCache)},function(data){data&&(piwik.trackDataLoad($scope,data),$scope.data=data.risk)}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&(data.symbol=data.symbol.toUpperCase(),$scope.symbol!==data.symbol&&($scope.symbol=data.symbol))},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundSectorAllocation",["APP_CONFIG","$templateCache","$timeout","labels","loader","fundInfo","piwik","eventDispatcher","widget",function(APP_CONFIG,$templateCache,$timeout,labels,loader,fundInfo,piwik,eventDispatcher,widget){return{replace:!1,scope:{symbol:"@",moreUrl:"@",symbolFormat:"@"},template:$templateCache.get("fundSectorAllocation/fundSectorAllocation.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="fundSectorAllocation",this.friendlyName="Fund Sector Allocation",$scope.sectors=null,$scope.maxValue=null;try{svi.ng.parseJSON($scope,$attrs,"moreUrl"),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"sviFundSectorAllocation: "+e}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl"," "),labels.setupLabels($scope,["general","fundSectorAllocation"]);var getBarMaxLength=function(data){return Math.max.apply(null,data.map(function(item){return item.value}))};loader.attach($scope,$element,function(invalidateCache){$scope.maxValue=null,$scope.sectors=null;var params={symbolFormat:$scope.symbolFormat};return fundInfo.getSectorAllocation($scope.symbol,invalidateCache,params)},function(data){piwik.trackPage($scope,data);try{$scope.sectors=function(data){return $scope.maxValue=getBarMaxLength(data),data.map(function(item,index){return{name:item.name,value:item.value,color:APP_CONFIG.chartColors.graphicColors[index].color,barWidth:100*item.value/$scope.maxValue+"%"}})}(data.sectorAllocation.sectorAllocation)}catch(e){throw"fundSectorAllocationWidget: "+e}}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.sectors||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundStyleMap",["APP_CONFIG","$timeout","$templateCache","eventDispatcher","labels","loader","widget","piwik","fundInfo",function(APP_CONFIG,$timeout,$templateCache,eventDispatcher,labels,loader,widget,piwik,fundInfo){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("fundStyleMap/fundStyleMap.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="FundStyleMap",this.friendlyName="Fund Style Map",$scope.data=null,$scope.helpText=null,svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),labels.setupLabels($scope,["fundStyleMap"]);loader.attach($scope,$element,function(invalidateCache){$scope.data=null,$scope.helpText=null;var params={symbolFormat:$scope.symbolFormat};return fundInfo.getInfo($scope.symbol,invalidateCache,params)},function(data){if(piwik.trackDataLoad($scope,data),data.fundInfo.styleMap){var seriesData=function(data){var result=[],headers=data.styleValues.slice();return headers.unshift(""),$scope.shortContentWrapper="openEndAndVariableAnnuityUSDE"!==data.name,data.capitalizationValues.forEach(function(capitalizationItem){var tmp=[];data.styleValues.forEach(function(styleValueItem){tmp.length||tmp.push(capitalizationItem),capitalizationItem.length&&data.capitalization===capitalizationItem&&data.style===styleValueItem?($scope.helpText=$scope.labels[data.code],$scope.titleText=$scope.labels[data.name+"Title"],$scope.bubbleText=$scope.labels[data.code+"Title"],tmp.push(!0)):tmp.push(!1)}),result.push(tmp)}),{headers:headers,data:result}}(data.fundInfo.styleMap);$scope.styleMap=data.fundInfo.styleMap,$scope.headers=seriesData.headers,$scope.data=seriesData.data}else $scope.data=[]}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviFundSymbolName",["APP_CONFIG","$templateCache","$timeout","labels","loader","fundInfo","piwik","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,fundInfo,piwik,eventDispatcher){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("fundSymbolName/fundSymbolName.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="sviFundSymbolName",this.friendlyName="Fund Symbol and Name",this.showLoad=!0;try{svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"sviFundSymbolName: "+e}$scope.data=null,labels.setupLabels($scope,["general","fundSymbolName"]);loader.attach($scope,$element,function(invalidateCache){return $scope.data=null,fundInfo.getInfo($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data),$scope.data=data.fundInfo,$scope.data.load=setLoad(data.fundInfo.tags),$scope.data.name&&($scope.data.name=fundInfo.cleanFundName($scope.data.name)),data.fundInfo.fundSector||($scope.data.fundSector=$scope.labels.fundSymbolNameNoData),data.fundInfo.name||($scope.data.name=$scope.labels.fundSymbolNameNoData)});var setLoad=function(tags){if(tags){if(tags.frontEndLoad||tags.backEndLoad||tags.levelLoad)return $scope.data.showLoad=!0,tags.frontEndLoad?$scope.labels.frontEndLoad:tags.backEndLoad?$scope.labels.backEndLoad:$scope.labels.levelLoad;if(tags.noLoad)return $scope.data.showLoad=!0,$scope.labels.fundSymbolNameNoLoad;$scope.data.showLoad=!1}else $scope.data.showLoad=!1};eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviGlobalIndicesGridContainer",["APP_CONFIG","$templateCache","$timeout","labels","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,eventDispatcher){return{scope:{globalIndices:"@"},template:$templateCache.get("globalIndicesGridContainer/globalIndicesGridContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="globalIndicesGridContainer",this.friendlyName="Global Indices Grid Container",$scope.symbol="",$scope.region="",$scope.investmentType="MutualFund",$scope.shouldShowNews=!0;try{svi.ng.parseJSON($scope,$attrs,"globalIndices")}catch(e){throw"sviGlobalIndicesGrid: "+e}labels.setupLabels($scope,["general","globalIndicesGridContainer"]),eventDispatcher.on("ACTIVE.TAB.CHANGED",function(e,data){$scope.shouldShowNews="tableView"!==data.tabs.id}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){data.hasOwnProperty("symbol")&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)})}]}}]),angular.module("svi.research").directive("sviGlobalIndicesMap",["APP_CONFIG","$templateCache","$timeout","labels","symbol","piwik","loader","highcharts",function(APP_CONFIG,$templateCache,$timeout,labels,symbol,piwik,loader,highcharts){return{scope:{symbol:"@",globalIndices:"@"},template:$templateCache.get("globalIndicesMap/globalIndicesMap.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="globalIndicesMap",this.friendlyName="Global Indices Map";try{svi.ng.parseJSON($scope,$attrs,"globalIndices")}catch(e){throw"sviGlobalIndicesGrid: "+e}$scope.indices=null,$scope.map=null,$scope.delayed=!APP_CONFIG.rtqEnabled,$scope.symbolFormat="ric",labels.setupLabels($scope,["general","globalIndicesMap"]),$scope.mapOptions=function(){var indicesMap=$element.find(".indices-map");return{chart:{map:"custom/world",type:"map",height:indicesMap.height()||450,renderTo:indicesMap[0]},title:null,subtitle:null,xAxis:{visible:!1},yAxis:{visible:!1},credits:{enabled:!1},scrollbar:{enabled:!1},rangeSelector:{enabled:!1},mapNavigation:{enabled:!0,buttonOptions:{verticalAlign:"top"}},legend:{enabled:!1},plotOptions:{showInLegend:!0},accessibility:{landmarkVerbosity:"disabled"},tooltip:{useHTML:!0,valueDecimals:2,headerFormat:"<table>",pointFormatter:function(){var colorClass="";0!==this.quote.quote.change&&(colorClass='class="'+(0<this.quote.quote.change?"positive":"negative")+'"');return'<tr><td class="country-name"><b>'+this.name+'</b></td></tr><tr><td><b>Index Name:</b></td><td style="text-align: right">'+this.quote.instrument.shortName+'</td></tr><tr><td><b>Last Price:</b></td><td style="text-align: right">'+this.quote.quote.lastPrice+'</td></tr><tr><td><b>Change:</b></td><td style="text-align: right;" '+colorClass+">"+this.quote.quote.change+" ("+this.quote.quote.pctChange+'%)</td></tr><tr><td><b>Intraday High/Low:</b></td><td style="text-align: right">'+this.quote.quote.extendedQuote.highPrice+"-"+this.quote.quote.extendedQuote.lowPrice+"</td></tr>"},footerFormat:"</table>"},series:[{name:"World",type:"map",enableMouseTracking:!1},{joinBy:["iso-a3","code3"],data:[],minSize:4,maxSize:"12%"}]}};var getCountryColor=function(val){return 0===val?APP_CONFIG.chartColors.sectorColors.noGainLossColor:0<val&&val<=1?APP_CONFIG.chartColors.sectorColors.smallGainColor:val<0&&-1<val?APP_CONFIG.chartColors.sectorColors.smallLossColor:val<=-1?APP_CONFIG.chartColors.sectorColors.largeLossColor:1<=val?APP_CONFIG.chartColors.sectorColors.largeGainColor:void 0};window.addEventListener("beforeprint",function(){$scope.map.setSize(780,300)}),window.addEventListener("afterprint",function(){$timeout(function(){$scope.map.destroy(),highcharts.loadMap("custom/world").then(function(){var options=$.extend(!0,{},$scope.mapOptions());options.series[1].data=$scope.indices,$scope.map=highcharts.getMapChart(options)})},200)}),loader.attach($scope,$element,function(invalidateCache){var rics=$scope.globalIndices.map(function(country){return country.ric});return symbol.getQuote(rics,$scope.delayed,$scope.symbolFormat,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{highcharts.loadMap("custom/world").then(function(){var filteredCountries=data.symbolQuote.instrumentQuotes.filter(function(quote){return!quote.accessDenied}),countriesWithCountryCodes=function(config,quotes){var modifiedQuotes=[];return quotes.forEach(function(quote){config.forEach(function(configItem){quote.instrument.ric===configItem.ric&&(quote.countryCode=configItem.countryCode,quote.countryLabel=configItem.country,modifiedQuotes.push(quote))})}),modifiedQuotes}($scope.globalIndices,filteredCountries);$scope.indices=function(quotes){return quotes.map(function(quote){return{code3:quote.countryCode,name:quote.countryLabel,value:quote.quote.pctChange,quote:quote,color:getCountryColor(quote.quote.pctChange)}})}(countriesWithCountryCodes);var options=$.extend(!0,{},$scope.mapOptions());options.series[1].data=$scope.indices,$scope.map=highcharts.getMapChart(options)})}catch(e){if($scope.map)throw $scope.map.destroy(),"sviGlobalIndicesMap:"+e}}),$scope.$watch("symbol",function(val,oldVal){val&&val!==oldVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.indices||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviGlobalIndicesTable",["APP_CONFIG","$templateCache","$timeout","labels","symbol","piwik","loader","grid","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,symbol,piwik,loader,grid,eventDispatcher){return{scope:{symbol:"@",globalIndices:"@"},template:$templateCache.get("globalIndicesTable/globalIndicesTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="globalIndicesTable",this.friendlyName="Global Indices Table",this.eventName="GLOBAL_INDICES";try{svi.ng.parseJSON($scope,$attrs,"globalIndices")}catch(e){throw"sviGlobalIndicesGrid: "+e}$scope.sortable=!1,$scope.indices=null,$scope.delayed=!APP_CONFIG.rtqEnabled,$scope.symbolFormat="ric",$scope.initialRegion="ALL",labels.setupLabels($scope,["general","globalIndicesTable"],{all:"All",emea:"EMEA",americas:"Americas",asiaPacific:"Asia-Pacific"}),$scope.dropdownOptions=[{display:$scope.labels.all,value:"ALL"},{display:$scope.labels.americas,value:"AMERICAS"},{display:$scope.labels.emea,value:"EMEA"},{display:$scope.labels.asiaPacific,value:"ASIA-PACIFIC"}],$scope.responsiveColumnsSettings={enabled:!0,priority:["country","lastPrice","shortName","dayChange","dayChangePct","intradayRange","weekRange"],breakpoints:{xs:3,sm:3,md:6}},grid.attachGrid($scope,$element);var mapCountries=function(config,quotes){var modifiedQuotes=[];return quotes.forEach(function(quote){config.forEach(function(configItem){quote.instrument.ric===configItem.ric&&(quote.countryLabel=configItem.country,quote.countryRegion=configItem.region,modifiedQuotes.push(quote))})}),modifiedQuotes};loader.attach($scope,$element,function(invalidateCache){var rics=$scope.globalIndices.map(function(country){return country.ric});return symbol.getQuote(rics,$scope.delayed,$scope.symbolFormat,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{var filteredQuotes=data.symbolQuote.instrumentQuotes.filter(function(quote){return!quote.accessDenied});$scope.allIndices=mapCountries($scope.globalIndices,filteredQuotes),$scope.indices=mapCountries($scope.globalIndices,filteredQuotes)}catch(e){throw"sviGlobalIndicesTable: "+e}}),$scope.$watch("symbol",function(val,oldVal){val&&val!==oldVal&&$scope.api.load()}),eventDispatcher.on("REGION.FILTER.CHANGED",function(e,data){data&&data.value!==$scope.region&&($scope.region=data.value)}),$scope.$watch("region",function(val,oldVal){var region;null!==val&&val!==oldVal&&($scope.indices="ALL"===val?$scope.allIndices:(region=val,$scope.allIndices.filter(function(quote){return quote.countryRegion===region})))}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.indices||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviIndexTile",["APP_CONFIG","$templateCache","$timeout","$filter","loader","widget","piwik","symbol","calendar","labels",function(APP_CONFIG,$templateCache,$timeout,$filter,loader,widget,piwik,symbol,calendar,labels){return{replace:!1,scope:{symbol:"@",symbolFormat:"@",title:"@",futureSymbol:"@"},template:$templateCache.get("indexTile/indexTile.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="indexTile",this.friendlyName="Index Tile",$scope.index=null,$scope.futures=null,$scope.delayed=!APP_CONFIG.rtqEnabled;try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultValidString($scope,$attrs,"symbolFormat",["ticker","ric"],"ticker"),svi.ng.defaultString($scope,$attrs,"title",$scope.symbol),svi.ng.defaultString($scope,$attrs,"futureSymbol","")}catch(e){throw"sviIndexTile: "+e}labels.setupLabels($scope,["general","indexTile"]),$scope.comm={symbol:$scope.symbol,symbolFormat:$scope.symbolFormat},$scope.preMarketHours=calendar.isPreMarketHours();var getColor=function(change){var color;return 0<change&&(color="positive"),change<0&&(color="negative"),0===change&&(color=" "),color},setPrecision=function(number){return $filter("sviNumber")(number,2,!0,!1)};loader.attach($scope,$element,function(invalidateCache){return $scope.futureSymbol&&$scope.preMarketHours?($scope.index=null,$scope.futures=null,symbol.getQuote([$scope.symbol,$scope.futureSymbol],$scope.delayed,$scope.symbolFormat,invalidateCache,!0)):($scope.index=null,$scope.futures=null,symbol.getQuote($scope.symbol,$scope.delayed,$scope.symbolFormat,invalidateCache))},function(data){piwik.trackDataLoad($scope,data);try{var quote=data.symbolQuote.instrumentQuotes[0],change=quote.quote.change,pctChange=quote.quote.pctChange,lastPrice=quote.quote.lastPrice;if($scope.index={change:setPrecision(change),percentChange:setPrecision(pctChange),lastPrice:setPrecision(lastPrice),color:getColor(change),timespan:quote.quote.quoteTime},$scope.preMarketHours&&$scope.futureSymbol){var futures=data.symbolQuote.instrumentQuotes[1],futuresChange=futures.quote.change,futuresPctChange=futures.quote.pctChange;$scope.futures={futureSymbol:$scope.title,change:setPrecision(futuresChange),percentChange:setPrecision(futuresPctChange),color:getColor(futuresChange)}}}catch(e){throw"sviIndexTileWidget"+e}}),widget.attach($scope,$element),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=null,$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviIpoEventsTable",["APP_CONFIG","$templateCache","$timeout","labels","fundInfo","piwik","loader","eventDispatcher","widget","grid","dateUtils",function(APP_CONFIG,$templateCache,$timeout,labels,fundInfo,piwik,loader,eventDispatcher,widget,grid,dateUtils){return{replace:!1,scope:{dateRange:"@",eventId:"@",pageEventId:"@"},template:$templateCache.get("ipoEventsTable/ipoEventsTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="IpoEventsTable",this.friendlyName="IPO Events Table",this.eventName="IPO",$scope.companies=null,$scope.sortable=!0,$scope.category="IpoPricings",$scope.totalRecords=null,$scope.currentPage=1,$scope.pageSize=20,svi.ng.defaultString($scope,$attrs,"eventId","IPOS_EVENTS"),svi.ng.defaultString($scope,$attrs,"pageEventId","IPOS_PAGING");try{svi.ng.parseJSON($scope,$attrs,"dateRange")}catch(e){throw"Unable to parse JSON: "+e}labels.setupLabels($scope,["general","ipoEventsTable"]),$scope.responsiveColumns=!0,$scope.columnPriority=["date","symbol","exchange","type","filingPriceLow","finalPrice","shares","lockupExpiryDate","company"],grid.attachSorting($scope,$element,$attrs,"company","asc"),grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){return $scope.companies=[],fundInfo.getEventsTable($scope.category,dateUtils.normalizeDate($scope.dateRange.start,"yyyy-MM-dd"),dateUtils.normalizeDate($scope.dateRange.end,"yyyy-MM-dd"),$scope.sortDir,$scope.sortField,$scope.pageSize,$scope.currentPage,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{!data.eventsTable.ipos||data.eventsTable.ipos.length<1?$scope.loader.setMessage($scope.labels.iposNoData):($scope.companies=data.eventsTable.ipos,$scope.companies.length<1&&$scope.loader.setMessage($scope.labels.iposNoData),$scope.totalRecords=data.eventsTable.totalRecords,$scope.totalPages=Math.ceil($scope.totalRecords/$scope.pageSize))}catch(e){throw"sviIposEventsTable: "+e}}),widget.attach($scope,$element),eventDispatcher.on($scope.eventId+".DATE_RANGE.FILTER.CHANGED",function(e,data){angular.isDefined(data.from)&&angular.isDefined(data.to)&&(eventDispatcher.trigger($scope.pageEventId+".PAGE.CHANGED",1),$scope.dateRange={start:dateUtils.normalizeDate(data.from,"yyyy-MM-dd"),end:dateUtils.normalizeDate(data.to,"yyyy-MM-dd")})},null,$element),eventDispatcher.on($scope.pageEventId+".PAGE.CHANGED",function(e,data){data&&$scope.currentPage!==data&&($scope.currentPage=data)},null,$element),$scope.$watch("currentPage",function(newVal,oldVal){newVal&&newVal!==oldVal&&""!==newVal&&$scope.api.load()}),$scope.$watch("dateRange",function(newVal,oldVal){null!==newVal&&""!==newVal&&newVal!==oldVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.companies||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviLipperFundESGSummary",["APP_CONFIG","$templateCache","$timeout","$templateRequest","labels","loader","fundInfo","piwik","eventDispatcher","widget",function(APP_CONFIG,$templateCache,$timeout,$templateRequest,labels,loader,fundInfo,piwik,eventDispatcher,widget){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("lipperFundESGSummary/lipperFundESGSummary.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="FundESGSummary",this.friendlyName="Lipper Fund ESG Summary",$scope.data=null,$scope.maxValue=100,$scope.chartColors=null,$scope.greenLeafs=[],$scope.greyLeafs=[],$scope.maxRating=5,svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),labels.setupLabels($scope,["general","lipperFundESGSummary"]);loader.attach($scope,$element,function(invalidateCache){$scope.data=null,$scope.greenLeafs.length=0,$scope.greyLeafs.length=0;var params={symbolFormat:$scope.symbolFormat};return fundInfo.getLipperFundESGSummary($scope.symbol,invalidateCache,params)},function(data){piwik.trackPage($scope,data);try{$scope.chartColors=APP_CONFIG.chartColors.ESGSummaryColors,data.lipperFundESGSummary.esgSummary?($scope.data=data.lipperFundESGSummary.esgSummary,$scope.greenLeafs.length=(rating=data.lipperFundESGSummary.esgSummary.esg)<10?0:10<=rating&&rating<30?1:30<=rating&&rating<50?2:50<=rating&&rating<70?3:70<=rating&&rating<90?4:5,$scope.greyLeafs.length=$scope.maxRating-$scope.greenLeafs.length):($scope.greenLeafs.length=0,$scope.greyLeafs.length=0)}catch(e){throw"sviLipperFundESGSummary "+e}var rating}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviLipperFundPerformanceAnalysis",["APP_CONFIG","$templateCache","highcharts","$timeout","labels","loader","widget","eventDispatcher","piwik","fundInfo","grid","$filter",function(APP_CONFIG,$templateCache,highcharts,$timeout,labels,loader,widget,eventDispatcher,piwik,fundInfo,grid,$filter){return{replace:!1,scope:{symbol:"@",parentTabSelector:"@",symbolFormat:"@"},template:$templateCache.get("lipperFundPerformanceAnalysis/lipperFundPerformanceAnalysis.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="lipperFundPerformanceAnalysis",this.friendlyName="Lipper Fund Performance Analysis",svi.ng.defaultString($scope,$attrs,"parentTabSelector",'.svi-sub-page-nav a[data-toggle="tab"]');var getTabCtrl=svi.ng.getControllerFactory($element,$scope,"svi-tabs");labels.setupLabels($scope,["general","lipperFundPerformanceAnalysis"]).then(function(){var tabs=getTabCtrl();tabs&&$timeout(tabs.updateTabs)});try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"lipperFundPerformanceAnalysis: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl",""),$scope.performanceData=null,$scope.includeBenchmarks=!0,$scope.benchmarks=[],$scope.id=php.uniqid("lipperFundPerformanceAnalysisChart"),$scope.colors=APP_CONFIG.chartColors.graphicColors.map(function(colorItem){return colorItem.color}),$scope.comm={},$scope.sortable=!0,$scope.responsiveColumnsSettings={enabled:!0,priority:["name","1M","1Y","3M","6M","YTD","5Y","10Y"],formatters:{"1M":"percent","3M":"percent","6M":"percent","1Y":"percent","5Y":"percent","10Y":"percent",YTD:"percent"}},$scope.responsiveColumnsSettingsAnnual={enabled:!0,priority:["name","1Y","2Y","3Y","4Y","5Y"],formatters:{"1Y":"percent","2Y":"percent","3Y":"percent","4Y":"percent","5Y":"percent"}},grid.attachGrid($scope,$element),$scope.chartCumulative=null,$scope.chartAnnualized=null,$scope.getOptions=function(className,formatValue){return{chart:{renderTo:$element.find(className)[0],type:"column",background:"white",borderRadius:0,marginRight:0,height:300},colors:$scope.colors,title:{text:null},tooltip:{formatter:function(){return"<b>"+this.series.name+": "+this.y+formatValue+"</b>"}},accessibility:{landmarkVerbosity:"disabled"},navigator:{enabled:!1},scrollbar:{enabled:!1},rangeSelector:{enabled:!1},credits:{enabled:!1},subtitle:{text:""},plotOptions:{column:{allowPointSelect:!0,cursor:"pointer"}},xAxis:{categories:[],labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{formatter:function(){return this.value+formatValue},style:{fontSize:"12px"}},offset:0,lineWidth:1,gridLineWidth:1,tickLength:10,tickWidth:1,tickPosition:"outside",tickPixelInterval:36},series:[]}};loader.attach($scope,$element,function(invalidateCache){$scope.benchmarks=[];var params={includeBenchmarks:"Y",symbolFormat:$scope.symbolFormat};return fundInfo.getPerformance($scope.symbol,params,invalidateCache)},function(data){if(piwik.trackDataLoad($scope,data),data.performance.performance){var seriesData=function(data){var cumulativeColumnTitles=[$scope.labels.cumulativeTableTitle1M,$scope.labels.cumulativeTableTitle3M,$scope.labels.cumulativeTableTitle6M,$scope.labels.cumulativeTableTitleYTD,$scope.labels.cumulativeTableTitle1Y],performance=data.performance.performance,benchmarks=data.performance.benchmarks;benchmarks.unshift(performance),benchmarks.map(function(item){var values=Object.keys(item.calendar).map(function(e){return item.calendar[e]});return item.calendar=values.sort(function(a,b){return a.year>b.year?1:-1}),item.name=fundInfo.cleanFundName(item.name),item});var dataCumulative=[],dataAnnual=[],annualColumnTitles=[],annualItems=[];for(var key in benchmarks){var cumulateItem=benchmarks[key].cumulative;if(cumulateItem)for(var itemKey in cumulateItem){var item=cumulateItem[itemKey];!$scope.asOfDate&&item.endDate&&($scope.asOfDate=item.endDate)}benchmarks[key].calendar&&annualItems.push(benchmarks[key].calendar);var name=benchmarks[key].name;cumulateItem&&dataCumulative.push({data:[parseFloat($filter("number")(cumulateItem["1m"].value,2)),parseFloat($filter("number")(cumulateItem["3m"].value,2)),parseFloat($filter("number")(cumulateItem["6m"].value,2)),parseFloat($filter("number")(cumulateItem.ytd.value,2)),parseFloat($filter("number")(cumulateItem["1y"].value,2))],showInLegend:!1,name:name})}if(annualItems){var tmpAnnualData=[];annualItems.forEach(function(items){var tmpAnnualElement={};items&&items.forEach(function(item){item.year&&-1===annualColumnTitles.indexOf(item.year)&&annualColumnTitles.push(item.year),tmpAnnualElement[item.year]=item.value}),tmpAnnualData.push(tmpAnnualElement)});var annualColumnTitlesSorted=annualColumnTitles.sort();tmpAnnualData.forEach(function(item,index){var annualValue=[];annualColumnTitlesSorted.forEach(function(title){annualValue.push(item[title]?+$filter("number")(item[title],2):"")}),dataAnnual.push({data:annualValue,showInLegend:!1,name:benchmarks[index].name})})}return{cumulative:{categories:cumulativeColumnTitles,data:dataCumulative},annual:{categories:annualColumnTitles,data:dataAnnual}}}(data),options=$.extend(!0,{},$scope.getOptions(".svi-lipper-fund-performance-analysis-chart-cumulative","%"));options.series=seriesData.cumulative.data,options.xAxis.categories=seriesData.cumulative.categories,$scope.chartCumulative&&$scope.chartCumulative.destroy(),$scope.chartCumulative=highcharts.getChart(options),(options=$.extend(!0,{},$scope.getOptions(".svi-lipper-fund-performance-analysis-chart-annualized","%"))).series=seriesData.annual.data,options.xAxis.categories=seriesData.annual.categories,$scope.anuallizedColumnTitles=seriesData.annual.categories,$scope.chartAnnualized&&$scope.chartAnnualized.destroy(),$scope.chartAnnualized=highcharts.getChart(options),$scope.annualTitles=seriesData.annual.categories,$scope.annualData=JSON.parse(JSON.stringify(seriesData.annual.data))}try{$scope.benchmarks=JSON.parse(JSON.stringify(data.performance.benchmarks)),$scope.performanceData=data.performance.performance}catch(e){$scope.benchmarks=[]}},function(){piwik.trackPage("lipperFundPerformanceAnalysis/error","Error: Lipper Fund Performance Analysis",!1)}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.benchmarks.length||($scope.api.load(),$scope.parentTabSelector&&angular.element($scope.parentTabSelector).on("shown.bs.tab",function(e){($scope.chartCumulative||$scope.chartAnnualized)&&($scope.chartCumulative.reflow(),$scope.chartAnnualized.reflow())}))},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviLipperLeadersPerformance",["APP_CONFIG","$templateCache","$templateRequest","$timeout","loader","fundInfo","piwik","labels","eventDispatcher","widget","$window","$document",function(APP_CONFIG,$templateCache,$templateRequest,$timeout,loader,fundInfo,piwik,labels,eventDispatcher,widget,$window,$document){return{replace:!1,scope:{symbol:"@",moreUrl:"@",symbolFormat:"@"},template:$templateCache.get("lipperLeadersPerformance/lipperLeadersPerformance.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="LipperLeadersPerformance",this.friendlyName="Lipper Leaders and Performance",$scope.performanceValueClass="col-sm-4 col-xs-6",$scope.ratingClass="col-sm-4 col-xs-6",$scope.performance=null,$scope.ratings=null,$scope.ranks=null,$scope.fundSector=null,$scope.includeBenchmarks=!0,$scope.timespans=["3y","5y","10y"],$scope.previousTab=null,$scope.currentTab=null,$scope.popoverId=php.uniqid();var getTabCtrl=svi.ng.getControllerFactory($element,$scope,"svi-tabs");labels.setupLabels($scope,["lipperLeadersPerformance"]).then(function(){var tabs=getTabCtrl();tabs&&$timeout(tabs.updateTabs)});try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"sviLipperLeadersPerformance: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){throw"sviLipperLeadersPerformance: "+e}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl","");var setRatingData=function(data){return[{id:"totalReturn",title:$scope.labels.lipperRatingsAAGTotalReturn,value:data.totalReturn,helperText:$scope.labels.shortDescTotalReturn},{id:"consistentReturn",title:$scope.labels.lipperRatingsAAGConsistentReturn,value:data.consistentReturn,helperText:$scope.labels.shortDescConsistentReturn},{id:"preservation",title:$scope.labels.lipperRatingsAAGPreservation,value:data.preservation,helperText:$scope.labels.shortDescRatingsForPreservation},{id:"expense",title:$scope.labels.lipperRatingsAAGExpenses,value:data.expense,helperText:$scope.labels.shortDescRatingsForExpense},{id:"taxEfficiency",title:$scope.labels.lipperRatingsAAGTaxEfficiency,value:data.taxEfficiency,helperText:$scope.labels.shortDescTaxEfficiency}]},setAsOfDate=function(){$scope.ranks&&Object.keys($scope.ranks).forEach(function(key){!$scope.asOfDate&&$scope.ranks[key].endDate&&($scope.asOfDate=$scope.ranks[key].endDate)})};$scope.map={9:!1,16:!1};var getFocussableElements=function(){return Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return 0<element.offsetWidth||0<element.offsetHeight})};$scope.api.onKeyDown=function(e){var focusable=getFocussableElements();focusable.includes(document.activeElement)&&($scope.currentElement=document.activeElement);var currentIndex=focusable.indexOf($scope.currentElement);if(e.keyCode in $scope.map){if($scope.map[e.keyCode]=!0,$scope.map[9]&&$scope.map[16]){var index=currentIndex-1;focusable.includes(document.activeElement)||(index=currentIndex),e.preventDefault(),focusable[index].focus()}$scope.map[9]&&!$scope.map[16]&&(e.preventDefault(),focusable[currentIndex+1].focus())}},$scope.api.onKeyUp=function(e){e.keyCode in $scope.map&&($scope.map[e.keyCode]=!1)},$scope.api.cleanTabMap=function(e){e.preventDefault();var currentIndex,focusable=getFocussableElements();$scope.map[16]?(currentIndex=focusable.indexOf($scope.currentElement),focusable[currentIndex-2].focus(),$scope.map={9:!1,16:!1}):(currentIndex=focusable.indexOf(document.activeElement),focusable[currentIndex+1].focus())},$scope.onPopoverShow=function(){$document.find(".lipper-leaders-performance-container").css({"z-index":10})},$scope.onPopoverHide=function(){$document.find(".lipper-leaders-performance-container").css({"z-index":""})},loader.attach($scope,$element,function(invalidateCache){$scope.performance=null,$scope.ratings=null,$scope.fundSector=null;var params={includeBenchmarks:$scope.includeBenchmarks?"Y":"N",symbolFormat:$scope.symbolFormat};return fundInfo.getPerformance($scope.symbol,params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.ratings=function(leaders){switch(Object.keys(leaders.ratings.latest).length){case 5:$scope.performanceValueClass="col-md-2 col-sm-4 col-xs-6",$scope.ratingClass="col-md-2 col-sm-4 col-xs-6";break;case 4:$scope.performanceValueClass="col-md-4 col-sm-8 col-xs-6",$scope.ratingClass="col-md-2 col-sm-4 col-xs-6";break;case 3:$scope.performanceValueClass="col-md-3 col-sm-6 col-xs-6",$scope.ratingClass="col-md-3 col-sm-6 col-xs-6"}var result=[];return result["1y"]=leaders.ratings.latest?setRatingData(leaders.ratings.latest):[],result["3y"]=leaders.ratings["3y"]?setRatingData(leaders.ratings["3y"]):[],result["5y"]=leaders.ratings["5y"]?setRatingData(leaders.ratings["5y"]):[],result["10y"]=leaders.ratings["10y"]?setRatingData(leaders.ratings["10y"]):[],result.ytd=leaders.ratings.latest?setRatingData(leaders.ratings.latest):[],result}(data.leaders),$scope.ranks=data.leaders.ranks,setAsOfDate(),$scope.ranks.ytd=data.leaders.ranks.latest,$scope.fundSector=data.leaders.fundSector,data.performance.performance&&($scope.performance=data.performance.performance)}catch(e){$scope.performance=null,$scope.ratings={}}}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),angular.element($window).bind("resize",function(e){$(".popover").each(function(){$(this).scope().$hide()})}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.performance||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviLipperRatingsAAG",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","piwik","fundInfo","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,piwik,fundInfo,eventDispatcher){return{replace:!1,scope:{symbol:"@",period:"@"},template:$templateCache.get("lipperRatingsAAG/lipperRatingsAAG.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="lipperRatingsAAG",this.friendlyName="Lipper Ratings At A Glance",$scope.ratings=null,$scope.fundSector=null;try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultValidString($scope,$attrs,"period",["latest","3y","5y","10y"],"3y")}catch(e){throw"sviLipperRatingsAAG: "+e}labels.setupLabels($scope,["general","lipperRatingsAAG"]);loader.attach($scope,$element,function(invalidateCache){return $scope.ratings=null,$scope.fundSector=null,fundInfo.getLipperRating($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.ratings=function(data){return[{title:$scope.labels.lipperRatingsAAGTotalReturn,value:data.totalReturn},{title:$scope.labels.lipperRatingsAAGConsistentReturn,value:data.consistentReturn},{title:$scope.labels.lipperRatingsAAGPreservation,value:data.preservation},{title:$scope.labels.lipperRatingsAAGExpenses,value:data.expense},{title:$scope.labels.lipperRatingsAAGTaxEfficiency,value:data.taxEfficiency}]}(data.leaders.ratings[$scope.period]),$scope.fundSector=data.leaders.fundSector}catch(e){throw"sviLipperRatingsAAG: "+e}}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.ratings||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("directives").directive("sviMarketClock",["APP_CONFIG","$templateCache","$timeout","labels","calendar","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,calendar,eventDispatcher){return{scope:{openTime:"@",closeTime:"@"},template:$templateCache.get("marketClock/marketClock.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"openTime","09:30"),svi.ng.defaultString($scope,$attrs,"closeTime","16:00"),$scope.duration=null,$scope.defaultCloseTime=$scope.closeTime,labels.setupLabels($scope,["marketClock"]),$scope.marketsStatus={},$scope.updatePremarketValuesFlag=!1,$scope.marketsCheck=function(){var date=moment().format("YYYY-MM-DD");if(calendar.isWeekend(date)||calendar.isHoliday(date,!0))return $scope.marketsStatus={holidayOrWeekend:!0},void $timeout($scope.marketsCheck,6e4);$scope.closeTime=calendar.isShortenDay(date)?calendar.getShortenMarketCloseTime():$scope.defaultCloseTime;var currentOpenTimeDay=moment(date+" "+$scope.openTime);calendar.isMarketOpen($scope.openTime,$scope.closeTime)?openMarketHourCheck():moment().format()>currentOpenTimeDay.format()?($scope.marketsStatus={afterMarketHoursClosed:!0},$timeout($scope.marketsCheck,6e4)):preMarketHoursCheck(currentOpenTimeDay)};var preMarketHoursCheck=function(currentOpenTimeDay){var duration=moment.duration(currentOpenTimeDay.diff(moment()));0===duration.hours()&&1<=duration.minutes()?($scope.marketsStatus={preMarketOneHourOpen:!0},$scope.duration={minutes:duration.minutes()},$scope.updatePremarketValuesFlag=!0,1===duration.minutes()?$timeout($scope.marketsCheck,1e3):$timeout($scope.marketsCheck,6e4)):0===duration.hours()&&0===duration.minutes()?($scope.marketsStatus={preMarketOneMinuteOpen:!0},$scope.duration={seconds:duration.seconds()},$scope.updatePremarketValuesFlag=!0,$timeout($scope.marketsCheck,1e3)):($scope.marketsStatus={},$timeout($scope.marketsCheck,6e4))},openMarketHourCheck=function(){var date=moment().format("YYYY-MM-DD"),currentCloseTimeDay=moment(date+" "+$scope.closeTime),duration=moment.duration(currentCloseTimeDay.diff(moment()));1===duration.hours()||0===duration.hours()&&5<=duration.minutes()?($scope.marketsStatus={marketsCloseTwoHours:!0},$scope.duration={hours:duration.hours(),minutes:duration.minutes()},5===duration.minutes()?$timeout($scope.marketsCheck,1e3):$timeout($scope.marketsCheck,6e4)):0===duration.hours()&&duration.minutes()<5?($scope.marketsStatus={marketsCloseFiveMinutes:!0},$scope.duration={minutes:duration.minutes(),seconds:duration.seconds()},$timeout($scope.marketsCheck,1e3)):($scope.marketsStatus={marketsOpen:!0},$scope.updatePremarketValuesFlag&&(eventDispatcher.trigger("MARKETS.RELOAD.DATA"),$scope.updatePremarketValuesFlag=!1),$scope.duration={},$timeout($scope.marketsCheck,6e4))};$timeout(function(){$scope.marketsCheck()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviMarketEventsSummary",["APP_CONFIG","$templateCache","$timeout","loader","calendar","piwik","labels","eventDispatcher","widget","sviUrl","$filter","state",function(APP_CONFIG,$templateCache,$timeout,loader,calendar,piwik,labels,eventDispatcher,widget,sviUrl,$filter,state){var dateRegex=/^(0?[1-9]|1[0-2])\/(0?[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/;return{replace:!1,scope:{date:"@",detailUrl:"@",stateId:"@",targetTab:"@",eventId:"@"},template:$templateCache.get("marketEventsSummary/marketEventsSummary.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="marketEventsSummary",this.friendlyName="Market Events Summary",$scope.marketEventsSummaryInfo=null,$scope.filteredSelectedDate=null,$scope.inputDate={date:""},labels.setupLabels($scope,["general","marketEventsSummary","marketEventsSummaryInfoTitles","eventsTableContainer"]);try{svi.ng.defaultString($scope,$attrs,"date",$filter("date")(new Date,"yyyy-MM-dd")),svi.ng.defaultString($scope,$attrs,"detailUrl",""),svi.ng.defaultString($scope,$attrs,"eventId","MARKET.OVERVIEW"),svi.ng.defaultString($scope,$attrs,"stateId","current-tab"),svi.ng.defaultString($scope,$attrs,"targetTab","events")}catch(e){throw"marketEventsSummary: "+e}$scope.onInputChange=function(date){$scope.inputDate.date=date},this.manualDateSubmit=function(){(!$scope.inputDate.date.match(dateRegex)||new Date($scope.inputDate.date)>$scope.endDate)&&($scope.inputDate.date=$filter("date")($scope.date,"MM/dd/yyyy")),$scope.date=$scope.inputDate.date};$scope.anchorLink=function(id){var targetValue="";switch(id){case $scope.labels.Earnings:targetValue="earnings";break;case $scope.labels.Economic:targetValue="economic";break;case $scope.labels.Dividends:targetValue="dividends";break;case $scope.labels.IPOs:targetValue="ipo";break;case $scope.labels.StockSplits:targetValue="splits";break;default:return}if(targetValue)if($scope.detailUrl){state.set($scope.stateId,$scope.targetTab);var currentHref=window.location.href;-1<currentHref.indexOf("eventType="+targetValue)&&-1<currentHref.indexOf("date="+$scope.date)?(sviUrl.href($scope.detailUrl.replace("%EVENT_TYPE%",targetValue).replace("%DATE%",$scope.date)),$timeout(function(){document.location.reload()},500)):sviUrl.href($scope.detailUrl.replace("%EVENT_TYPE%",targetValue).replace("%DATE%",$scope.date))}else $scope.eventId&&eventDispatcher.trigger($scope.eventId+".SELECT.TAB",targetValue)},$scope.endDate=new Date((new Date).setFullYear((new Date).getFullYear()+1));$scope.previousDate=function(){$scope.date=moment($scope.filteredSelectedDate).subtract(1,"days").format("yyyy-MM-DD")},$scope.nextDate=function(){$scope.date=moment($scope.filteredSelectedDate).add(1,"days").format("yyyy-MM-DD")},loader.attach($scope,$element,function(invalidateCache){return $scope.marketEventsSummaryInfo=null,calendar.getMarketEventsSummaryInfo($scope.date,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.marketEventsSummaryInfo=function(data){var result=data.summary.summary,tmpObj={};return["Earnings","Dividends","IPOs","StockSplits","Economic"].forEach(function(element){tmpObj[element]=result.events[element]?result.events[element]:0}),result.events=tmpObj,result}(data),$scope.filteredSelectedDate=moment($scope.date).format("yyyy-MM-DD"),$element.find("#datepicker-container").datepicker({container:"#datepicker-container",endDate:$scope.endDate,todayHighlight:!0,format:"yyyy-mm-dd",maxViewMode:0}).on("changeDate",function(ev){$scope.date=$filter("date")(ev.date,"yyyy-MM-dd"),$scope.$applyAsync()}),$scope.inputDate.date=$filter("date")($scope.date,"MM/dd/yyyy"),$element.find("#datepicker-container").data("datepicker").setDate($scope.marketEventsSummaryInfo.date)}catch(e){$scope.marketEventsSummaryInfo={}}}),widget.attach($scope,$element),$scope.$watch("date",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$timeout(function(){$scope.initComplete=!0,$scope.marketEventsSummaryInfo||$scope.api.load();var eventsInput=document.querySelector(".events-date-input");eventsInput&&eventsInput.addEventListener("focusout",function(ev){$scope.inputDate.date=$filter("date")($scope.date,"MM/dd/yyyy")})},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviMarketIndices",["APP_CONFIG","$templateCache","$timeout","labels","eventDispatcher","exchange","piwik",function(APP_CONFIG,$templateCache,$timeout,labels,eventDispatcher,exchange,piwik){return{replace:!1,scope:{symbol:"@",reloadEvery:"@",timespan:"@"},template:$templateCache.get("marketIndices/marketIndices.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"symbol",["S&P 500","DJIA","NASDAQ"],"S&P 500"),svi.ng.defaultInt($scope,$attrs,"reloadEvery",0),svi.ng.defaultValidString($scope,$attrs,"timespan",["Today","TodayOrYesterday","TodayOrYesterdayOrLastWeek","Yesterday","WTD","MTD","YTD","OneDay","OneWeek","OneMonth","ThreeMonth","SixMonth","OneYear","ThreeYear","FiveYear","TenYear"],"TodayOrYesterdayOrLastWeek")}catch(e){throw"sviMarketIndices: "+e}$scope.timespan.startsWith("Today")||($scope.reloadEvery=$attrs.reloadEvery=0),$scope.comm={symbol:$scope.symbol},$scope.exchange=null,$scope.reloadTimeout=null,labels.setupLabels($scope,["general","marketIndicesChart"]);var getWidgetCtrl=svi.ng.getControllerFactory($element,$scope,"svi-widget");$scope.setLoader=function(loader){$scope.loader=loader;var widget=getWidgetCtrl();widget&&widget.setLoader(loader)};var loadCallback=function(invalidateCache){return $scope.exchange=null,exchange.getIndexes(invalidateCache)},onSuccess=function(data){data.exchange.indices.length&&!data.exchange.errors.length&&($scope.reloadEvery&&$scope.api.scheduleReload(1e3*$scope.reloadEvery),$scope.exchange=data.exchange,svi.ui.pulse($element.find(".table tbody .number,.table tbody .currency")))},onError=function(){piwik.trackPage("marketIndices/error","Error: Market Indices",!1)};this.getLoader=svi.ng.getLoaderFactory($element.find(".indices-loader-"+$scope.type),$scope),this.load=function(invalidateCache){angular.isUndefined(invalidateCache)&&(invalidateCache=!1);var loader=$scope.api.getLoader();if(loader){if(loader.showSpinner)return;$scope.reloadTimeout=null,loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}else $scope.api.scheduleReload(400)},this.scheduleReload=function(delay){null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout),$scope.reloadTimeout=$timeout(function(){$scope.api.load(!0)},delay)},$element.on("$destroy",function(){$scope.reloadEvery=!1,null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout)}),$scope.selectSymbol=function(symbol){$scope.comm.sybmol=symbol},$scope.api=this,$timeout(function(){$scope.exchange||$scope.api.load(),piwik.trackPage("marketIndices","Market Indices")},APP_CONFIG.autoLoadDelay),eventDispatcher.on("MARKETS.QUOTE.LOADED",function(e,data){onSuccess(data)},!0,$element)}]}}]),angular.module("svi.research").directive("sviMarketMovers",["APP_CONFIG","$templateCache","$timeout","labels","exchange","eventDispatcher","widget","piwik","sviUrl","state",function(APP_CONFIG,$templateCache,$timeout,labels,exchange,eventDispatcher,widget,piwik,sviUrl,state){return{replace:!1,scope:{type:"@",exchange:"@",exchangeDropdown:"@",limit:"@",limitDisplay:"@",sortField:"@",stateId:"@",targetTab:"@",sortDir:"@"},template:$templateCache.get("marketMovers/marketMovers.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="marketMovers",this.friendlyName="Market Movers";try{svi.ng.defaultValidString($scope,$attrs,"type",["Gainers","Losers","Active","Tabs"],"Tabs"),svi.ng.defaultValidString($scope,$attrs,"exchange",["US","AMEX","NYSE","NASDAQ"],"US"),svi.ng.defaultString($scope,$attrs,"exchangeDropdown",'[{"display":"All","value":"US"},{"display":"AMEX","value":"AMEX"},{"display":"NYSE","value":"NYSE"},{"display":"NSDQ","value":"NASDAQ"}]'),svi.ng.defaultInt($scope,$attrs,"limit",10,25,0),svi.ng.defaultInt($scope,$attrs,"limitDisplay",5,$scope.limit,0),svi.ng.defaultString($scope,$attrs,"sortField","quote.extendedQuote.volume"),svi.ng.defaultString($scope,$attrs,"sortDir","desc"),svi.ng.defaultString($scope,$attrs,"stateId","current-tab"),svi.ng.defaultString($scope,$attrs,"targetTab","marketMovers")}catch(e){throw"sviMarketMovers: "+e}$scope.movers=null,$scope.showMore=!1,$scope.pageNum=1,$scope.moversToLoad=75,$scope.activeTab="Actives",$scope.detailUrl="?activeTab=%TAB%#"+$scope.targetTab,$scope.setLoader=function(loader){$scope.loader=loader;var widget=$scope.api.getWidgetCtrl();widget&&widget.setLoader(loader)},widget.attach($scope,$element),$scope.$watch("showMore",function(){$scope.api.widgetResize()});var getTabCtrl=svi.ng.getControllerFactory($element,$scope,"svi-tabs");labels.setupLabels($scope,["general","marketMovers"]).then(function(){var tabs=getTabCtrl();tabs&&$timeout(tabs.updateTabs)}),this.more=function(){var queryParam=$scope.detailUrl.replace("%TAB%",$scope.activeTab);state.set($scope.stateId,$scope.targetTab),-1<window.location.href.indexOf("?activeTab="+$scope.activeTab)?(sviUrl.href(queryParam),$timeout(function(){document.location.reload()},500)):sviUrl.href(queryParam)};var loadCallback=function(invalidateCache){return $scope.movers=null,exchange.getMovers($scope.exchange,$scope.type,$scope.moversToLoad,$scope.pageNum,$scope.sortField,$scope.sortDir,invalidateCache)},onSuccess=function(data){piwik.trackPage("marketMovers","Market Movers",1e3*data._loaderMetadata.elapsedTime),$scope.movers=exchange.filterMoversByTestData(data.movers.quotes),eventDispatcher.trigger("RESIZE",{source:"marketMovers"}),$element.closest(".market-movers-wrapper-top").find("ul.dropdown-menu li a").hasClass("active-dropdown-item")||$element.closest(".market-movers-wrapper-top").find("ul.dropdown-menu li a:first").addClass("active-dropdown-item")},onError=function(reason){piwik.trackPage("marketMovers/error","Error: Market Movers",!1)},getActiveTabLabel=function(label){return"Actives"===label?"actives":"% Gainers"===label?"gainers":"% Losers"===label?"losers":label};this.getLoader=svi.ng.getLoaderFactory($element.find(".movers-loader-"+$scope.type),$scope),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,200)},eventDispatcher.on("MARKET_MOVERS.EXCHANGE.FILTER.CHANGED",function(e,data){$scope.exchange!==data.value&&($element.find("ul.dropdown-menu li a").removeClass("active-dropdown-item"),$element.find('ul.dropdown-menu li a:contains("'+data.display+'")').addClass("active-dropdown-item"),$scope.exchange=data.value)},!0),eventDispatcher.on("ACTIVE.TAB.CHANGED",function(e,data){data.tabs&&$scope.activeTab!==getActiveTabLabel(data.tabs.title)&&($scope.activeTab=getActiveTabLabel(data.tabs.title))},!0),$scope.$watch("exchange",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$timeout(function(){$scope.api&&("Tabs"===$scope.type||$scope.movers||$scope.api.load())},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviPriceHistoryAndFundGrowthContainer",["APP_CONFIG","$templateCache","labels","$timeout","eventDispatcher","widget",function(APP_CONFIG,$templateCache,labels,$timeout,eventDispatcher,widget){return{scope:{symbol:"@",chartColorBegin:"@",useGradient:"@",eventName:"@",investmentType:"@",reloadEvery:"@",yAxisFontColor:"@",rangeButtonWidth:"@",showNavigator:"@",symbolFormat:"@"},template:$templateCache.get("priceHistoryAndFundGrowthContainer/priceHistoryAndFundGrowthContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="priceHistoryAndFundGrowthContainer",this.friendlyName="Price History Chart and Fund Growth of 10K",$scope.currentChart={val:"priceHistory"},svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultString($scope,$attrs,"chartColorBegin","#8EBFEF"),svi.ng.defaultTrue($scope,$attrs,"useGradient"),svi.ng.defaultValidString($scope,$attrs,"investmentType",["Stock","Option","MutualFund"],"Stock"),svi.ng.defaultInt($scope,$attrs,"reloadEvery",0,null,60),svi.ng.defaultString($scope,$attrs,"yAxisFontColor","#000000"),svi.ng.defaultInt($scope,$attrs,"rangeButtonWidth",null),svi.ng.defaultFalse($scope,$attrs,"showNavigator"),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),labels.setupLabels($scope,["priceHistoryAndFundGrowthContainer"]),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element)}]}}]),angular.module("svi.research").directive("sviSectorHeatmap",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","piwik","grid","exchange",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,piwik,grid,exchange){return{replace:!1,scope:{moreUrl:"@"},template:$templateCache.get("sectorHeatmap/sectorHeatmap.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="sectorHeatmap",this.friendlyName="Sector Heatmap",this.eventName="SECTOR_HEATMAP";try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl",""),$scope.sectors=null,$scope.id=php.uniqid(this.name),$scope.comm={},$scope.sortable=!0,$scope.responsiveColumns=!0,$scope.columnPriority=["desc","today","thisMonth","thisYear","thisWeek"],labels.setupLabels($scope,["general","sectorHeatmap"]),grid.attachSorting($scope,$element,$attrs,"quote.pctChange","desc");loader.attach($scope,$element,function(invalidateCache){var params={sortField:$scope.sortField,sortDir:$scope.sortDir};return exchange.getSectors(params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.sectors=data.sectors.sectors}catch(e){$scope.sectors=[]}}),widget.attach($scope,$element),$scope.getCellClass=function(value){return 1<value?"large-gain":value<=1&&0<value?"small-gain":value<0&&-1<=value?"small-loss":value<-1?"large-loss":0===value?"no-gain-loss":""},$timeout(function(){$scope.initComplete=!0,$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviSectorIndustriesChart",["APP_CONFIG","$templateCache","labels","$filter","highcharts",function(APP_CONFIG,$templateCache,labels,$filter,highcharts){return{replace:!1,scope:{sectors:"=",benchmarkName:"@",benchmarkColor:"@",parentTabSelector:"@"},template:$templateCache.get("sectorIndustriesChart/sectorIndustriesChart.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="sectorIndustriesChart",this.friendlyName="Sectors & Industries Chart",$scope.chart=null,$scope.chartData={},svi.ng.defaultString($scope,$attrs,"benchmarkName",""),svi.ng.defaultString($scope,$attrs,"benchmarkColor","#697a8b"),svi.ng.defaultString($scope,$attrs,"parentTabSelector",'.svi-sub-page-nav a[data-toggle="tab"]'),labels.setupLabels($scope,["sectorsIndustriesOverview"]).then(function(){$scope.initChart()}),$scope.getOptions=function(){return{chart:{renderTo:$element.find("#sectors-industries-chart")[0],type:"column",background:"white",borderRadius:0,zoomType:"x",reflow:!0,marginRight:0,height:$element.find("#sectors-industries-chart").height()||350},title:{text:null},tooltip:{useHTML:!0,formatter:function(){var html="";this.point.industries&&this.point.industries.length&&(this.point.industries.forEach(function(item){if(item.desc){var valueClass=0<item.value?"positive":item.value<0?"negative":"";html+="<span>"+item.desc+': <span class="'+valueClass+'">'+item.value+"%</span></span></br>"}}),html+='<div style="border-bottom: 2px solid #ccc"></div>');var valueClass=0<this.y?"positive":this.y<0?"negative":"";return html+="<b>"+this.point.name+': <span class="'+valueClass+'">'+this.y+"%</span></b>"}},accessibility:{landmarkVerbosity:"disabled"},navigator:{enabled:!1},legend:{enabled:!1},scrollbar:{enabled:!1},rangeSelector:{enabled:!1},credits:{enabled:!1},subtitle:{text:""},plotOptions:{column:{allowPointSelect:!0,cursor:"pointer"},series:{pointWidth:25}},xAxis:{categories:[],labels:{formatter:function(){return this.value===$scope.benchmarkName?"<b>"+this.value+"</b>":this.value}}},yAxis:{title:{text:null},labels:{formatter:function(){return this.value+"%"}},offset:0,lineWidth:1,gridLineWidth:1,tickLength:10,tickWidth:1,tickPosition:"outside",tickPixelInterval:36,plotLines:[{color:$scope.benchmarkColor,width:1,value:$scope.getBenchmarkValue($scope.labels.today),dashStyle:"LongDash",label:{useHTML:!0,text:'<span class="label">'+$scope.getBenchmarkValue($scope.labels.today)+"%</span>",textAlign:"left",x:-45,y:2,style:{padding:"3px 5px",fontSize:"12px",color:"#fff",fontWeight:"bold",backgroundColor:$scope.benchmarkColor,border:"1px solid"+$scope.benchmarkColor,borderRadius:"5px"},formatter:function(){return $scope.getBenchmarkValue($scope.labels.today)+"%"}}},{color:"#b3b3b3",width:2,value:0}]},series:[{name:$scope.labels.today,dataSorting:{matchByName:!0},dataLabels:[{enabled:!0,inside:!1,crop:!1,overflow:"none",style:{fontSize:"1em"},formatter:function(){return'<span style="color: '+this.point.color+'">'+this.y+"%</span>"}}],data:$scope.getChartValueData($scope.chartData[$scope.labels.today]).slice()}]}},$scope.getChartValueData=function(data){return data.map(function(item){return{name:item[0],y:item[1],color:item[0]===$scope.benchmarkName?$scope.benchmarkColor:item[2],industries:item[3]}})},$scope.getBenchmarkValue=function(timePeriod){var result=0;return $scope.chartData[timePeriod].forEach(function(item){item[0]===$scope.benchmarkName&&(result=item[1])}),result};$scope.updateChartWithTimePeriod=function(timePeriod,$event){$scope.chart&&$scope.chart.update({yAxis:{plotLines:[{color:$scope.benchmarkColor,width:1,value:$scope.getBenchmarkValue(timePeriod),dashStyle:"LongDash",label:{useHTML:!0,text:'<span class="label">'+$scope.getBenchmarkValue(timePeriod)+"%</span>",textAlign:"left",x:-45,y:2,style:{fontSize:"12px",padding:"3px 5px",color:"#fff",fontWeight:"bold",backgroundColor:$scope.benchmarkColor,border:"1px solid "+$scope.benchmarkColor,borderRadius:"5px"},formatter:function(){return $scope.getBenchmarkValue(timePeriod)+"%"}}},{color:"#b3b3b3",width:2,value:0}]},series:[{name:timePeriod,data:$scope.getChartValueData($scope.chartData[timePeriod]).slice()}]},!0,!1,{duration:800});var el=angular.element($event.target);$element.find(".nav-pills .nav-item.active").removeClass("active"),el.closest(".nav-item").addClass("active")},$scope.getColumnColor=function(value){return 1<value?APP_CONFIG.chartColors.sectorColors.largeGainColor:value<=1&&0<value?APP_CONFIG.chartColors.sectorColors.smallGainColor:value<0&&-1<=value?APP_CONFIG.chartColors.sectorColors.smallLossColor:value<-1?APP_CONFIG.chartColors.sectorColors.largeLossColor:""},$scope.getIndustryValueForChartTooltip=function(sectorChildren,timePeriod){var industries=[];return sectorChildren&&angular.isArray(sectorChildren)&&sectorChildren.forEach(function(industry){industry[timePeriod]&&industry[timePeriod].pctChange&&industries.push({desc:industry.desc,value:+$filter("sviNumber")(industry[timePeriod].pctChange)})}),industries},$scope.initChart=function(){var seriesData=function(data){$scope.chartData[$scope.labels.today]=[],$scope.chartData[$scope.labels.thisWeek]=[],$scope.chartData[$scope.labels.thisMonth]=[],$scope.chartData[$scope.labels.thisYear]=[],$scope.chartData[$scope.labels.lastMonth]=[],$scope.chartData[$scope.labels.lastWeek]=[];var xCategories=[];return data.map(function(sector){if(!0!==sector.benchmark||$scope.benchmarkName||($scope.benchmarkName=sector.desc),sector.quote){var quoteChange=+$filter("sviNumber")(sector.quote.pctChange);$scope.chartData[$scope.labels.today].push([sector.desc,quoteChange,$scope.getColumnColor(quoteChange),$scope.getIndustryValueForChartTooltip(sector.children,"quote")])}if(sector.weekToDate){var thisWeekChange=+$filter("sviNumber")(sector.weekToDate.pctChange);$scope.chartData[$scope.labels.thisWeek].push([sector.desc,thisWeekChange,$scope.getColumnColor(thisWeekChange),$scope.getIndustryValueForChartTooltip(sector.children,"weekToDate")])}if(sector.monthToDate){var thisMonthChange=+$filter("sviNumber")(sector.monthToDate.pctChange);$scope.chartData[$scope.labels.thisMonth].push([sector.desc,thisMonthChange,$scope.getColumnColor(thisMonthChange),$scope.getIndustryValueForChartTooltip(sector.children,"monthToDate")])}if(sector.yearToDate){var thisYearChange=+$filter("sviNumber")(sector.yearToDate.pctChange);$scope.chartData[$scope.labels.thisYear].push([sector.desc,thisYearChange,$scope.getColumnColor(thisYearChange),$scope.getIndustryValueForChartTooltip(sector.children,"yearToDate")])}if(sector.lastMonth){var lastMonthChange=+$filter("sviNumber")(sector.lastMonth.pctChange);$scope.chartData[$scope.labels.lastMonth].push([sector.desc,lastMonthChange,$scope.getColumnColor(lastMonthChange),$scope.getIndustryValueForChartTooltip(sector.children,"lastMonth")])}if(sector.lastWeek){var lastWeekChange=+$filter("sviNumber")(sector.lastWeek.pctChange);$scope.chartData[$scope.labels.lastWeek].push([sector.desc,lastWeekChange,$scope.getColumnColor(lastWeekChange),$scope.getIndustryValueForChartTooltip(sector.children,"lastWeek")])}xCategories.push(sector.desc)}),{xCategories:xCategories}}($scope.sectors),options=$.extend(!0,{},$scope.getOptions());options.xAxis.categories=seriesData.xCategories,$scope.chart&&$scope.chart.destroy(),$scope.chart=highcharts.getChart(options)},$scope.parentTabSelector&&angular.element($scope.parentTabSelector).on("shown.bs.tab",function(e){$scope.chart.reflow()})}]}}]),angular.module("svi.research").directive("sviSectorIndustriesContainer",["APP_CONFIG","$templateCache","$timeout","labels","loader","exchange","widget","piwik","grid","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,exchange,widget,piwik,grid,eventDispatcher){return{replace:!1,scope:{},template:$templateCache.get("sectorIndustriesContainer/sectorIndustriesContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="sectorIndustriesContainer",this.friendlyName="Sectors & Industries Container",$scope.sectors=null,labels.setupLabels($scope,["sectorsIndustriesOverview"]),grid.attachSorting($scope,$element,$attrs,"desc","asc"),grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){var params={sortField:$scope.sortField,sortDir:$scope.sortDir,includeIndustries:"Y"};return exchange.getSectors(params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.sectors=data.sectors.sectors}catch(e){$scope.sectors=[]}}),widget.attach($scope,$element),eventDispatcher.on("SECTORS.SORT.CHANGED",function(e,data){$scope.sortField===data.field&&$scope.sortDir===data.dir||($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.api.load())},!0),$timeout(function(){$scope.initComplete=!0,$scope.sectors||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviSectorIndustriesGrid",["APP_CONFIG","$templateCache","labels","eventDispatcher","expander","floatThead",function(APP_CONFIG,$templateCache,labels,eventDispatcher,expander,floatThead){return{replace:!1,scope:{sectors:"=",sortField:"=?",sortDir:"=?"},template:$templateCache.get("sectorIndustriesGrid/sectorIndustriesGrid.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){this.name="sectorIndustriesGrid",this.friendlyName="Sectors & Industries Grid",this.eventName="SECTORS",$scope.sortable=!0,$scope.responsiveColumnsSettings={enabled:!0,priority:["today","week","month","year","last-week","last-month"],breakpoints:{xs:2,sm:3,md:6}},$scope.colspan=$scope.responsiveColumnsSettings.priority.length,labels.setupLabels($scope,["sectorsIndustriesOverview"]),floatThead.init($scope,$element),expander.init($scope,"SECTORS.INDUSTRIES",$element),$scope.$watch("sectors",function(){expander.reset($scope)}),$scope.api=this;var processData=function(){$scope.benchmarks=[],$scope.processedSectors={},$scope.dropdownOptions||($scope.dropdownOptions=[{display:"All sectors",value:"all"}],$scope.sectors.map(function(sector){if(!1===sector.benchmark){var key=sector.desc.replace(/\W+/g," ").split(/ |\B(?=[A-Z])/).join("");$scope.dropdownOptions.push({display:sector.desc,value:key})}})),$scope.sectors.map(function(sector,index){if(sector.benchmark)$scope.benchmarks.push(sector);else{var key=sector.desc.replace(/\W+/g," ").split(/ |\B(?=[A-Z])/).join("");$scope.processedSectors[key]=sector}}),$scope.filteredValue&&$scope.processedSectors[$scope.filteredValue]?($scope.displayingSectors={},$scope.displayingSectors[$scope.filteredValue]=$scope.processedSectors[$scope.filteredValue]):$scope.displayingSectors=$scope.processedSectors};processData(),$scope.$watch("sectors",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&processData()}),$scope.collapseChildren=function(industries,index){industries.forEach(function(item,i){var childrenIndex=index+"_"+i;item.children?(expander.collapse($scope,childrenIndex),$scope.rc.collapseRow(childrenIndex),$scope.collapseChildren(item.children,childrenIndex)):($scope.rc.collapseRow(childrenIndex),expander.collapse($scope,childrenIndex))})},eventDispatcher.on("EXPANDER.SECTORS.INDUSTRIES",function(e,data){var pathIds=data.target.split("_"),item=$scope.displayingSectors;pathIds.forEach(function(id){item[id]?item=item[id]:item.children&&(item=item.children[id])}),!1===data.show&&item.children&&$scope.collapseChildren(item.children,data.target),item.expanded=data.show}),eventDispatcher.on("SECTORS.INDUSTRIES.FILTER.CHANGED",function(e,data){if($scope.defaultView!==data.value)for(var key in $scope.filteredValue=data.value,$scope.processedSectors[data.value]?($scope.displayingSectors={},$scope.displayingSectors[data.value]=$scope.processedSectors[data.value]):$scope.displayingSectors=$scope.processedSectors,$scope.visibleRows){var sectorKey=key.split("_");sectorKey=sectorKey[0],$scope.displayingSectors[sectorKey]&&$scope.displayingSectors[sectorKey].children&&$scope.collapseChildren($scope.displayingSectors[sectorKey].children,sectorKey)}},!0)}]}}]),angular.module("svi.research").directive("sviStockBalanceSheet",["APP_CONFIG","$templateCache","$timeout","$filter","labels","eventDispatcher","expander","floatThead","loader","piwik","widget","stockInfo","grid",function(APP_CONFIG,$templateCache,$timeout,$filter,labels,eventDispatcher,expander,floatThead,loader,piwik,widget,stockInfo,grid){return{replace:!1,scope:{symbol:"@",balanceKeys:"@"},template:$templateCache.get("stockBalanceSheet/stockBalanceSheet.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){this.name="stockBalanceSheet",this.friendlyName="Stock Balance Sheet",this.eventName="BALANCE.SHEET",$scope.sortable=!1,$scope.balances=null,$scope.dropdownOptions=[{display:"Annual",value:"annual"},{display:"Quarterly",value:"interim"}],$scope.responsiveColumnsSettings={enabled:!0,priority:["fiscalPeriod","Y1","Y2","Y3","Y4","Y5","Y6"]},svi.ng.defaultString($scope,$attrs,"balanceKeys",'{"industries":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Current Assets":{"isHeader":true,"item":false},"Cash":{"isHeader":false,"item":"cash"},"Cash & Equivalents":{"isHeader":false,"item":"cashAndEquivalents"},"Short Term Investments":{"isHeader":false,"item":"shortTermInvestments"},"Cash and Short Term Investments":{"isHeader":false,"item":"cashAndShortTermInvestments"},"Accounts Receivable - Trade, Net":{"isHeader":false,"item":"accountsReceivableTradeNet"},"Total Receivables, Net":{"isHeader":false,"item":"totalReceivablesNet"},"Total Inventory":{"isHeader":false,"item":"totalInventory"},"Prepaid Expenses":{"isHeader":false,"item":"prepaidExpenses"},"Other Current Assets, Total":{"isHeader":false,"item":"otherCurrentAssetsTotal"},"Total Current Assets":{"isHeader":false,"item":"totalCurrentAssets","isLast":true},"Non-Current Assets":{"isHeader":true,"item":false},"Property\\/Plant\\/Equipment, Total - Gross":{"isHeader":false,"item":"propertyPlantEquipmentTotalGross"},"Accumulated Depreciation, Total":{"isHeader":false,"item":"accumulatedDepreciationTotal"},"Property\\/Plant\\/Equipment, Total - Net":{"isHeader":false,"item":"propertyPlantEquipmentTotalNet"},"Goodwill, Net":{"isHeader":false,"item":"goodwillNet"},"Intangibles, Net":{"isHeader":false,"item":"intangiblesNet"},"Long Term Investments":{"isHeader":false,"item":"longTermInvestments"},"Note Receivable - Long Term":{"isHeader":false,"item":"noteReceivableLongTerm"},"Other Long Term Assets, Total":{"isHeader":false,"item":"otherLongTermAssetsTotal"},"Other Assets, Total":{"isHeader":false,"item":"otherAssetsTotal"},"Total Assets":{"isHeader":true,"item":"totalAssets","isLast":true},"Current Liabilities":{"isHeader":true,"item":false},"Accounts Payable":{"isHeader":false,"item":"accountsPayable"},"Payable\\/Accrued":{"isHeader":false,"item":"payableAccrued"},"Accrued Expenses":{"isHeader":false,"item":"accruedExpenses"},"Notes Payable\\/Short Term Debt":{"isHeader":false,"item":"notesPayableShortTermDebt"},"Current Port. of LT Debt\\/Capital Leases":{"isHeader":false,"item":"currentPortOfLTDebtCapitalLeases"},"Other Current liabilities, Total":{"isHeader":false,"item":"otherCurrentLiabilitiesTotal"},"Total Current Liabilities":{"isHeader":true,"item":"totalCurrentLiabilities","isLast":true},"Long Term Liabilities":{"isHeader":true,"item":false},"Long Term Debt":{"isHeader":false,"item":"longTermDebt"},"Capital Lease Obligations":{"isHeader":false,"item":"capitalLeaseObligations"},"Total Long Term Debt":{"isHeader":false,"item":"totalLongTermDebt"},"Total Debt":{"isHeader":false,"item":"totalDebt"},"Deferred Taxes":{"isHeader":false,"item":"deferredIncomeTax"},"Minority Interest":{"isHeader":false,"item":"minorityInterest"},"Other Liabilities, Total":{"isHeader":false,"item":"otherLiabilitiesTotal"},"Total Long Term Liabilities":{"isHeader":true,"item":false},"Total Liabilities":{"isHeader":true,"item":"totalLiabilities","isLast":true},"Equity":{"isHeader":true,"item":false},"Redeemable Preferred Stock":{"isHeader":false,"item":"redeemablePreferredStock"},"Preferred Stock - Non Redeemable, Net":{"isHeader":false,"item":"preferredStockNonRedeemableNet"},"Common Stock, Total":{"isHeader":false,"item":"commonStock"},"Additional Paid-In Capital":{"isHeader":false,"item":"additionalPaidInCapital"},"Retained Earnings (Accumulated Deficit)":{"isHeader":false,"item":"retainedEarningsAccumulatedDeficit"},"Treasury Stock - Common":{"isHeader":false,"item":"treasuryStockCommon"},"ESOP Debt Guarantee":{"isHeader":false,"item":"esopDebtGuarantee"},"Unrealized Gain (Loss)":{"isHeader":false,"item":"unrealizedGainLoss"},"Other Equity, Total":{"isHeader":false,"item":"otherEquityTotal"},"Total Equity":{"isHeader":true,"item":"totalEquity"},"Total Liabilities & Shareholders\' Equity":{"isHeader":true,"item":"totalLiabilitiesAndShareholdersEquity","isLast":true},"Total Common Shares Outstanding":{"isHeader":false,"item":"totalCommonSharesOutstanding"},"Tangible Book Value per Share, Common Eq":{"isHeader":false,"item":"tangibleBookValuePerShareCommonEq","decimal":2}},"bank":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Non-Current Assets":{"isHeader":true,"item":false},"Cash & Due from Banks":{"isHeader":false,"item":"cashAndDueFromBanks"},"Other Earning Assets, Total":{"isHeader":false,"item":"otherEarningAssetsTotal"},"Net Loans":{"isHeader":false,"item":"netLoans"},"Property\\/Plant\\/Equipment, Total - Gross":{"isHeader":false,"item":"propertyPlantEquipmentTotalGross"},"Accumulated Depreciation, Total":{"isHeader":false,"item":"accumulatedDepreciationTotal"},"Property\\/Plant\\/Equipment, Total - Net":{"isHeader":false,"item":"propertyPlantEquipmentTotalNet"},"Goodwill, Net":{"isHeader":false,"item":"goodwillNet"},"Intangibles, Net":{"isHeader":false,"item":"intangiblesNet"},"Long Term Investments":{"isHeader":false,"item":"longTermInvestments"},"Other Long Term Assets, Total":{"isHeader":false,"item":"otherLongTermAssetsTotal"},"Other Assets, Total":{"isHeader":false,"item":"otherAssetsTotal"},"Total Assets":{"isHeader":true,"item":"totalAssets","isLast":true},"Current Liabilities":{"isHeader":true,"item":false},"Accounts Payable":{"isHeader":false,"item":"accountsPayable"},"Payable\\/Accrued":{"isHeader":false,"item":"payableAccrued"},"Accrued Expenses":{"isHeader":false,"item":"accruedExpenses"},"Total Deposits":{"isHeader":false,"item":"totalDeposits"},"Other Bearing Liabilities, Total":{"isHeader":false,"item":"otherBearingLiabilitiesTotal"},"Total Short Term Borrowings":{"isHeader":false,"item":"totalShortTermBorrowings"},"Current Port. of LT Debt\\/Capital Leases":{"isHeader":false,"item":"currentPortOfLTDebtCapitalLeases"},"Other Current liabilities, Total":{"isHeader":false,"item":"otherCurrentLiabilitiesTotal","isLast":true},"Long Term Liabilities":{"isHeader":true,"item":false},"Long Term Debt":{"isHeader":false,"item":"longTermDebt"},"Capital Lease Obligations":{"isHeader":false,"item":"capitalLeaseObligations"},"Total Long Term Debt":{"isHeader":false,"item":"totalLongTermDebt"},"Total Debt":{"isHeader":false,"item":"totalDebt"},"Deferred Taxes":{"isHeader":false,"item":"deferredIncomeTax"},"Minority Interest":{"isHeader":false,"item":"minorityInterest"},"Other Liabilities, Total":{"isHeader":false,"item":"otherLiabilitiesTotal"},"Total Long Term Liabilities":{"isHeader":true,"item":false},"Total Liabilities":{"isHeader":true,"item":"totalLiabilities","isLast":true},"Equity":{"isHeader":true,"item":false},"Redeemable Preferred Stock":{"isHeader":false,"item":"redeemablePreferredStock"},"Preferred Stock - Non Redeemable, Net":{"isHeader":false,"item":"preferredStockNonRedeemableNet"},"Common Stock, Total":{"isHeader":false,"item":"commonStock"},"Additional Paid-In Capital":{"isHeader":false,"item":"additionalPaidInCapital"},"Retained Earnings (Accumulated Deficit)":{"isHeader":false,"item":"retainedEarningsAccumulatedDeficit"},"Treasury Stock - Common":{"isHeader":false,"item":"treasuryStockCommon"},"ESOP Debt Guarantee":{"isHeader":false,"item":"esopDebtGuarantee"},"Unrealized Gain (Loss)":{"isHeader":false,"item":"unrealizedGainLoss"},"Other Equity, Total":{"isHeader":false,"item":"otherEquityTotal"},"Total Equity":{"isHeader":true,"item":"totalEquity"},"Total Liabilities & Shareholders\' Equity":{"isHeader":true,"item":"totalLiabilitiesAndShareholdersEquity","isLast":true},"Total Common Shares Outstanding":{"isHeader":false,"item":"totalCommonSharesOutstanding"},"Tangible Book Value per Share, Common Eq":{"isHeader":false,"item":"tangibleBookValuePerShareCommonEq","decimal":2}},"insurance":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Current Assets":{"isHeader":true,"item":false},"Cash":{"isHeader":false,"item":"cash"},"Cash & Equivalents":{"isHeader":false,"item":"cashAndEquivalents"},"Total Receivables, Net":{"isHeader":false,"item":"totalReceivablesNet"},"Prepaid Expenses":{"isHeader":false,"item":"prepaidExpenses","isLast":true},"Non-Current Assets":{"isHeader":true,"item":false},"Property\\/Plant\\/Equipment, Total - Gross":{"isHeader":false,"item":"propertyPlantEquipmentTotalGross"},"Accumulated Depreciation, Total":{"isHeader":false,"item":"accumulatedDepreciationTotal"},"Property\\/Plant\\/Equipment, Total - Net":{"isHeader":false,"item":"propertyPlantEquipmentTotalNet"},"Goodwill, Net":{"isHeader":false,"item":"goodwillNet"},"Intangibles, Net":{"isHeader":false,"item":"intangiblesNet"},"Long Term Investments":{"isHeader":false,"item":"longTermInvestments"},"Insurance Receivables":{"isHeader":false,"item":"insuranceReceivables"},"Note Receivable - Long Term":{"isHeader":false,"item":"noteReceivableLongTerm"},"Other Long Term Assets, Total":{"isHeader":false,"item":"otherLongTermAssetsTotal"},"Deferred Policy Acquisition Costs":{"isHeader":false,"item":"deferredPolicyAcquisitionCosts"},"Other Assets, Total":{"isHeader":false,"item":"otherAssetsTotal"},"Total Assets":{"isHeader":true,"item":"totalAssets","isLast":true},"Current Liabilities":{"isHeader":true,"item":false},"Accounts Payable":{"isHeader":false,"item":"accountsPayable"},"Payable\\/Accrued":{"isHeader":false,"item":"payableAccrued"},"Accrued Expenses":{"isHeader":false,"item":"accruedExpenses"},"Policy Liabilities ":{"isHeader":false,"item":"policyLiabilities"},"Notes Payable\\/Short Term Debt":{"isHeader":false,"item":"notesPayableShortTermDebt"},"Current Port. of LT Debt\\/Capital Leases":{"isHeader":false,"item":"currentPortOfLTDebtCapitalLeases"},"Other Current liabilities, Total":{"isHeader":false,"item":"otherCurrentLiabilitiesTotal","isLast":true},"Long Term Liabilities":{"isHeader":true,"item":false},"Long Term Debt":{"isHeader":false,"item":"longTermDebt"},"Capital Lease Obligations":{"isHeader":false,"item":"capitalLeaseObligations"},"Total Long Term Debt":{"isHeader":false,"item":"totalLongTermDebt"},"Total Debt":{"isHeader":false,"item":"totalDebt"},"Deferred Taxes":{"isHeader":false,"item":"deferredIncomeTax"},"Minority Interest":{"isHeader":false,"item":"minorityInterest"},"Other Liabilities, Total":{"isHeader":false,"item":"otherLiabilitiesTotal"},"Total Long Term Liabilities":{"isHeader":true,"item":false},"Total Liabilities":{"isHeader":true,"item":"totalLiabilities","isLast":true},"Equity":{"isHeader":true,"item":false},"Redeemable Preferred Stock":{"isHeader":false,"item":"redeemablePreferredStock"},"Preferred Stock - Non Redeemable, Net":{"isHeader":false,"item":"preferredStockNonRedeemableNet"},"Common Stock, Total":{"isHeader":false,"item":"commonStock"},"Additional Paid-In Capital":{"isHeader":false,"item":"additionalPaidInCapital"},"Retained Earnings (Accumulated Deficit)":{"isHeader":false,"item":"retainedEarningsAccumulatedDeficit"},"Treasury Stock - Common":{"isHeader":false,"item":"treasuryStockCommon"},"ESOP Debt Guarantee":{"isHeader":false,"item":"esopDebtGuarantee"},"Unrealized Gain (Loss)":{"isHeader":false,"item":"unrealizedGainLoss"},"Other Equity, Total":{"isHeader":false,"item":"otherEquityTotal"},"Total Equity":{"isHeader":true,"item":"totalEquity"},"Total Liabilities & Shareholders\' Equity":{"isHeader":true,"item":"totalLiabilitiesAndShareholdersEquity","isLast":true},"Total Common Shares Outstanding":{"isHeader":false,"item":"totalCommonSharesOutstanding"},"Tangible Book Value per Share, Common Eq":{"isHeader":false,"item":"tangibleBookValuePerShareCommonEq","decimal":2}},"utility":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Current Assets":{"isHeader":true,"item":false},"Cash":{"isHeader":false,"item":"cash"},"Cash & Equivalents":{"isHeader":false,"item":"cashAndEquivalents"},"Short Term Investments":{"isHeader":false,"item":"shortTermInvestments"},"Cash and Short Term Investments":{"isHeader":false,"item":"cashAndShortTermInvestments"},"Accounts Receivable - Trade, Net":{"isHeader":false,"item":"accountsReceivableTradeNet"},"Total Receivables, Net":{"isHeader":false,"item":"totalReceivablesNet"},"Total Inventory":{"isHeader":false,"item":"totalInventory"},"Prepaid Expenses":{"isHeader":false,"item":"prepaidExpenses"},"Other Current Assets, Total":{"isHeader":false,"item":"otherCurrentAssetsTotal"},"Total Current Assets":{"isHeader":false,"item":"totalCurrentAssets","isLast":true},"Non-Current Assets":{"isHeader":true,"item":false},"Property\\/Plant\\/Equipment, Total - Gross":{"isHeader":false,"item":"propertyPlantEquipmentTotalGross"},"Accumulated Depreciation, Total":{"isHeader":false,"item":"accumulatedDepreciationTotal"},"Property\\/Plant\\/Equipment, Total - Net":{"isHeader":false,"item":"propertyPlantEquipmentTotalNet"},"Goodwill, Net":{"isHeader":false,"item":"goodwillNet"},"Intangibles, Net":{"isHeader":false,"item":"intangiblesNet"},"Total Utility Plant, Net":{"isHeader":false,"item":"totalUtilityPlantNet"},"Long Term Investments":{"isHeader":false,"item":"longTermInvestments"},"Note Receivable - Long Term":{"isHeader":false,"item":"noteReceivableLongTerm"},"Other Long Term Assets, Total":{"isHeader":false,"item":"otherLongTermAssetsTotal"},"Other Assets, Total":{"isHeader":false,"item":"otherAssetsTotal"},"Total Assets":{"isHeader":true,"item":"totalAssets","isLast":true},"Current Liabilities":{"isHeader":true,"item":false},"Accounts Payable":{"isHeader":false,"item":"accountsPayable"},"Payable\\/Accrued":{"isHeader":false,"item":"payableAccrued"},"Accrued Expenses":{"isHeader":false,"item":"accruedExpenses"},"Notes Payable\\/Short Term Debt":{"isHeader":false,"item":"notesPayableShortTermDebt"},"Current Port. of LT Debt\\/Capital Leases":{"isHeader":false,"item":"currentPortOfLTDebtCapitalLeases"},"Other Current liabilities, Total":{"isHeader":false,"item":"otherCurrentLiabilitiesTotal"},"Total Current Liabilities":{"isHeader":true,"item":"totalCurrentLiabilities","isLast":true},"Long Term Liabilities":{"isHeader":true,"item":false},"Long Term Debt":{"isHeader":false,"item":"longTermDebt"},"Capital Lease Obligations":{"isHeader":false,"item":"capitalLeaseObligations"},"Total Long Term Debt":{"isHeader":false,"item":"totalLongTermDebt"},"Total Debt":{"isHeader":false,"item":"totalDebt"},"Deferred Taxes":{"isHeader":false,"item":"deferredIncomeTax"},"Minority Interest":{"isHeader":false,"item":"minorityInterest"},"Other Liabilities, Total":{"isHeader":false,"item":"otherLiabilitiesTotal"},"Total Long Term Liabilities":{"isHeader":true,"item":false},"Total Liabilities":{"isHeader":true,"item":"totalLiabilities","isLast":true},"Equity":{"isHeader":true,"item":false},"Redeemable Preferred Stock":{"isHeader":false,"item":"redeemablePreferredStock"},"Preferred Stock - Non Redeemable, Net":{"isHeader":false,"item":"preferredStockNonRedeemableNet"},"Common Stock, Total":{"isHeader":false,"item":"commonStock"},"Additional Paid-In Capital":{"isHeader":false,"item":"additionalPaidInCapital"},"Retained Earnings (Accumulated Deficit)":{"isHeader":false,"item":"retainedEarningsAccumulatedDeficit"},"Treasury Stock - Common":{"isHeader":false,"item":"treasuryStockCommon"},"ESOP Debt Guarantee":{"isHeader":false,"item":"esopDebtGuarantee"},"Unrealized Gain (Loss)":{"isHeader":false,"item":"unrealizedGainLoss"},"Other Equity, Total":{"isHeader":false,"item":"otherEquityTotal"},"Total Equity":{"isHeader":true,"item":"totalEquity"},"Total Liabilities & Shareholders\' Equity":{"isHeader":true,"item":"totalLiabilitiesAndShareholdersEquity","isLast":true},"Total Common Shares Outstanding":{"isHeader":false,"item":"totalCommonSharesOutstanding"},"Tangible Book Value per Share, Common Eq":{"isHeader":false,"item":"tangibleBookValuePerShareCommonEq","decimal":2}}}');try{svi.ng.parseJSON($scope,$attrs,"balanceKeys")}catch(e){throw"sviStockBalanceSheet: "+e}labels.setupLabels($scope,["stockBalanceSheet"]),floatThead.init($scope,$element),$scope.api=this,grid.attachGrid($scope,$element);var setBalancesData=function(balances,balanceItem,template){for(var balanceKey in $scope.balanceKeys[template]){var balanceConfigItem=$scope.balanceKeys[template][balanceKey],value=balanceItem.balance[balanceConfigItem.item];if(balanceKey===$scope.labels.periodEndDate&&(value=$filter("sviDate")(value,"MM/dd/yyyy")),angular.isNumber(value)||!value&&balanceConfigItem.item){var decimal=balanceConfigItem.decimal?balanceConfigItem.decimal:0;value=$filter("sviNumber")(value,decimal,!0)}balances[balanceKey].data.push(value)}return balances};$scope.api.isReadyToLoad=function(){return null!==$scope.symbol&&!1!==$scope.symbol&&""!==$scope.symbol},eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){eventDispatcher.trigger("EVENTS.BALANCE.SHEET.FILTER.CHANGED",{display:"Annual",value:"annual"}),angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),eventDispatcher.on("EVENTS.BALANCE.SHEET.FILTER.CHANGED",function(e,data){$scope.defaultView!==data.value&&($scope.defaultView=data.value,"annual"===data.value&&($scope.balances=$scope.balancesAnnual,$scope.headers=$scope.headersAnnual,$scope.colspan=$scope.colspanAnnual),"interim"===data.value&&($scope.balances=$scope.balancesInterim,$scope.headers=$scope.headersInterim,$scope.colspan=$scope.colspanInterim))},!0),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),loader.attach($scope,$element,function(invalidateCache){return $scope.balances=null,stockInfo.getStockFinancials($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{var seriesData=function(data){var balancesAnnual={},balancesInterim={},headersAnnual=[],headersInterim=[];for(var balanceKey in $scope.balanceKeys[data.template]){var balanceItem=$scope.balanceKeys[data.template][balanceKey];balancesAnnual[balanceKey]={isHeader:balanceItem.isHeader,data:[],isLast:balanceItem.isLast}}return balancesInterim=JSON.parse(JSON.stringify(balancesAnnual)),data.annual.forEach(function(item){item.balance&&(balancesAnnual=setBalancesData(balancesAnnual,item,data.template),headersAnnual.push($filter("sviDate")(item.balance.periodEndDate,"yyyy")))}),data.interim.forEach(function(item){if(item.balance){balancesInterim=setBalancesData(balancesInterim,item,data.template);var date=new Date(item.balance.periodEndDate),quarter=Math.ceil((date.getMonth()+1)/3),year=date.getFullYear();headersInterim.push("Q"+quarter+" "+year)}}),$scope.colspanAnnual=headersAnnual.length+1,$scope.colspanInterim=headersInterim.length+1,{headersAnnual:headersAnnual,headersInterim:headersInterim,balancesAnnual:balancesAnnual,balancesInterim:balancesInterim}}(data.stockFinancials);$scope.balancesAnnual=seriesData.balancesAnnual,$scope.balancesInterim=seriesData.balancesInterim,$scope.headersAnnual=seriesData.headersAnnual,$scope.headersInterim=seriesData.headersInterim,$scope.balances=$scope.balancesAnnual,$scope.headers=$scope.headersAnnual,$scope.colspan=$scope.colspanAnnual}catch(e){$scope.balances={}}}),widget.attach($scope,$element),$timeout(function(){$scope.initComplete=!0,$scope.balances||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockCashFlow",["APP_CONFIG","$templateCache","$timeout","labels","loader","stockInfo","$filter","piwik","eventDispatcher","grid",function(APP_CONFIG,$templateCache,$timeout,labels,loader,stockInfo,$filter,piwik,eventDispatcher,grid){return{scope:{symbol:"@",templates:"@"},template:$templateCache.get("stockCashFlow/stockCashFlow.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="stockCashFlow",this.friendlyName="Stock Cash Flow",svi.ng.defaultString($scope,$attrs,"templates",'{"industries":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Operating Activities":{"isHeader":true,"item":false},"Net Income\\/Starting Line":{"isHeader":false,"item":"netIncomeStartingLine"},"Depreciation\\/Depletion":{"isHeader":false,"item":"depreciationDepletion"},"Amortization":{"isHeader":false,"item":"amortization"},"Deferred Taxes":{"isHeader":false,"item":"deferredTaxes"},"Non-Cash Items":{"isHeader":false,"item":"nonCashItems"},"Cash Receipts":{"isHeader":false,"item":"cashReceipts"},"Cash Payments":{"isHeader":false,"item":"cashPayments"},"Cash Taxes Paid":{"isHeader":false,"item":"cashTaxesPaid"},"Cash Interest Paid":{"isHeader":false,"item":"cashInterestPaid"},"Changes in Working Capital":{"isHeader":false,"item":"changesInWorkingCapital"},"Cash from Operating Activities":{"isHeader":false,"item":"cashFromOperatingActivities","isLast":true},"Investing Activities":{"isHeader":true,"item":false},"Capital Expenditures":{"isHeader":false,"item":"capitalExpenditures"},"Other Investing Cash Flow Items, Total":{"isHeader":false,"item":"otherInvestingCashFlowItemsTotal"},"Cash from Investing Activities":{"isHeader":false,"item":"cashFromInvestingActivities","isLast":true},"Financing Activities":{"isHeader":true,"item":false},"Financing Cash Flow Items":{"isHeader":false,"item":"financingCashFlowItems"},"Total Cash Dividends Paid":{"isHeader":false,"item":"totalCashDividendsPaid"},"Issuance (Retirement) of Stock, Net":{"isHeader":false,"item":"issuanceRetirementOfStockNet"},"Issuance (Retirement) of Debt, Net":{"isHeader":false,"item":"issuanceRetirementOfDebtNet"},"Cash from Financing Activities":{"isHeader":false,"item":"cashFromFinancingActivities","isLast":true},"Change in Cash ":{"isHeader":true,"item":false},"Foreign Exchange Effects":{"isHeader":false,"item":"foreignExchangeEffects"},"Net Change in Cash":{"isHeader":false,"item":"netChangeInCash"}},"bank":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Operating Activities":{"isHeader":true,"item":false},"Net Income\\/Starting Line":{"isHeader":false,"item":"netIncomeStartingLine"},"Depreciation\\/Depletion":{"isHeader":false,"item":"depreciationDepletion"},"Amortization":{"isHeader":false,"item":"amortization"},"Deferred Taxes":{"isHeader":false,"item":"deferredTaxes"},"Non-Cash Items":{"isHeader":false,"item":"nonCashItems"},"Cash Receipts":{"isHeader":false,"item":"cashReceipts"},"Cash Payments":{"isHeader":false,"item":"cashPayments"},"Cash Taxes Paid":{"isHeader":false,"item":"cashTaxesPaid"},"Cash Interest Paid":{"isHeader":false,"item":"cashInterestPaid"},"Changes in Working Capital":{"isHeader":false,"item":"changesInWorkingCapital"},"Cash from Operating Activities":{"isHeader":false,"item":"cashFromOperatingActivities","isLast":true},"Investing Activities":{"isHeader":true,"item":false},"Capital Expenditures":{"isHeader":false,"item":"capitalExpenditures"},"Other Investing Cash Flow Items, Total":{"isHeader":false,"item":"otherInvestingCashFlowItemsTotal"},"Cash from Investing Activities":{"isHeader":false,"item":"cashFromInvestingActivities","isLast":true},"Financing Activities":{"isHeader":true,"item":false},"Financing Cash Flow Items":{"isHeader":false,"item":"financingCashFlowItems"},"Total Cash Dividends Paid":{"isHeader":false,"item":"totalCashDividendsPaid"},"Issuance (Retirement) of Stock, Net":{"isHeader":false,"item":"issuanceRetirementOfStockNet"},"Issuance (Retirement) of Debt, Net":{"isHeader":false,"item":"issuanceRetirementOfDebtNet"},"Cash from Financing Activities":{"isHeader":false,"item":"cashFromFinancingActivities","isLast":true},"Change in Cash And Cash Equivalents":{"isHeader":true,"item":false},"Foreign Exchange Effects":{"isHeader":false,"item":"foreignExchangeEffects"},"Net Change in Cash":{"isHeader":false,"item":"netChangeInCash"}},"insurance":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Operating Activities":{"isHeader":true,"item":false},"Net Income\\/Starting Line":{"isHeader":false,"item":"netIncomeStartingLine"},"Depreciation\\/Depletion":{"isHeader":false,"item":"depreciationDepletion"},"Amortization":{"isHeader":false,"item":"amortization"},"Deferred Taxes":{"isHeader":false,"item":"deferredTaxes"},"Non-Cash Items":{"isHeader":false,"item":"nonCashItems"},"Cash Receipts":{"isHeader":false,"item":"cashReceipts"},"Cash Payments":{"isHeader":false,"item":"cashPayments"},"Cash Taxes Paid":{"isHeader":false,"item":"cashTaxesPaid"},"Cash Interest Paid":{"isHeader":false,"item":"cashInterestPaid"},"Changes in Working Capital":{"isHeader":false,"item":"changesInWorkingCapital"},"Cash from Operating Activities":{"isHeader":false,"item":"cashFromOperatingActivities","isLast":true},"Investing Activities":{"isHeader":true,"item":false},"Capital Expenditures":{"isHeader":false,"item":"capitalExpenditures"},"Other Investing Cash Flow Items, Total":{"isHeader":false,"item":"otherInvestingCashFlowItemsTotal"},"Cash from Investing Activities":{"isHeader":false,"item":"cashFromInvestingActivities","isLast":true},"Financing Activities":{"isHeader":true,"item":false},"Financing Cash Flow Items":{"isHeader":false,"item":"financingCashFlowItems"},"Total Cash Dividends Paid":{"isHeader":false,"item":"totalCashDividendsPaid"},"Issuance (Retirement) of Stock, Net":{"isHeader":false,"item":"issuanceRetirementOfStockNet"},"Issuance (Retirement) of Debt, Net":{"isHeader":false,"item":"issuanceRetirementOfDebtNet"},"Cash from Financing Activities":{"isHeader":false,"item":"cashFromFinancingActivities","isLast":true},"Change in Cash And Cash Equivalents":{"isHeader":true,"item":false},"Foreign Exchange Effects":{"isHeader":false,"item":"foreignExchangeEffects"},"Net Change in Cash":{"isHeader":false,"item":"netChangeInCash"}},"utility":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Operating Activities":{"isHeader":true,"item":false},"Net Income\\/Starting Line":{"isHeader":false,"item":"netIncomeStartingLine"},"Depreciation\\/Depletion":{"isHeader":false,"item":"depreciationDepletion"},"Amortization":{"isHeader":false,"item":"amortization"},"Deferred Taxes":{"isHeader":false,"item":"deferredTaxes"},"Non-Cash Items":{"isHeader":false,"item":"nonCashItems"},"Cash Receipts":{"isHeader":false,"item":"cashReceipts"},"Cash Payments":{"isHeader":false,"item":"cashPayments"},"Cash Taxes Paid":{"isHeader":false,"item":"cashTaxesPaid"},"Cash Interest Paid":{"isHeader":false,"item":"cashInterestPaid"},"Changes in Working Capital":{"isHeader":false,"item":"changesInWorkingCapital"},"Cash from Operating Activities":{"isHeader":false,"item":"cashFromOperatingActivities","isLast":true},"Investing Activities":{"isHeader":true,"item":false},"Capital Expenditures":{"isHeader":false,"item":"capitalExpenditures"},"Other Investing Cash Flow Items, Total":{"isHeader":false,"item":"otherInvestingCashFlowItemsTotal"},"Cash from Investing Activities":{"isHeader":false,"item":"cashFromInvestingActivities","isLast":true},"Financing Activities":{"isHeader":true,"item":false},"Financing Cash Flow Items":{"isHeader":false,"item":"financingCashFlowItems"},"Total Cash Dividends Paid":{"isHeader":false,"item":"totalCashDividendsPaid"},"Issuance (Retirement) of Stock, Net":{"isHeader":false,"item":"issuanceRetirementOfStockNet"},"Issuance (Retirement) of Debt, Net":{"isHeader":false,"item":"issuanceRetirementOfDebtNet"},"Cash from Financing Activities":{"isHeader":false,"item":"cashFromFinancingActivities","isLast":true},"Change in Cash And Cash Equivalents":{"isHeader":true,"item":false},"Foreign Exchange Effects":{"isHeader":false,"item":"foreignExchangeEffects"},"Net Change in Cash":{"isHeader":false,"item":"netChangeInCash"}}}');try{svi.ng.parseJSON($scope,$attrs,"templates")}catch(e){throw"sviStockIncomeStatement: "+e}$scope.cashAnnual=null,$scope.cashAnnualHeader=null,$scope.cashAnnualColspan=null,$scope.cashInterim=null,$scope.cashInterimHeader=null,$scope.cashInterimColspan=null,$scope.cashCurr=null,$scope.cashCurrHeader=null,$scope.cashCurrColspan=null,$scope.currentGrid="annual",$scope.dropdownOptions=[{display:"Annual",value:"annual"},{display:"Quarterly",value:"interim"}],$scope.sortable=!1,$scope.responsiveColumnsSettings={enabled:!0,priority:["name","Y1","Y2","Y3","Y4","Y5","Y6","Y7","Y8"]},grid.attachGrid($scope,$element),labels.setupLabels($scope,["stockCashFlowStatement"]);var processData=function(statements,template,quarterly){var headers=[],result={};for(var cashKey in $scope.templates[template]){var cashItem=$scope.templates[template][cashKey];result[cashKey]={isHeader:cashItem.isHeader,data:[],isLast:cashItem.isLast}}return statements.forEach(function(item){if(item.cashFlow){if(quarterly){var date=new Date(item.cashFlow.periodEndDate),quarter=Math.ceil((date.getMonth()+1)/3),year=date.getFullYear();headers.push("Q"+quarter+" "+year)}else headers.push($filter("sviDate")(item.cashFlow.periodEndDate,"yyyy"));result=function(cashFlow,cashFlowItem,template){for(var cashKey in $scope.templates[template]){var cashConfigItem=$scope.templates[template][cashKey],value=cashFlowItem.cashFlow[cashConfigItem.item];cashKey===$scope.labels.periodEndDate&&(value=$filter("sviDate")(value,"MM/dd/yyyy")),(angular.isNumber(value)||!value&&cashConfigItem.item)&&(value=$filter("sviNumber")(value,cashConfigItem.decimal?cashConfigItem.decimal:0,!0)),cashFlow[cashKey].data.push(value)}return cashFlow}(result,item,template)}}),{cashFlow:result,header:headers,colspan:headers.length+1}};loader.attach($scope,$element,function(invalidateCache){return $scope.cashAnnual=null,$scope.cashAnnualHeader=null,$scope.cashAnnualColspan=null,$scope.cashInterim=null,$scope.cashInterimHeader=null,$scope.cashInterimColspan=null,$scope.cashCurr=null,$scope.cashCurrHeader=null,$scope.cashCurrColspan=null,stockInfo.getStockFinancials($scope.symbol,invalidateCache)},function(data){piwik.trackPage($scope,data);try{labels.get(["stockCashFlowStatement"]).then(function(){var processedAnnual=processData(data.stockFinancials.annual,data.stockFinancials.template),processedInterim=processData(data.stockFinancials.interim,data.stockFinancials.template,!0);$scope.cashAnnual=processedAnnual.cashFlow,$scope.cashAnnualHeader=processedAnnual.header,$scope.cashAnnualColspan=processedAnnual.colspan,$scope.cashInterim=processedInterim.cashFlow,$scope.cashInterimHeader=processedInterim.header,$scope.cashInterimColspan=processedInterim.colspan,$scope.cashCurr=$scope.cashAnnual,$scope.cashCurrHeader=$scope.cashAnnualHeader,$scope.cashCurrColspan=$scope.cashAnnualColspan})}catch(e){throw"sviStockCashFlow: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),eventDispatcher.on("EVENTS.CASH.FLOW.FILTER.CHANGED",function(e,data){$scope.currentGrid!==data.value&&($scope.currentGrid=data.value,"annual"===data.value?($scope.cashCurrHeader=$scope.cashAnnualHeader,$scope.cashCurr=$scope.cashAnnual,$scope.cashCurrColspan=$scope.cashAnnualColspan):"interim"===data.value&&($scope.cashCurr=$scope.cashInterim,$scope.cashCurrHeader=$scope.cashInterimHeader,$scope.cashCurrColspan=$scope.cashInterimColspan))},!0),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.cashCurr||$scope.cashCurrHeader||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockCorporateEvents",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","$filter","eventDispatcher","floatThead","stockInfo",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,$filter,eventDispatcher,floatThead,stockInfo){return{scope:{symbol:"@"},template:$templateCache.get("stockCorporateEvents/stockCorporateEvents.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="StockCorporateEvents",this.friendlyName="Stock Corporate Events",$scope.corporateEvents=null,$scope.today=$filter("date")(new Date,"yyyy-MM-dd"),$scope.dateRange={endDate:$scope.today,startDate:$filter("date")(new Date((new Date).setFullYear((new Date).getFullYear()-1)),"yyyy-MM-dd")},$scope.categories=["Dividends","StockSplits","Earnings"],$scope.dropdownOptions=[{display:"Last 12 months",value:"lastYear"},{display:"Next 12 months",value:"nextYear"}],$scope.sortable=!1,$scope.responsiveColumnsSettings={enabled:!0,priority:["event","date","startTime","eventName","webcastLink"],formatters:{webcastLink:function(input){var url=input.match(/\bhttps?:\/\/\S+/gi);return url?'<a href="'+url[0]+'" target="_blank">'+$scope.labels.viewWebcast+"</a>":input}}},$scope.colspan=$scope.responsiveColumnsSettings.priority.length,$scope.setLoader=function(loader){$scope.loader=loader},floatThead.init($scope,$element),labels.setupLabels($scope,["general","stockCorporateEvents"]);loader.attach($scope,$element,function(invalidateCache){return $scope.corporateEvents=null,stockInfo.getEventHeadlines($scope.symbol,$scope.dateRange.startDate,$scope.dateRange.endDate,$scope.categories.join(","),invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{data.eventHeadlines.dividends||data.eventHeadlines.earnings||data.eventHeadlines.stockSplits||$scope.loader.setMessage($scope.labels.noEvents),$scope.corporateEvents=function(data){var result=[];return data.dividends&&data.dividends.forEach(function(item){result.push({type:$scope.labels.dividendsType,date:item.paymentDate,startTime:$scope.labels.noneText,name:item.name})}),data.stockSplits&&data.stockSplits.forEach(function(item){result.push({type:$scope.labels.stockSplitType,date:item.paymentDate,startTime:$scope.labels.noneText,name:item.name})}),data.earnings&&data.earnings.forEach(function(item){result.push({type:$scope.labels.earningsType,date:item.releaseDate,startTime:item.webcastStart?$filter("sviDate")(item.webcastStart,"h:mm a ET"):$scope.labels.noneText,name:item.name,liveWebcastUrl:item.liveWebcastUrl})}),$scope.dateRange.startDate===$scope.today?result.sort(function(a,b){return a.date>b.date?1:-1}):result.sort(function(a,b){return a.date<b.date?1:-1})}(data.eventHeadlines)}catch(e){throw"sviStockCorporateEvents: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),eventDispatcher.on("STOCK.CORPORATE.EVENTS.FILTER.CHANGED",function(e,data){$scope.defaultView!==data.value&&($scope.defaultView=data.value,"nextYear"===data.value&&($scope.dateRange={startDate:$scope.today,endDate:$filter("date")(new Date((new Date).setFullYear((new Date).getFullYear()+1)),"yyyy-MM-dd")}),"lastYear"===data.value&&($scope.dateRange={endDate:$scope.today,startDate:$filter("date")(new Date((new Date).setFullYear((new Date).getFullYear()-1)),"yyyy-MM-dd")}))},!0),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.$watch("dateRange",function(newVal,oldVal){null!==newVal&&""!==newVal&&newVal!==oldVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.corporateEvents||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockDetails",["APP_CONFIG","$templateCache","$timeout","labels","loader","stockInfo","piwik","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,stockInfo,piwik,eventDispatcher){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("stockDetails/stockDetails.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="StockDetails",this.friendlyName="Stock Details";try{svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"sviFundDetails: "+e}labels.setupLabels($scope,["general","stockDetails"]);loader.attach($scope,$element,function(invalidateCache){return $scope.data=null,stockInfo.getMetrics($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data),$scope.data=data.performance.details}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&(data.symbol=data.symbol.toUpperCase(),$scope.symbol!=data.symbol&&($scope.symbol=data.symbol))},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockDividendHistory",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","$filter","eventDispatcher","floatThead","stockInfo","dateUtils",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,$filter,eventDispatcher,floatThead,stockInfo,dateUtils){return{scope:{symbol:"@",endDate:"@",startDate:"@"},template:$templateCache.get("stockDividendHistory/stockDividendHistory.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="StockDividendHistory",this.friendlyName="Stock Dividend History",this.eventName="DIVIDENT.HISTORY",$scope.dividendHistory=null,svi.ng.defaultString($scope,$attrs,"endDate",$filter("date")(new Date,"yyyy-MM-dd")),svi.ng.defaultString($scope,$attrs,"startDate",$filter("date")(new Date((new Date).setFullYear((new Date).getFullYear()-1)),"yyyy-MM-dd")),$scope.category="Dividends",$scope.sortable=!1,$scope.responsiveColumnsSettings={enabled:!0,priority:["paymentDate","exDate","recordDate","dividendAmount"]},$scope.colspan=$scope.responsiveColumnsSettings.priority.length,$scope.setLoader=function(loader){$scope.loader=loader},floatThead.init($scope,$element),labels.setupLabels($scope,["general","stockDividendHistory"]);loader.attach($scope,$element,function(invalidateCache){return $scope.dividendHistory=null,stockInfo.getEventHeadlines($scope.symbol,$scope.startDate,$scope.endDate,$scope.category,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{data.eventHeadlines.dividends||$scope.loader.setMessage($scope.labels.noDividends),$scope.dividendHistory=data.eventHeadlines.dividends}catch(e){throw"sviStockDividendHistory: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.dividendHistory||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockEsgSummary",["APP_CONFIG","$templateCache","$timeout","labels","widget","loader","stockInfo","piwik","eventDispatcher","$window",function(APP_CONFIG,$templateCache,$timeout,labels,widget,loader,stockInfo,piwik,eventDispatcher,$window){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("stockEsgSummary/stockEsgSummary.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="ESGSummary",this.friendlyName="Stock ESG Summary",$scope.greenLeafs=[],$scope.greyLeafs=[],$scope.companyNameLength={xs:255,sm:255,md:35,lg:35},$scope.maxRating=5;try{svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"sviStockEsgSummary: "+e}labels.setupLabels($scope,["general","stockEsgSummary"]);loader.attach($scope,$element,function(invalidateCache){return $scope.data=null,stockInfo.getStockESGSummary($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{data.esgSummary.esgSummary?($scope.data=data.esgSummary.esgSummary,$scope.chartColors=APP_CONFIG.chartColors.ESGSummaryColors,$scope.greenLeafs.length=10<=(rating=$scope.data.esg)&&rating<=30?1:30<rating&&rating<=50?2:50<rating&&rating<=70?3:70<rating&&rating<=90?4:90<rating?5:0,$scope.greyLeafs.length=$scope.maxRating-$scope.greenLeafs.length):($scope.loader.clearAllMessages(),$scope.loader.setMessage($scope.labels.noDataLoaded))}catch(e){throw"sviStockEsgSummary: "+e}var rating},function(e){e&&($scope.loader.clearAllMessages(),$scope.loader.setMessage($scope.labels.noDataSymbol))}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&(data.symbol=data.symbol.toUpperCase(),$scope.symbol!==data.symbol&&($scope.symbol=data.symbol))},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},angular.element($window).bind("resize",function(e){$(".popover").each(function(){$(this).scope().$hide()})}),$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockIncomeStatement",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","$filter","eventDispatcher","grid","stockInfo",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,$filter,eventDispatcher,grid,stockInfo){return{scope:{symbol:"@",templates:"@"},template:$templateCache.get("stockIncomeStatement/stockIncomeStatement.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="stockIncomeStatement",this.friendlyName="Stock Income Statement",this.eventName="INCOME.STATEMENT",svi.ng.defaultString($scope,$attrs,"templates",'{"industries":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Revenue":{"isHeader":false,"item":"revenue"},"Other Revenue":{"isHeader":false,"item":"otherRevenueTotal"},"Total Revenue":{"isHeader":false,"item":"totalRevenue","isLast":true},"Cost of Revenue, Total":{"isHeader":false,"item":"costOfRevenueTotal"},"Gross Profit":{"isHeader":false,"item":"grossProfit"},"Selling\\/General\\/Admin. Expenses, Total\\t":{"isHeader":false,"item":"sellingGeneralAdministrativeExpensesTotal"},"Research & Development":{"isHeader":false,"item":"researchAndDevelopment"},"Depreciation\\/Amortization":{"isHeader":false,"item":"depreciationAmortization"},"Interest Exp.(Income), Net-Operating, Total":{"isHeader":false,"item":"interestExpenseIncomeNetOperating"},"Unusual Expense (Income)":{"isHeader":false,"item":"unusualExpenseIncome"},"Other Operating Expenses, Total":{"isHeader":false,"item":"otherOperatingExpensesTotal"},"Total Operating Expense":{"isHeader":false,"item":"totalOperatingExpense"},"Operating Income":{"isHeader":false,"item":"operatingIncome","isLast":true},"Interest Income (Expense), Net Non-Operating":{"isHeader":false,"item":"interestIncomeExpenseNetNonOperating"},"Gain (Loss) on Sale of Assets":{"isHeader":false,"item":"gainLossOnSaleOfAssets"},"Other, Net":{"isHeader":false,"item":"otherNet"},"Income Before Tax":{"isHeader":false,"item":"incomeBeforeTax"},"Income Tax - Total":{"isHeader":false,"item":"incomeTaxTotal"},"Income After Tax":{"isHeader":false,"item":"incomeAfterTax"},"Minority Interest":{"isHeader":false,"item":"minorityInterest"},"Equity in Affiliates":{"isHeader":false,"item":"equityInAffiliates"},"U.S. GAAP Adjustment":{"isHeader":false,"item":"usGAAPAdjustment"},"Net Income Before Extra. Items":{"isHeader":false,"item":"netIncomeBeforeExtraItems","isLast":true},"Total Extraordinary Items":{"isHeader":false,"item":"totalExtraordinaryItems"},"Net Income":{"isHeader":false,"item":"netIncome","isLast":true},"Total Adjustments to Net Income":{"isHeader":false,"item":"totalAdjustmentsToNetIncome"},"Income Available to Common Excl. Extra. Items":{"isHeader":false,"item":"incomeAvailableToCommonExclExtraItems"},"Income Available to Common Incl. Extra. Items":{"isHeader":false,"item":"incomeAvailableToCommonInclExtraItems","isLast":true},"Diluted Net Income":{"isHeader":false,"item":"dilutedNetIncome"},"Diluted Weighted Average Shares":{"isHeader":false,"item":"dilutedWeightedAverageShares"},"Diluted EPS Excluding Extrordinary Items":{"isHeader":false,"item":"dilutedEPSExcludingExtrordinaryItems","decimal":2,"isLast":true},"Dividends per Share - Common Stock Primary Issue":{"isHeader":false,"decimal":2,"item":"dividendsPerShareCommonStockPrimaryIssue"},"Diluted Normalized EPS":{"isHeader":false,"decimal":2,"item":"dilutedNormalizedEPS"}},"bank":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Interest Income, Bank":{"isHeader":false,"item":"interestIncomeBank"},"Total Interest Expense":{"isHeader":false,"item":"totalInterestExpense"},"Net Interest Income":{"isHeader":false,"item":"netInterestIncome"},"Loan Loss Provision":{"isHeader":false,"item":"loanLossProvision"},"Net Interest Income after Loan Loss Provision":{"isHeader":false,"item":"netInterestIncomeAfterLoanLossProvision","isLast":true},"Non-Interest Income, Bank":{"isHeader":false,"item":"nonInterestIncomeBank"},"Non-Interest Expense, Bank":{"isHeader":false,"item":"nonInterestExpenseBank"},"Income Before Tax":{"isHeader":false,"item":"incomeBeforeTax"},"Income Tax - Total":{"isHeader":false,"item":"incomeTaxTotal"},"Income After Tax":{"isHeader":false,"item":"incomeAfterTax"},"Minority Interest":{"isHeader":false,"item":"minorityInterest"},"Equity In Affiliates":{"isHeader":false,"item":"equityInAffiliates"},"U.S. GAAP Adjustment":{"isHeader":false,"item":"usGAAPAdjustment"},"Net Income Before Extra. Items":{"isHeader":false,"item":"netIncomeBeforeExtraItems","isLast":true},"Total Extraordinary Items":{"isHeader":false,"item":"totalExtraordinaryItems"},"Net Income":{"isHeader":false,"item":"netIncome","isLast":true},"Total Adjustments to Net Income":{"isHeader":false,"item":"totalAdjustmentsToNetIncome"},"Income Available to Common Excl. Extra. Items":{"isHeader":false,"item":"incomeAvailableToCommonExclExtraItems"},"Income Available to Common Incl. Extra. Items":{"isHeader":false,"item":"incomeAvailableToCommonInclExtraItems","isLast":true},"Diluted Net Income":{"isHeader":false,"item":"dilutedNetIncome"},"Diluted Weighted Average Shares":{"isHeader":false,"item":"dilutedWeightedAverageShares"},"Diluted EPS Excluding Extrordinary Items":{"isHeader":false,"item":"dilutedEPSExcludingExtrordinaryItems","decimal":2,"isLast":true},"Dividends per Share - Common Stock Primary Issue":{"isHeader":false,"decimal":2,"item":"dividendsPerShareCommonStockPrimaryIssue"},"Diluted Normalized EPS":{"isHeader":false,"decimal":2,"item":"dilutedNormalizedEPS"}},"insurance":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Total Premiums Earned":{"isHeader":false,"item":"totalPremiumsEarned"},"Net Investment Income":{"isHeader":false,"item":"netInvestmentIncome"},"Realized Gains (Losses)":{"isHeader":false,"item":"realizedGainsLosses"},"Other Revenue, Total":{"isHeader":false,"item":"otherRevenueTotal"},"Total Revenue":{"isHeader":false,"item":"totalRevenue","isLast":true},"Losses, Benefits, and Adjustments, Total":{"isHeader":false,"item":"lossesBenefitsAndAdjustmentsTotal"},"Amort. Of Policy Acquisition Costs":{"isHeader":false,"item":"amortOfPolicyAcquisitionCosts"},"Selling\\/General\\/Administrative Expenses, Total":{"isHeader":false,"item":"sellingGeneralAdministrativeExpensesTotal"},"Depreciation\\/Amortization":{"isHeader":false,"item":"depreciationAmortization"},"Interest Exp.(Income), Net-Operating, Total":{"isHeader":false,"item":"interestExpenseIncomeNetOperating"},"Unusual Expense (Income)":{"isHeader":false,"item":"unusualExpenseIncome"},"Other Operating Expenses, Total":{"isHeader":false,"item":"otherOperatingExpensesTotal"},"Total Operating Expense":{"isHeader":false,"item":"totalOperatingExpense"},"Operating Income":{"isHeader":false,"item":"operatingIncome","isLast":true},"Interest Income (Expense), Net Non-Operating":{"isHeader":false,"item":"interestIncomeExpenseNetNonOperating"},"Gain (Loss) on Sale of Assets":{"isHeader":false,"item":"gainLossOnSaleOfAssets"},"Other, Net":{"isHeader":false,"item":"otherNet"},"Income Before Tax":{"isHeader":false,"item":"incomeBeforeTax"},"Income Tax - Total":{"isHeader":false,"item":"incomeTaxTotal"},"Income After Tax":{"isHeader":false,"item":"incomeAfterTax"},"Minority Interest":{"isHeader":false,"item":"minorityInterest"},"Equity in Affiliates":{"isHeader":false,"item":"equityInAffiliates"},"U.S. GAAP Adjustment":{"isHeader":false,"item":"usGAAPAdjustment"},"Net Income Before Extra. Items":{"isHeader":false,"item":"netIncomeBeforeExtraItems","isLast":true},"Total Extraordinary Items":{"isHeader":false,"item":"totalExtraordinaryItems"},"Net Income":{"isHeader":false,"item":"netIncome","isLast":true},"Total Adjustments to Net Income":{"isHeader":false,"item":"totalAdjustmentsToNetIncome"},"Income Available to Common Excl. Extra. Items":{"isHeader":false,"item":"incomeAvailableToCommonExclExtraItems"},"Income Available to Common Incl. Extra. Items":{"isHeader":false,"item":"incomeAvailableToCommonInclExtraItems","isLast":true},"Diluted Net Income":{"isHeader":false,"item":"dilutedNetIncome"},"Diluted Weighted Average Shares":{"isHeader":false,"item":"dilutedWeightedAverageShares"},"Diluted EPS Excluding Extrordinary Items":{"isHeader":false,"item":"dilutedEPSExcludingExtrordinaryItems","decimal":2,"isLast":true},"Dividends per Share - Common Stock Primary Issue":{"isHeader":false,"decimal":2,"item":"dividendsPerShareCommonStockPrimaryIssue"},"Diluted Normalized EPS":{"isHeader":false,"decimal":2,"item":"dilutedNormalizedEPS"}},"utility":{"Period End Date":{"isHeader":false,"item":"periodEndDate"},"Reporting Currency":{"isHeader":false,"item":"reportingCurrency"},"Source":{"isHeader":false,"item":"source","isLast":true},"Revenue":{"isHeader":false,"item":"revenue"},"Other Revenue":{"isHeader":false,"item":"otherRevenueTotal"},"Total Revenue":{"isHeader":false,"item":"totalRevenue","isLast":true},"Cost of Revenue, Total":{"isHeader":false,"item":"costOfRevenueTotal"},"Fuel Expense":{"isHeader":false,"item":"fuelExpense"},"Operations & Maintenance":{"isHeader":false,"item":"operationsAndMaintenance","isLast":true},"Selling\\/General\\/Admin. Expenses, Total\\t":{"isHeader":false,"item":"sellingGeneralAdministrativeExpensesTotal"},"Research & Development":{"isHeader":false,"item":"researchAndDevelopment"},"Depreciation\\/Amortization":{"isHeader":false,"item":"depreciationAmortization"},"Interest Exp.(Income), Net-Operating, Total":{"isHeader":false,"item":"interestExpenseIncomeNetOperating"},"Unusual Expense (Income)":{"isHeader":false,"item":"unusualExpenseIncome"},"Other Operating Expenses, Total":{"isHeader":false,"item":"otherOperatingExpensesTotal"},"Total Operating Expense":{"isHeader":false,"item":"totalOperatingExpense"},"Operating Income":{"isHeader":false,"item":"operatingIncome","isLast":true},"Interest Income (Expense), Net Non-Operating":{"isHeader":false,"item":"interestIncomeExpenseNetNonOperating"},"Gain (Loss) on Sale of Assets":{"isHeader":false,"item":"gainLossOnSaleOfAssets"},"Allowance for Funds Used During Const.":{"isHeader":false,"item":"allowanceForFundsUsedDuringConst"},"Other, Net":{"isHeader":false,"item":"otherNet"},"Income Before Tax":{"isHeader":false,"item":"incomeBeforeTax"},"Income Tax - Total":{"isHeader":false,"item":"incomeTaxTotal"},"Income After Tax":{"isHeader":false,"item":"incomeAfterTax"},"Minority Interest":{"isHeader":false,"item":"minorityInterest"},"Equity in Affiliates":{"isHeader":false,"item":"equityInAffiliates"},"U.S. GAAP Adjustment":{"isHeader":false,"item":"usGAAPAdjustment"},"Net Income Before Extra. Items":{"isHeader":false,"item":"netIncomeBeforeExtraItems","isLast":true},"Total Extraordinary Items":{"isHeader":false,"item":"totalExtraordinaryItems"},"Net Income":{"isHeader":false,"item":"netIncome","isLast":true},"Total Adjustments to Net Income":{"isHeader":false,"item":"totalAdjustmentsToNetIncome"},"Income Available to Common Excl. Extra. Items":{"isHeader":false,"item":"incomeAvailableToCommonExclExtraItems"},"Income Available to Common Incl. Extra. Items":{"isHeader":false,"item":"incomeAvailableToCommonInclExtraItems","isLast":true},"Diluted Net Income":{"isHeader":false,"item":"dilutedNetIncome"},"Diluted Weighted Average Shares":{"isHeader":false,"item":"dilutedWeightedAverageShares"},"Diluted EPS Excluding Extrordinary Items":{"isHeader":false,"item":"dilutedEPSExcludingExtrordinaryItems","decimal":2,"isLast":true},"Dividends per Share - Common Stock Primary Issue":{"isHeader":false,"decimal":2,"item":"dividendsPerShareCommonStockPrimaryIssue"},"Diluted Normalized EPS":{"isHeader":false,"item":"dilutedNormalizedEPS","decimal":2}}}');try{svi.ng.parseJSON($scope,$attrs,"templates")}catch(e){throw"sviStockIncomeStatement: "+e}$scope.annualStocksHeader=null,$scope.annualStocks=null,$scope.interimStocksHeader=null,$scope.interimStocks=null,$scope.currentHeader=null,$scope.currentStocks=null,$scope.currentColspan=null,$scope.currentGrid="annual",$scope.dropdownOptions=[{display:"Annual",value:"annual"},{display:"Quarterly",value:"interim"}],$scope.sortable=!1,$scope.responsiveColumnsSettings={enabled:!0,priority:["name","Y1","Y2","Y3","Y4","Y5","Y6","Y7","Y8"]},grid.attachGrid($scope,$element),labels.setupLabels($scope,["general","stockIncomeStatement"]);var processData=function(statements,template,quarterly){var headers=[],result={};for(var incomeKey in $scope.templates[template]){var incomeItem=$scope.templates[template][incomeKey];result[incomeKey]={isHeader:incomeItem.isHeader,data:[],isLast:incomeItem.isLast}}return statements.forEach(function(item){if(quarterly){var date=new Date(item.income.periodEndDate),quarter=Math.ceil((date.getMonth()+1)/3),year=date.getFullYear();headers.push("Q"+quarter+" "+year)}else headers.push($filter("sviDate")(item.income.periodEndDate,"yyyy"));result=function(income,incomeItem,template){for(var stockKey in $scope.templates[template]){var incomeConfigItem=$scope.templates[template][stockKey],value=incomeItem.income[incomeConfigItem.item];stockKey===$scope.labels.periodEndDate&&(value=$filter("sviDate")(value,"MM/dd/yyyy")),(angular.isNumber(value)||!value&&incomeConfigItem.item)&&(value=$filter("sviNumber")(value,incomeConfigItem.decimal?incomeConfigItem.decimal:0,!0)),income[stockKey].data.push(value)}return income}(result,item,template)}),{incomeStatements:result,headers:headers,colspan:headers.length+1}};loader.attach($scope,$element,function(invalidateCache){return $scope.annualStocksHeader=null,$scope.annualStocks=null,$scope.interimStocksHeader=null,$scope.interimStocks=null,$scope.currentHeader=null,$scope.currentStocks=null,stockInfo.getStockFinancials($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{labels.get(["stockIncomeStatement"]).then(function(){var processedAnnual=processData(data.stockFinancials.annual,data.stockFinancials.template),processedInterim=processData(data.stockFinancials.interim,data.stockFinancials.template,!0);$scope.annualStocksHeader=processedAnnual.headers,$scope.annualStocks=processedAnnual.incomeStatements,$scope.annualColspan=processedAnnual.colspan,$scope.interimStocksHeader=processedInterim.headers,$scope.interimStocks=processedInterim.incomeStatements,$scope.interimColspan=processedInterim.colspan,$scope.currentHeader=$scope.annualStocksHeader,$scope.currentStocks=$scope.annualStocks,$scope.currentColspan=$scope.annualColspan})}catch(e){throw"sviStockIncomeStatement: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){eventDispatcher.trigger("EVENTS.INCOME.STATEMENT.FILTER.CHANGED",{display:"Annual",value:"annual"}),angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),eventDispatcher.on("EVENTS.INCOME.STATEMENT.FILTER.CHANGED",function(e,data){$scope.currentGrid!==data.value&&($scope.currentGrid=data.value,"annual"===data.value?($scope.currentHeader=$scope.annualStocksHeader,$scope.currentStocks=$scope.annualStocks,$scope.currentColspan=$scope.annualColspan):"interim"===data.value&&($scope.currentHeader=$scope.interimStocksHeader,$scope.currentStocks=$scope.interimStocks,$scope.currentColspan=$scope.interimColspan))},!0),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.stocks||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockKeyRatios",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","$filter","eventDispatcher","grid","stockInfo",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,$filter,eventDispatcher,grid,stockInfo){return{scope:{symbol:"@"},template:$templateCache.get("stockKeyRatios/stockKeyRatios.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="stockKeyRatios",this.friendlyName="Stock Key Ratios",$scope.ratiosHeader=null,$scope.ratios=null,$scope.colspan=null,$scope.sortable=!1,$scope.responsiveColumnsSettings={enabled:!0,priority:["name","Y1","Y2","Y3","Y4","Y5"]},grid.attachGrid($scope,$element),labels.setupLabels($scope,["stockKeyRatios"]);var processData=function(ratios){var header=[],result={};return result[$scope.labels.marketValueRatios]={isHeader:!0,isBold:!0,isLast:!1,data:[]},result[$scope.labels.dividendYield]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.priceEarnings]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.priceSales]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.priceCashFlow]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.priceBookValue]={isHeader:!1,isBold:!1,isLast:!0,data:[]},result[$scope.labels.profitabilityRatios]={isHeader:!0,isBold:!0,isLast:!1,data:[]},result[$scope.labels.enterpriseValueRevenue]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.enterpriseValueEbitda]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.enterpriseValueEbit]={isHeader:!1,isBold:!1,isLast:!0,data:[]},result[$scope.labels.debtmanagementRatios]={isHeader:!0,isBold:!0,isLast:!1,data:[]},result[$scope.labels.totalDebtEnterpriseValue]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.totalDebtEbitda]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.ebitdaInterestExpense]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.ebitInterestExpense]={isHeader:!1,isBold:!1,isLast:!0,data:[]},result[$scope.labels.profitabilityRatio]={isHeader:!0,isBold:!0,isLast:!1,data:[]},result[$scope.labels.returnOnAssets]={isHeader:!1,isBold:!1,isLast:!1,data:[]},result[$scope.labels.returnOnEquity]={isHeader:!1,isBold:!1,isLast:!1,data:[]},ratios.forEach(function(ratio){header.push(function(periodName){if("LTM"===periodName||"TTM"===periodName)return $scope.labels.actual;if(0<=periodName.indexOf("FY")){var subtracted=periodName.replace("FY","");return(new Date).getFullYear()-subtracted-1}return periodName}(ratio.periodName)),result[$scope.labels.dividendYield].data.push($filter("sviNumber")(ratio.dividendYield,2,!0,!1)),result[$scope.labels.priceEarnings].data.push($filter("sviNumber")(ratio.pe,2,!0,!1)),result[$scope.labels.priceSales].data.push($filter("sviNumber")(ratio.priceSales,2,!0,!1)),result[$scope.labels.priceCashFlow].data.push($filter("sviNumber")(ratio.priceCashFlow,2,!0,!1)),result[$scope.labels.priceBookValue].data.push($filter("sviNumber")(ratio.priceBookValue,2,!0,!1)),result[$scope.labels.enterpriseValueRevenue].data.push($filter("sviNumber")(ratio.enterpriseValueRevenue,2,!0,!1)),result[$scope.labels.enterpriseValueEbitda].data.push($filter("sviNumber")(ratio.enterpriseValueEBITDA,2,!0,!1)),result[$scope.labels.enterpriseValueEbit].data.push($filter("sviNumber")(ratio.enterpriseValueEBIT,2,!0,!1)),result[$scope.labels.totalDebtEnterpriseValue].data.push($filter("sviNumber")(ratio.totalDebtEnterpriseValue,2,!0,!1)),result[$scope.labels.totalDebtEbitda].data.push($filter("sviNumber")(ratio.totalDebtEBITDA,2,!0,!1)),result[$scope.labels.ebitdaInterestExpense].data.push($filter("sviNumber")(ratio.ebitdaInterestExpense,2,!0,!1)),result[$scope.labels.ebitInterestExpense].data.push($filter("sviNumber")(ratio.ebitInterestExpense,2,!0,!1)),result[$scope.labels.returnOnAssets].data.push($filter("sviNumber")(ratio.returnOnAssets,2,!0,!1)),result[$scope.labels.returnOnEquity].data.push($filter("sviNumber")(ratio.returnOnEquity,2,!0,!1))}),{header:header,result:result,colspan:header.length+1}};loader.attach($scope,$element,function(invalidateCache){return $scope.ratiosHeader=null,$scope.ratios=null,$scope.colspan=null,stockInfo.getStockKeyRatios($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{labels.get(["stockKeyRatios"]).then(function(){$scope.ratiosHeader=processData(data.keyRatios.ratios).header,$scope.ratios=processData(data.keyRatios.ratios).result,$scope.colspan=processData(data.keyRatios.ratios).colspan})}catch(e){throw"sviStockKeyRatios: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.ratios||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockOwnershipSummary",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","widget","eventDispatcher","stockInfo",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,widget,eventDispatcher,stockInfo){return{scope:{symbol:"@"},template:$templateCache.get("stockOwnershipSummary/stockOwnershipSummary.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="stockOwnershipSummary",this.friendlyName="Stock Ownership Summary",$scope.summary=null,labels.setupLabels($scope,["stockOwnershipSummary"]);var loadDetailsCallback=function(invalidateCache){return $scope.data=null,stockInfo.getMetrics($scope.symbol,invalidateCache)},onDetailsSuccess=function(data){piwik.trackDataLoad($scope,data),$scope.data=data.performance.details};$scope.detailsLoader=null,$scope.getDetailsLoader=function(loader){$scope.detailsLoader=loader},this.getDetails=function(){piwik.trackEvent("GetQuoteDetailsStockOwnwerSummary","Get Quote Details StockOwnwerSummary",$scope.symbol),$scope.data||($scope.detailsLoader?$scope.detailsLoader.setLoadHandler(loadDetailsCallback).load(!0).then(onDetailsSuccess):$timeout($scope.api.getDetails,200))},$timeout(function(){$scope.data||$scope.api.getDetails()},400),loader.attach($scope,$element,function(invalidateCache){return $scope.summary=null,stockInfo.getStockOwnershipHolders($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.summary=data.stockOwnershipHolders.overview}catch(e){throw"sviStockOwnershipSummary: "+e}}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&($scope.api.load(),$scope.data&&($scope.data=null,$scope.api.getDetails()))}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.summary||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockOwnershipTopHolders",["APP_CONFIG","$templateCache","$timeout","labels","loader","piwik","$filter","eventDispatcher","floatThead","stockInfo",function(APP_CONFIG,$templateCache,$timeout,labels,loader,piwik,$filter,eventDispatcher,floatThead,stockInfo){return{scope:{symbol:"@"},template:$templateCache.get("stockOwnershipTopHolders/stockOwnershipTopHolders.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="StockOwnershipTopHolders",this.friendlyName="Stocks Ownership Top Holders",this.eventName="OWNERSHIP.TOP.HOLDERS",$scope.ownershipTopHolders=null,$scope.sortable=!1,$scope.responsiveColumnsSettings={enabled:!0,priority:["holder","shares","out","dateReported","value","changePct","portfolioPct","turnoverPct"]},$scope.colspan=$scope.responsiveColumnsSettings.priority.length,floatThead.init($scope,$element),labels.setupLabels($scope,["general","stockOwnershipTopHolders"]);loader.attach($scope,$element,function(invalidateCache){return $scope.ownershipTopHolders=null,stockInfo.getStockOwnershipHolders($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{$scope.ownershipTopHolders=data.stockOwnershipHolders}catch(e){throw"sviStockOwnershipTopHolders: "+e}}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.ownershipTopHolders||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockPeers",["APP_CONFIG","$templateCache","$timeout","labels","loader","stockInfo","piwik","eventDispatcher","widget","$filter","$modal",function(APP_CONFIG,$templateCache,$timeout,labels,loader,stockInfo,piwik,eventDispatcher,widget,$filter,$modal){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("stockPeers/stockPeers.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="stockPeers",this.friendlyName="Stock Peers",$scope.competitorsLimit=4,$scope.header=[],$scope.companies=null,$scope.modal=null,$scope.modalScope=null,labels.setupLabels($scope,["general","stockPeers"]);var setPrecision=function(val){return $filter("sviNumber")(val,2,!0,!0)},processData=function(symbol,competitors){var result={},header=[];return result[$scope.labels.lastPrice]=[],result[$scope.labels.weekRange]=[],result[$scope.labels.marketCap]=[],result[$scope.labels.dividend]=[],result[$scope.labels.pe]=[],result[$scope.labels.earningPerShare]=[],header.push(symbol.symbol),result[$scope.labels.lastPrice].push(setPrecision(symbol.quote.lastPrice)),result[$scope.labels.weekRange].push(setPrecision(symbol.quote.extendedQuote.low52Price)+"-"+setPrecision(symbol.quote.extendedQuote.high52Price)),result[$scope.labels.marketCap].push(setPrecision(symbol.marketCap)),result[$scope.labels.dividend].push(setPrecision(symbol.quote.extendedQuote.dividendData.amt)),result[$scope.labels.pe].push(setPrecision(symbol.quote.extendedQuote.priceEarningsRatio)),result[$scope.labels.earningPerShare].push(setPrecision(symbol.quote.extendedQuote.earningsPerShare)),competitors.forEach(function(competitor){header.push(competitor.symbol),result[$scope.labels.lastPrice].push(setPrecision(competitor.quote.lastPrice)),result[$scope.labels.weekRange].push(setPrecision(competitor.quote.extendedQuote.low52Price)+" - "+setPrecision(competitor.quote.extendedQuote.high52Price)),result[$scope.labels.marketCap].push(setPrecision(competitor.marketCap)),result[$scope.labels.dividend].push(setPrecision(competitor.quote.extendedQuote.dividendData.amt)),result[$scope.labels.pe].push(setPrecision(competitor.quote.extendedQuote.priceEarningsRatio)),result[$scope.labels.earningPerShare].push(setPrecision(competitor.quote.extendedQuote.earningsPerShare))}),{header:header,result:result}};$scope.displayModal=function(){$scope.modalScope=$scope.$new(),$scope.modalScope.labels=$scope.labels,$scope.modalScope.modalCompanies=$scope.modalResult,$scope.modalScope.modalHeader=$scope.modalHeader,$scope.modalScope.id="stockPeersModal",$scope.modal=$modal({scope:$scope.modalScope,templateUrl:"stockPeers/stockPeersModal.tpl.html",container:".modals-section",backdrop:!1,animation:"",show:!0})},this.hide=function(){$scope.modal&&$scope.modal.$isShown&&($("body").removeClass("modal-open"),$scope.modal.hide())},loader.attach($scope,$element,function(invalidateCache){return $scope.header=[],$scope.companies=[],$scope.modalHeader=[],$scope.modalResult=[],$scope.asOfDate=null,$scope.peerGroup=null,stockInfo.getStockPeers($scope.symbol,invalidateCache)},function(data){piwik.trackPage($scope,data);try{labels.get(["stockPeers"]).then(function(){var processedData=processData(data.stockPeers.company,$filter("limitTo")(data.stockPeers.competitors,$scope.competitorsLimit)),company=data.stockPeers.company;$scope.asOfDate=company.quote.quoteTime,$scope.peerGroup=company.industry,$scope.header=processedData.header,$scope.companies=processedData.result;var shortData,symbol,competitors,header,result,modalData=(shortData=processData(data.stockPeers.company,$filter("limitTo")(data.stockPeers.competitors,$scope.competitorsLimit)),symbol=data.stockPeers.company,competitors=$filter("limitTo")(data.stockPeers.competitors,$scope.competitorsLimit),header=shortData.header,(result=shortData.result)[$scope.labels.askPrice]=[],result[$scope.labels.bidPrice]=[],result[$scope.labels.change]=[],result[$scope.labels.exch]=[],result[$scope.labels.highWeekRange]=[],result[$scope.labels.openPrice]=[],result[$scope.labels.prevClose]=[],result[$scope.labels.volume]=[],result[$scope.labels.nav]=[],result[$scope.labels.pctChange]=[],result[$scope.labels.askPrice].push(setPrecision(symbol.quote.askPrice)),result[$scope.labels.bidPrice].push(setPrecision(symbol.quote.bidPrice)),result[$scope.labels.change].push(setPrecision(symbol.quote.change)),result[$scope.labels.exch].push(symbol.quote.exch),result[$scope.labels.highWeekRange].push(setPrecision(symbol.quote.extendedQuote.high52Price)+" - "+setPrecision(symbol.quote.extendedQuote.highPrice)),result[$scope.labels.openPrice].push(setPrecision(symbol.quote.extendedQuote.openPrice)),result[$scope.labels.prevClose].push(setPrecision(symbol.quote.extendedQuote.prevClose)),result[$scope.labels.volume].push(setPrecision(symbol.quote.extendedQuote.volume)),result[$scope.labels.nav].push(setPrecision(symbol.quote.nav)),result[$scope.labels.pctChange].push(setPrecision(symbol.quote.pctChange)),competitors.forEach(function(competitor){result[$scope.labels.askPrice].push(setPrecision(competitor.quote.askPrice)),result[$scope.labels.bidPrice].push(setPrecision(competitor.quote.bidPrice)),result[$scope.labels.change].push(setPrecision(competitor.quote.change)),result[$scope.labels.exch].push(competitor.quote.exch),result[$scope.labels.highWeekRange].push(setPrecision(competitor.quote.extendedQuote.high52Price)+" - "+setPrecision(competitor.quote.extendedQuote.highPrice)),result[$scope.labels.openPrice].push(setPrecision(competitor.quote.extendedQuote.openPrice)),result[$scope.labels.prevClose].push(setPrecision(competitor.quote.extendedQuote.prevClose)),result[$scope.labels.volume].push(setPrecision(competitor.quote.extendedQuote.volume)),result[$scope.labels.nav].push(setPrecision(competitor.quote.nav)),result[$scope.labels.pctChange].push(setPrecision(competitor.quote.pctChange))}),{header:header,result:result});$scope.modalHeader=modalData.header,$scope.modalResult=modalData.result})}catch(e){throw"sviStockPeers: "+e}}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.companies||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockSplitsEventsTable",["APP_CONFIG","$templateCache","$timeout","labels","fundInfo","piwik","loader","eventDispatcher","widget","grid","dateUtils",function(APP_CONFIG,$templateCache,$timeout,labels,fundInfo,piwik,loader,eventDispatcher,widget,grid,dateUtils){return{replace:!1,scope:{dateRange:"@",eventId:"@",pageEventId:"@"},template:$templateCache.get("stockSplitsEventsTable/stockSplitsEventsTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="StockSplitsEventsTable",this.friendlyName="Stock Splits Events Table",this.eventName="STOCK_SPLITS",$scope.companies=null,$scope.sortable=!0,$scope.category="StockSplits",$scope.totalRecords=null,$scope.currentPage=1,$scope.pageSize=20,svi.ng.defaultString($scope,$attrs,"eventId","STOCK_SPLITS_EVENTS"),svi.ng.defaultString($scope,$attrs,"pageEventId","STOCKS_PAGING");try{svi.ng.parseJSON($scope,$attrs,"dateRange")}catch(e){throw"Unable to parse JSON: "+e}labels.setupLabels($scope,["general","stockSplitsEventsTable"]),$scope.responsiveColumns=!0,$scope.columnPriority=["paymentDate","symbol","ratio","company","announcementDate","exDate"],grid.attachSorting($scope,$element,$attrs,"company","asc"),grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){return $scope.companies=[],fundInfo.getEventsTable($scope.category,dateUtils.normalizeDate($scope.dateRange.start,"yyyy-MM-dd"),dateUtils.normalizeDate($scope.dateRange.end,"yyyy-MM-dd"),$scope.sortDir,$scope.sortField,$scope.pageSize,$scope.currentPage,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{data.eventsTable.stockSplits&&data.eventsTable.stockSplits.length?($scope.companies=data.eventsTable.stockSplits,$scope.totalRecords=data.eventsTable.totalRecords,$scope.totalPages=Math.ceil($scope.totalRecords/$scope.pageSize)):$scope.loader.setMessage($scope.labels.stockSplitsNoData)}catch(e){throw"sviStockSplitsEventsTable: "+e}}),widget.attach($scope,$element),eventDispatcher.on($scope.eventId+".DATE_RANGE.FILTER.CHANGED",function(e,data){angular.isDefined(data.from)&&angular.isDefined(data.to)&&(eventDispatcher.trigger($scope.pageEventId+".PAGE.CHANGED",1),$scope.dateRange={start:dateUtils.normalizeDate(data.from,"yyyy-MM-dd"),end:dateUtils.normalizeDate(data.to,"yyyy-MM-dd")})},null,$element),eventDispatcher.on($scope.pageEventId+".PAGE.CHANGED",function(e,data){data&&$scope.currentPage!==data&&($scope.currentPage=data)},null,$element),$scope.$watch("currentPage",function(newVal,oldVal){newVal&&newVal!==oldVal&&""!==newVal&&$scope.api.load()}),$scope.$watch("dateRange",function(newVal,oldVal){null!==newVal&&""!==newVal&&newVal!==oldVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){$scope.initComplete=!0,$scope.companies||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviStockSymbolName",["APP_CONFIG","$templateCache","$timeout","labels","loader","stockInfo","piwik","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,stockInfo,piwik,eventDispatcher){return{replace:!1,scope:{symbol:"@"},template:$templateCache.get("stockSymbolName/stockSymbolName.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="CompanySymbolName",this.friendlyName="Company Symbol & Name";try{svi.ng.defaultString($scope,$attrs,"symbol","")}catch(e){throw"sviStockSymbolName: "+e}$scope.data=null,labels.setupLabels($scope,["general","fundSymbolName"]);loader.attach($scope,$element,function(invalidateCache){return $scope.data=null,stockInfo.getInfo($scope.symbol,invalidateCache)},function(data){piwik.trackDataLoad($scope,data),$scope.data=data.stockInfo.info}),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!=data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!=newVal&&$scope.api.load()}),$timeout(function(){$scope.data||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviTopFundHoldings",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","fundInfo","piwik","grid","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,fundInfo,piwik,grid,eventDispatcher){return{replace:!1,scope:{symbol:"@",moreUrl:"@",symbolFormat:"@"},template:$templateCache.get("topFundHoldings/topFundHoldings.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="topFundHoldings",this.friendlyName="Top Fund Holdings",this.eventName="TOP_FUND_HOLDINGS";try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"moreUrl",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto")}catch(e){throw"sviTopFundHoldings: "+e}try{svi.ng.parseJSON($scope,$attrs,"moreUrl")}catch(e){}$scope.moreUrl||svi.ng.defaultString($scope,$attrs,"moreUrl",""),$scope.holdings=null,$scope.sortable=!1,$scope.max=100,$scope.id=php.uniqid(this.name),$scope.comm={},labels.setupLabels($scope,["general","topFundHoldings"]),grid.attachSorting($scope,$element,$attrs,"value","desc"),grid.attachGrid($scope,$element);var processHoldings=function(holdings){return holdings.forEach(function(el){el.barWidth=100*el.value/$scope.max+"%",el.symbol||(el.symbol=APP_CONFIG.naValue)}),holdings},getMaxValue=function(values){return Math.max.apply(null,values.map(function(item){return item.value}))};loader.attach($scope,$element,function(invalidateCache){$scope.holdings=null;var params={symbolFormat:$scope.symbolFormat};return fundInfo.getTopHoldings($scope.symbol,params,invalidateCache)},function(data){piwik.trackDataLoad($scope,data),$scope.max=getMaxValue(data.holdings.topHoldings),$scope.holdings=processHoldings(data.holdings.topHoldings)}),widget.attach($scope,$element),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){$scope.data=null,angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol)},null,$element),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.load()}),$timeout(function(){$scope.initComplete=!0,$scope.holdings||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.research").directive("sviTopMoversContainer",["APP_CONFIG","$templateCache","$timeout","labels","sviUrl","eventDispatcher",function(APP_CONFIG,$templateCache,$timeout,labels,sviUrl,eventDispatcher){return{replace:!1,scope:{eventId:"@",parentTabId:"@"},template:$templateCache.get("topMoversContainer/topMoversContainer.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="topMoversContainer",this.friendlyName="Top Movers Container",$scope.exchange="US",$scope.limit=75,$scope.findTabToggleCount=0,$scope.findTabToggleMaxCount=10,$scope.isRedirected=!1,$scope.exchangeDropdown=[{display:"All",value:"US"},{display:"AMEX",value:"AMEX"},{display:"NYSE",value:"NYSE"},{display:"NASDAQ",value:"NASDAQ"}];var getTabCtrl=svi.ng.getControllerFactory($element,$scope,"svi-tabs");labels.setupLabels($scope,["topMoversContainer"]).then(function(){var tabs=getTabCtrl();tabs&&$timeout(tabs.updateTabs)}),sviUrl.getSearchParamsFromQuery().activeTab&&($scope.isRedirected=!0),this.switchToTab=function(targetId){if($scope.findTabToggleCount++,0<$element.find(".tab-controls a.nav-link").length){var targetIndex=!1,tabEl=$element.find('.tab-controls a.nav-link[data-tab-id="'+targetId+'"]');tabEl&&(targetIndex=parseInt(tabEl.attr("data-tab-index")));var tabs=getTabCtrl();tabs&&!1!==targetIndex&&!isNaN(targetIndex)&&tabs.selectTab(targetIndex)}else $scope.findTabToggleCount<=$scope.findTabToggleMaxCount&&$timeout(function(){$scope.api.switchToTab(targetId)},APP_CONFIG.autoLoadDelay)},$scope.eventId&&eventDispatcher.on($scope.eventId+".SELECT.TAB",function(e,data){angular.isString(data)&&""!==data&&($scope.parentTabId&&$document.find('.nav-tabs a[href="#'+$scope.parentTabId+'"]').tab("show"),$scope.api.switchToTab(data))})}],link:function($scope,$element,$attrs){if($scope.isRedirected){var activeTab=sviUrl.getSearchParamsFromQuery().activeTab;$timeout(function(){$scope.api.switchToTab(activeTab),$scope.isRedirected=!1},APP_CONFIG.autoLoadDelay)}}}}]),angular.module("svi.research").directive("sviTopMoversTable",["APP_CONFIG","$templateCache","$timeout","labels","loader","widget","exchange","piwik","eventDispatcher","grid",function(APP_CONFIG,$templateCache,$timeout,labels,loader,widget,exchange,piwik,eventDispatcher,grid){return{replace:!1,scope:{type:"@",exchange:"@",limit:"@",sortField:"@",sortDir:"@"},template:$templateCache.get("topMoversTable/topMoversTable.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="topMoversTable",this.friendlyName="Top Movers Table",this.eventName="TOP_MOVERS";try{svi.ng.defaultValidString($scope,$attrs,"type",["Gainers","Losers","Active"],"Active"),svi.ng.defaultValidString($scope,$attrs,"exchange",["US","AMEX","NYSE","NASDAQ"],"US"),svi.ng.defaultInt($scope,$attrs,"limit",75,25,0),svi.ng.defaultString($scope,$attrs,"sortField","quote.extendedQuote.volume"),svi.ng.defaultString($scope,$attrs,"sortDir","desc")}catch(e){throw"sviMarketMovers: "+e}$scope.quotes=null,$scope.pageNum=1,$scope.sortable=!0,$scope.responsiveColumnsSettings={enabled:!0,priority:["symbol","lastPrice","change","pctChange","volume","avgVol","eps","peRatio","weekRange","yield"],breakpoints:{xs:4,sm:7,md:10}},labels.setupLabels($scope,["general","topMoversTable"]),grid.attachSorting($scope,$element,$attrs,$scope.initSortField,$scope.initSortDir),grid.attachGrid($scope,$element);loader.attach($scope,$element,function(invalidateCache){return $scope.quotes=[],exchange.getMovers($scope.exchange,$scope.type,$scope.limit,$scope.pageNum,$scope.sortField,$scope.sortDir,invalidateCache)},function(data){piwik.trackDataLoad($scope,data);try{0<data.movers.quotes.length?($scope.asOfDate=(quotes=data.movers.quotes,(quote=quotes.find(function(item){return void 0!==item.quote.quoteTime&&null!==item.quote.quoteTime}))?quote.quote.quoteTime:""),$scope.quotes=exchange.filterMoversByTestData(data.movers.quotes)):"Active"===$scope.type?$scope.loader.setMessage($scope.labels.most+" "+$scope.type+$scope.labels.noData):$scope.loader.setMessage($scope.labels.top+" % "+$scope.type+" "+$scope.labels.noData)}catch(e){throw"sviTopMoversTable: "+e}var quotes,quote}),widget.attach($scope,$element),eventDispatcher.on("MOVERS.DROPDOWN.FILTER.CHANGED",function(e,data){data&&null!==data.value&&($scope.exchange=data.value)}),$scope.$watch("exchange",function(newVal,oldVal){newVal&&newVal!==oldVal&&""!==newVal&&$scope.api.load()}),$scope.api.isReadyToLoad=function(){return!(null===$scope.type||!1===$scope.type||""===$scope.type)},$timeout(function(){$scope.initComplete=!0,$scope.quotes||$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("svi.symbol").directive("sviAdvancedSymbolChart",["APP_CONFIG","$templateCache","eventDispatcher","$timeout","labels","symbol","fundInfo","highcharts","$filter","piwik","widget","$modal","config","$compile","stockInfo",function(APP_CONFIG,$templateCache,eventDispatcher,$timeout,labels,symbol,fundInfo,highcharts,$filter,piwik,widget,$modal,config,$compile,stockInfo){var rangeButtons=[{type:"day",count:1,text:"1D",filter:"OneDay",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["minute",[1,2,5,15,30]],["hour",[1,2,6,12]],["day",[1,2,3,4]]]}},{type:"week",count:1,text:"1W",filter:"OneWeek",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["minute",[1,2,5,15,30]],["hour",[1,2,6,12]],["day",[1,2,3,4]],["week",[1,2]]]}},{type:"month",count:1,text:"1M",filter:"OneMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:3,text:"3M",filter:"ThreeMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:6,text:"6M",filter:"SixMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:12,text:"1Y",filter:"OneYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:36,text:"3Y",filter:"ThreeYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:60,text:"5Y",filter:"FiveYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:120,text:"10Y",filter:"TenYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}}],mutualFundRangeButtons=[{type:"month",count:1,text:"1M",filter:"OneMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:3,text:"3M",filter:"ThreeMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:6,text:"6M",filter:"SixMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"ytd",text:"YTD",filter:"YTD",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:12,text:"1Y",filter:"OneYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:36,text:"3Y",filter:"ThreeYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:60,text:"5Y",filter:"FiveYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:120,text:"10Y",filter:"TenYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}}];return{replace:!1,scope:{symbol:"@",timespan:"@",chartColorBegin:"@",fundGrowthColorBegin:"@",useGradient:"@",yAxisFontColor:"@",lineColor:"@",lineWidth:"@",showTitle:"@",showSymbol:"@",showRangeButtons:"@",rangeButtonWidth:"@",showVolume:"@",showPriceInfo:"@",ignoreEvents:"@",showDisclaimer:"@",reloadEvery:"@",template:"@",responsive:"@",investmentType:"@",marketHoursOnly:"@",parentTabSelector:"@",chartTabSelector:"@",lastVisiblePriceLabelColor:"@",investmentSubType:"@",symbolFormat:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.required($attrs,"symbol"),svi.ng.defaultFalse($scope,$attrs,"showDisclaimer"),svi.ng.defaultValidString($scope,$attrs,"timespan",["Today","WTD","MTD","YTD","OneDay","OneWeek","OneMonth","ThreeMonth","SixMonth","OneYear","ThreeYear","FiveYear","TenYear"],"ThreeMonth"),svi.ng.defaultInt($scope,$attrs,"rangeButtonWidth",null),svi.ng.defaultString($scope,$attrs,"chartColorBegin","#FFFFFF"),svi.ng.defaultString($scope,$attrs,"fundGrowthColorBegin","#CCCCCC"),svi.ng.defaultString($scope,$attrs,"lineColor","#666666"),svi.ng.defaultInt($scope,$attrs,"lineWidth",1),svi.ng.defaultFalse($scope,$attrs,"useGradient"),svi.ng.defaultString($scope,$attrs,"yAxisFontColor","#000000"),svi.ng.defaultString($scope,$attrs,"chartColorEnd",!1===$scope.useGradient?$scope.chartColorBegin:"#FFFFFF"),svi.ng.defaultTrue($scope,$attrs,"showTitle"),svi.ng.defaultFalse($scope,$attrs,"showSymbol"),svi.ng.defaultTrue($scope,$attrs,"showRangeButtons"),svi.ng.defaultFalse($scope,$attrs,"showVolume"),svi.ng.defaultFalse($scope,$attrs,"ignoreEvents"),svi.ng.defaultInt($scope,$attrs,"reloadEvery",0,null,120),svi.ng.defaultValidString($scope,$attrs,"template",["Widget","Chart"],"Chart"),svi.ng.defaultFalse($scope,$attrs,"responsive"),svi.ng.defaultValidString($scope,$attrs,"investmentType",["Stock","MutualFund","Equity"],"Stock"),svi.ng.defaultFalse($scope,$attrs,"marketHoursOnly"),svi.ng.defaultString($scope,$attrs,"parentTabSelector",'.svi-sub-page-nav a[data-toggle="tab"]'),svi.ng.defaultString($scope,$attrs,"chartTabSelector",'.advanced-chart-wrapper ul.nav.nav-pills a[data-toggle="tab"]'),svi.ng.defaultString($scope,$attrs,"lastVisiblePriceLabelColor","#ffffff"),svi.ng.defaultFalse($scope,$attrs,"showPriceInfo"),svi.ng.defaultString($scope,$attrs,"investmentSubType",""),svi.ng.defaultString($scope,$attrs,"symbolFormat","auto"),$scope.reloadTimeout=null,$scope.symbols=[],$scope.newChart=!0,$scope.colors=APP_CONFIG.chartColors.graphicColors,$scope.redGreenColors=APP_CONFIG.chartColors.redGreenColors,$scope.indexes={DJIA:!1,NASDAQ:!1,SPX:!1},$scope.yAxisCounter=0,$scope.addedIndicators=[],$scope.indicatorsList=[],$scope.drawAnnotations=[],$scope.indicatorLookup="",$scope.indicatorLookupObject={},$scope.indicatorLookupOption={},$scope.indicatorsOrder="name",$scope.indicatorsOrderReverse=!1,$scope.volumeSeriesID="volume-series",$scope.fundGrowthSeriesID="fund-growth-series",$scope.mainSeriesID="main-series",$scope.divsEvtsSeriesID="divs-evts-series",$scope.chartType="area",$scope.selectedChartType={},$scope.chartTypes="[]",$scope.symbolSeriesData=[],$scope.fundGrowthData=[],$scope.loaded=!0,$scope.currentPriceIndicatorEnabled="MutualFund"!==$scope.investmentType,$scope.currentPriceIndicatorCheckboxDisabled="MutualFund"===$scope.investmentType,$scope.volumeChartCheckboxDisabled=!$scope.showVolume,$scope.fundGrowthEnabled="MutualFund"===$scope.investmentType,$scope.id=php.uniqid("advancedSymbolChart"),$scope.toolsContainerClass="tools-container-"+$scope.id,$scope.includeBenchmarks=!1,$scope.benchmarks=[],$scope.shouldLoadEvents=!1,$scope.events={dividends:!1,splits:!1,earnings:!1},$scope.dividends=[],$scope.splits=[],$scope.earnings=[],$scope.activeTab="comparison",$scope.shouldClearInput=!1,$scope.mutualFundSecurityType="MutualFund",$scope.inputSymbolComm={},labels.setupLabels($scope,["general","priceHistoryChart"]).then(function(){$scope.inputSymbolComm.investmentType=$scope.investmentType}),$scope.loadIndicatorsConfig=function(){config.getConfig(["symbolChart"]).then(function(response){200===response.status&&response.data.success&&angular.isObject(response.data.config)&&($scope.config=response.data.config,$scope.config.djiaEnabled=APP_CONFIG.djiaEnabled,$scope.indicatorsList=$scope.config.indicators,$scope.drawAnnotations=$scope.config.drawAnnotations,$scope.chartSettings=$scope.config.chartSettings,$scope.selectedChartType=getSelectedChartType($scope.chartType),$scope.indicatorLookupOption=$scope.config.indicatorTypes[0],isMutualFundOrEquity()&&$scope.fundGrowthEnabled&&($scope.callback=loadFundGrowthCallback),$scope.load())})},$scope.title=$attrs.title||labels.priceHistoryChartTitle,$scope.setLoader=function(loader){$scope.loader=loader};var isMutualFund=function(){return"MutualFund"===$scope.investmentType},isMutualFundOrEquity=function(){return"MutualFund"===$scope.investmentType||"ETF"===$scope.investmentSubType},shouldShowActiveMarketHours=function(val){return-1!==["Today","OneDay","OneWeek"].indexOf(val)&&"ETF"!==$scope.investmentSubType};isMutualFund()||($scope.showActiveMarketHoursToggler=shouldShowActiveMarketHours($scope.timespan),$scope.showAfterMarketActivity=$scope.showActiveMarketHoursToggler),$scope.scheduleReload=function(delay){null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout),$scope.reloadTimeout=$timeout(function(){$scope.load(!0)},delay)},$element.on("$destroy",function(){$scope.reloadEvery=!1,null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout)}),$scope.load=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $scope.scheduleReload(APP_CONFIG.autoLoadDelay);""!==$scope.symbol&&(null!==$scope.reloadTimeout&&($timeout.cancel($scope.reloadTimeout),$scope.reloadTimeout=null),$scope.loader.setLoadHandler($scope.callback).load(invalidateCache).then(onSuccess,onError))};var loadMainSymbolCallback=function(invalidateCache){return symbol.getPriceHistory($scope.symbol,$scope.timespan,null,$scope.marketHoursOnly,invalidateCache)};$scope.callback=loadMainSymbolCallback;var loadSymbolToCompare=function(invalidateCache){return symbol.getPriceHistory($scope.symbolToLoad.symbol,$scope.timespan,null,$scope.marketHoursOnly,invalidateCache)},loadFundGrowthCallback=function(invalidateCache){var params={includeBenchmarks:"Y",timespan:$scope.timespan,symbolFormat:$scope.symbolFormat};return fundInfo.getFundGrowth($scope.symbol,params,invalidateCache)},loadFundGrowthToCompare=function(invalidateCache){var params={includeBenchmarks:"Y",timespan:$scope.timespan,symbolFormat:$scope.symbolFormat};return fundInfo.getFundGrowth($scope.symbolToLoad.symbol,params,invalidateCache)},loadDividendsAndEvents=function(invalidateCache){return stockInfo.getEventHeadlines($scope.symbol,$scope.startDate,$scope.endDate,$scope.category,invalidateCache)},onSuccess=function(response){if(!response.success)return piwik.trackPage("advancedSymbolChart/error","Error: Price History Chart",1e3*response._loaderMetadata.elapsedTime,[{name:"symbol",value:$scope.symbol}]),void(response.invalidSymbol||$scope.loader.setError($scope.labels.dataRenderError));if("eventHeadlines"===response.action){var arr,eventsName,headlines=response.eventHeadlines;return"Dividends"===$scope.category?(eventsName="dividends",arr=$scope.dividends=convertToEventsData(headlines.dividends,"D")):"StockSplits"===$scope.category?(eventsName="splits",arr=$scope.splits=convertToEventsData(headlines.stockSplits,"S")):"Earnings"===$scope.category&&(eventsName="earnings",arr=$scope.earnings=convertToEventsData(headlines.earnings,"E")),arr&&arr.length?void loadChart(eventsName,arr):($scope.shouldLoadEvents=!1,$scope.events[eventsName]=!1,piwik.trackPage("advancedSymbolChart/noData","Advanced Chart - No Data",1e3*response._loaderMetadata.elapsedTime,[{name:"symbol",value:$scope.symbol}]),$scope.loader.setMessage($scope.labels.chartNoData),void($scope.loaded=!0))}if(!($scope.fundGrowthEnabled||response.symbolHistory&&angular.isArray(response.symbolHistory.quotes)&&response.symbolHistory.quotes.length))return piwik.trackPage("advancedSymbolChart/noData","Advanced Chart - No Data",1e3*response._loaderMetadata.elapsedTime,[{name:"symbol",value:$scope.symbol}]),$scope.loader.setMessage($scope.labels.chartNoData),$scope.loaded=!0,void setActiveRangeSelectorOnError();if($scope.fundGrowthEnabled&&(!response.performance||!angular.isArray(response.performance.performance)||response.performance.performance.length<=1))return piwik.trackPage("advancedSymbolChart","Advanced Chart",1e3*response._loaderMetadata.elapsedTime,[{name:"symbol",value:$scope.symbol}]),$scope.loader.setMessage($scope.labels.chartNoData),void($scope.loaded=!0);$scope.symbol===response.symbol&&isMutualFund()&&$scope.fundGrowthEnabled&&($scope.benchmarks=response.performance&&response.performance.benchmarks||[]);var data=isMutualFundOrEquity()&&$scope.fundGrowthEnabled?response.performance.performance:response.symbolHistory.quotes;loadChart(response.currentSymbol||response.symbol,data)},setActiveRangeSelectorOnError=function(){$scope.chart.series.length&&($scope.chart.series=[]),$scope.chart.rangeSelector.buttons.map(function(btn){btn.setState(0)}),$scope.chart.rangeSelector.buttons[$scope.api.getSelectedTimespanIndex()].setState(2)},loadChart=function(currentSymbol,quotes){if($scope.shouldLoadEvents)return $scope.shouldLoadEvents=!1,$scope.chart.addSeries({id:currentSymbol,name:currentSymbol,data:quotes,zIndex:3,type:"flags",lineWidth:$scope.lineWidth,showInLegend:!1,onSeries:$scope.mainSeriesID,shape:"circlepin",tooltip:{pointFormatter:getPointFormatter}}),void($scope.loaded=!0);$scope.shouldClearInput&&($scope.shouldClearInput=!1,eventDispatcher.trigger("SYMBOL.CONTEXT.CLEAR"));var seriesData=isMutualFundOrEquity()&&$scope.fundGrowthEnabled?[processFundGrowthData(quotes)]:processData(quotes),len=seriesData[0].length;if($scope.symbol===currentSymbol||$scope.newChart)if($scope.chart){$scope.startDate=getDateOfSeries(seriesData,"start"),$scope.endDate=getDateOfSeries(seriesData,"end");var series=$scope.chart.get($scope.mainSeriesID);series.setData(seriesData[0],!1),series.update({name:$scope.symbol,lineColor:$scope.fundGrowthEnabled?$scope.fundGrowthColorBegin:$scope.lineColor,color:$scope.fundGrowthEnabled?$scope.fundGrowthColorBegin:$scope.chartColorBegin,fillColor:{linearGradient:[0,0,0,500],stops:[[0,$scope.fundGrowthEnabled?$scope.fundGrowthColorBegin:$scope.chartColorBegin],[1,new Highcharts.Color($scope.chartColorEnd).setOpacity(0).get("rgba")]]}}),$scope.showVolume&&!$scope.fundGrowthEnabled&&$scope.chart.get($scope.volumeSeriesID).setData(seriesData[1]),$scope.chart.zoomOut(),$scope.chart.rangeSelector.buttons[$scope.api.getSelectedTimespanIndex()].setState(2),0<$scope.symbols.length&&reloadAllSeries(),$scope.fundGrowthEnabled||(0<$scope.addedIndicators.length&&reloadAllIndicators(),$scope.symbolSeriesData=quotes)}else{var options=$.extend(!0,{},$scope.getOptions());options.series[0].data=seriesData[0],$scope.startDate=getDateOfSeries(seriesData,"start"),$scope.endDate=getDateOfSeries(seriesData,"end"),$scope.fundGrowthEnabled?$scope.fundGrowthData=seriesData[0].slice():(options.series[1].data=seriesData[1],0<len&&(options.yAxis.min=calculateMinPrice(seriesData,len)),$scope.symbolSeriesData=quotes.slice()),$scope.chart=highcharts.getStockChart(options),!$scope.reloadEvery||"Today"!==$scope.timespan&&"OneDay"!==$scope.timespan||$scope.scheduleReload(1e3*$scope.reloadEvery)}else{symbolExists($scope.symbolToLoad.symbol)||$scope.symbols.push($scope.symbolToLoad),$scope.chart.zoomOut(),$scope.chart.yAxis[0].update({labels:{formatter:function(){return this.value+"%"}}},!1);var name=getSymbolName(currentSymbol),color=getSymbolColor(currentSymbol);$scope.chart.addSeries({id:currentSymbol,name:name,data:seriesData[0],zIndex:2,type:"line",color:color,lineWidth:$scope.lineWidth,showInLegend:!1},!1),$scope.chart.yAxis[0].setCompare("percent"),$scope.chart.rangeSelector.buttons[$scope.api.getSelectedTimespanIndex()].setState(2)}$scope.loaded=!0,$scope.newChart=!1},convertToEventsData=function(events,type){if(!events||events&&!events.length)return[];var transformedEvents=events.filter(function(event){return event.paymentDate||event.releaseDate}).map(function(event){return convertFromEventToObject(event,type)});return"E"===type?transformedEvents.filter(function(event){return"call"!==event.text.slice(-4).toLowerCase()}):transformedEvents},convertFromEventToObject=function(event,type){switch(type){case"D":return{x:new Date(event.paymentDate).getTime(),text:event.name,exDate:event.exDate,paymentDate:event.paymentDate,amount:event.dividendAmount,title:type};case"S":return{x:new Date(event.paymentDate).getTime(),text:event.name,exDate:event.exDate,paymentDate:event.paymentDate,announcementDate:event.announcementDate,ratio:event.ratio,title:type};case"E":return{x:new Date(event.releaseDate).getTime(),text:event.name,releaseDate:event.releaseDate,title:type};default:return{x:new Date(event.paymentDate||event.releaseDate).getTime(),text:event.name,title:type}}},getDateOfSeries=function(series,period){return"end"===period?$filter("date")(new Date(series[0][series[0].length-1][0]),"yyyy-MM-dd"):$filter("date")(new Date(series[0][1][0]),"yyyy-MM-dd")},calculateMinPrice=function(seriesData,len){for(var minPrice=seriesData[0][0][1],i=1;i<len;i++)seriesData[0][i][1]<minPrice&&(minPrice=seriesData[0][i][1]);return 0<Math.floor(minPrice)?minPrice-10:Math.floor(minPrice)},reloadAllSeries=function(){$scope.api.clearBenchmarks(!0),$scope.symbols.forEach(function(el){addSymbolToChart(el,!0)})},reloadAllIndicators=function(){var indicators=$scope.addedIndicators;$scope.api.clearIndicators(),$timeout(function(){indicators.forEach(function(el){addIndicatorToChart(el)})},1e3)},onError=function(response){$scope.chart&&($scope.newChart=!0),piwik.trackPage("priceHistoryChart/error","Error: Price History Chart",!1,[{name:"symbol",value:$scope.symbol}]),response.invalidSymbol||$scope.loader.setError($scope.labels.dataRenderError),$scope.loaded=!0},processFundGrowthData=function(data){return data.map(function(item){return[new Date(item.date).getTime(),item.value]})},processData=function(data){var prices=[],volume=[];return data.forEach(function(quote){var time=getQuoteDate(quote.quoteTime).getTime();if("area"===$scope.chartType||"line"===$scope.chartType)prices.push([time,quote.lastPrice||null]);else try{var q=quote.extendedQuote;prices.push([time,q.openPrice,q.highPrice,q.lowPrice,quote.lastPrice])}catch(e){prices.push([time,null,null,null,null])}volume.push([time,quote.extendedQuote&&quote.extendedQuote.volume||null])}),[prices,volume]},getQuoteDate=function(date){var timestamp=date.toString().replace(/\-[0-9]{4,4}/g,"Z");return new Date(timestamp)};$scope.$watch("timespan",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&(removeEventsFromChart(),isMutualFund()||($scope.showActiveMarketHoursToggler=shouldShowActiveMarketHours(newVal),$scope.marketHoursOnly=$scope.showActiveMarketHoursToggler&&!$scope.showAfterMarketActivity),reloadOnTimespanChanged())}),$scope.$watch("showAfterMarketActivity",function(newVal,oldVal){null===newVal||""===newVal||oldVal===newVal||isMutualFund()||($scope.marketHoursOnly=!newVal,reloadOnTimespanChanged())}),$scope.$watch("events.dividends",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.toggleEvents("dividends",newVal)}),$scope.$watch("events.splits",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.toggleEvents("splits",newVal)}),$scope.$watch("events.earnings",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.api.toggleEvents("earnings",newVal)}),$scope.$watch("includeBenchmarks",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&isMutualFund()&&(newVal?($scope.chart.update({legend:{enabled:!0}}),addBenchmarksToChart()):($scope.chart.update({legend:{enabled:!1}}),removeBenchmarksFromChart()))}),$scope.$watch("benchmarks",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&isMutualFund()&&updateBenchmarks()}),$scope.$watch("showVolume",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&toggleVolume()}),$scope.$watch("currentPriceIndicatorEnabled",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&toggleCurrentPriceIndicator()}),$scope.$watch("fundGrowthEnabled",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&($scope.showVolume?($scope.showVolume=!1,$scope.volumeChartCheckboxDisabled=!0):$scope.volumeChartCheckboxDisabled=!1,$scope.currentPriceIndicatorEnabled&&($scope.currentPriceIndicatorEnabled=!1),toggleFundGrowth())}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&($scope.api.clearChart(),isMutualFundOrEquity()&&$scope.fundGrowthEnabled?$scope.callback=loadFundGrowthCallback:$scope.callback=loadMainSymbolCallback,$scope.newChart=!0,$scope.load(),$scope.showPriceInfo&&($scope.priceInfoText=null,$scope.api.getOneDayPriceInfo()))}),$scope.$watch("indicatorLookup",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&($scope.indicatorLookupObject.name=newVal,$scope.indicatorLookupObject.fullName=newVal)}),$scope.$watch("symbols.length",function(newVal){4<newVal?eventDispatcher.trigger("SYMBOL.CONTEXT.DISABLE",{disabled:!0}):eventDispatcher.trigger("SYMBOL.CONTEXT.DISABLE",{disabled:!1})});var removeEventsFromChart=function(){Object.keys($scope.events).forEach(function(eventKey){$scope.events[eventKey]=!1})},toggleCurrentPriceIndicator=function(){$scope.chart.get($scope.mainSeriesID).update({lastVisiblePrice:{enabled:!$scope.fundGrowthEnabled&&$scope.currentPriceIndicatorEnabled}})},toggleFundGrowth=function(){$scope.api.clearChart(),$scope.fundGrowthEnabled?($scope.currentPriceIndicatorCheckboxDisabled=!0,$scope.volumeChartCheckboxDisabled=!0,$scope.loaded?($scope.callback=loadFundGrowthCallback,$scope.newChart=!0,$scope.loaded=!1,$scope.load()):$timeout(toggleFundGrowth,APP_CONFIG.autoLoadDelay)):$scope.loaded?($scope.callback=loadMainSymbolCallback,$scope.newChart=!0,$scope.loaded=!1,$scope.load(),$scope.currentPriceIndicatorCheckboxDisabled=!1):$timeout(toggleFundGrowth,APP_CONFIG.autoLoadDelay)},reloadOnTimespanChanged=function(){$scope.loaded?($scope.callback=$scope.fundGrowthEnabled?loadFundGrowthCallback:loadMainSymbolCallback,$scope.newChart=!0,$scope.loaded=!1,$scope.load()):$timeout(reloadOnTimespanChanged,APP_CONFIG.autoLoadDelay)};this.setTimespan=function(timespan){$scope.$applyAsync(function(){$scope.timespan=timespan})},this.getSelectedTimespanIndex=function(){for(var buttons=isMutualFund()?mutualFundRangeButtons:rangeButtons,i=0;i<buttons.length;i++)if(buttons[i].filter===$scope.timespan)return i;return 0},this.setSymbol=function(symbol){$scope.$applyAsync(function(){$scope.symbol=symbol})},this.changeChartType=function(type,redraw){redraw=!angular.isDefined(redraw)||redraw,$scope.chartType=type,$scope.selectedChartType=getSelectedChartType(type),$scope.chart.get($scope.mainSeriesID).remove();var options=getSeriesOptions();options.data=$scope.fundGrowthEnabled?$scope.fundGrowthData.slice():processData($scope.symbolSeriesData)[0],$scope.chart.addSeries(options,redraw),$scope.symbols.length&&reloadAllSeries()};var getSelectedChartType=function(type){return $scope.config.chartTypes.filter(function(el){return el.value===type})[0]},getSeriesOptions=function(){var options,type=$scope.chartType;return"area"===type?options=getMainChartDefaultOptions():(options={id:$scope.mainSeriesID,index:0,name:$scope.symbol,type:$scope.chartType,lineWidth:$scope.lineWidth,lineColor:$scope.chartColorBegin},"ohlc"!==type&&"candlestick"!==type||(options.lineColor=$scope.redGreenColors[0],options.upLineColor=$scope.redGreenColors[1],options.color=$scope.redGreenColors[0],options.upColor=$scope.redGreenColors[1],options.dataGrouping={groupPixelWidth:20,units:[["minute",[1,2,5,15,30]],["hour",[1,2,6,12]],["day",[1,2,3,4]],["week",[1,2]]]})),options.lastVisiblePrice={enabled:!$scope.fundGrowthEnabled&&$scope.currentPriceIndicatorEnabled,color:"#697a8b",dashStyle:"LongDash",label:{enabled:!0,style:{color:$scope.lastVisiblePriceLabelColor}}},options.showInLegend=!1,options},indicatorPointFormatter=function(){var y=$filter("sviNumber")(this.y,2,!0,!1);return'<span style="color:'+this.series.color+'"><b>'+this.series.name+"</b></span>: <b>"+y+" </b><br/>"},getPointFormatter=function(){var point,type=this.series.options.type;if("Volume"===this.series.name)return(point=this).series.name+": <b>"+$filter("sviNumber")(point.y,0,!0,!1)+"</b>";if(("area"===type||"line"===type)&&($scope.symbols.length||$scope.includeBenchmarks))return function(point){var y=$filter("sviNumber")(point.y,2,!0,!1),change=$filter("sviNumber")(point.change,2,!0,!1);return'<span style="color:'+(point.series.options.lineColor||point.series.color)+'">'+point.series.name+"</span>: <b>"+y+"</b> "+change+"% <br/>"}(this);if("ohlc"===type||"candlestick"===type)return function(point){var open=$filter("sviNumber")(point.open,2,!0,!1),high=$filter("sviNumber")(point.high,2,!0,!1),low=$filter("sviNumber")(point.low,2,!0,!1),close=$filter("sviNumber")(point.close,2,!0,!1);return"<b> "+point.series.name+"</b><br/>Open: "+open+"<br/>High: "+high+"<br/>Low: "+low+"<br/>Close: "+close+"<br/>"}(this);if("flags"===type){if("D"===this.title)return function(point){return"<b> "+point.text+"</b><br/>Ex-Date: "+point.exDate+"<br/>Payment Date: "+point.paymentDate+"<br/>Amount: "+$filter("sviNumber")(point.amount,2,!0,!1)}(this);if("S"===this.title)return function(point){return"<b> "+point.text+"</b><br/>Ex-Date: "+point.exDate+"<br/>Payment Date: "+point.paymentDate+"<br/>Announcement Date: "+point.announcementDate+"<br/>Ratio: "+point.ratio}(this);if("E"===this.title)return function(point){return"<b> "+point.text+"</b><br/>Release Date: "+point.releaseDate}(this)}return function(point){return"<b>"+$filter("sviNumber")(point.y,2,!0,!1)+"</b>"}(this)},getMainChartDefaultOptions=function(){return{id:$scope.mainSeriesID,name:$scope.symbol,data:[],type:"area",threshold:null,color:$scope.fundGrowthEnabled?$scope.fundGrowthColorBegin:$scope.chartColorBegin,lineColor:$scope.fundGrowthEnabled?$scope.fundGrowthColorBegin:$scope.lineColor,lineWidth:$scope.lineWidth,fillColor:{linearGradient:[0,0,0,500],stops:[[0,$scope.fundGrowthEnabled?$scope.fundGrowthColorBegin:$scope.chartColorBegin],[1,new Highcharts.Color($scope.chartColorEnd).setOpacity(0).get("rgba")]]},zIndex:1}};this.removeSymbolFromChart=function(symbol){$scope.loaded?($scope.loaded=!1,$scope.symbols=$scope.symbols.filter(function(el){return el.symbol!==symbol.symbol}),$scope.indexes[symbol.symbol]=!1,$scope.chart.get(symbol.symbol).remove(),0===$scope.symbols.length&&changeCompareType(),$scope.chart.rangeSelector.buttons[$scope.api.getSelectedTimespanIndex()].setState(2),$scope.loaded=!0):$timeout(function(){$scope.api.removeSymbolFromChart(symbol)},APP_CONFIG.autoLoadDelay)},this.removeIndicatorFromChart=function(indicator){indicator.added=!1,$scope.addedIndicators=$scope.addedIndicators.filter(function(el){return el.name!==indicator.name});var series=$scope.chart.get(indicator.name),axis=series.yAxis;series.remove(!1),indicator.newAxis&&(axis.remove(!1),resizeYAxes()),0<$scope.addedIndicators.length&&($scope.currentEditIndicator=$scope.addedIndicators[0]),$scope.chart.redraw()},this.filterIndicators=function(select){"marked"===($scope.indicatorLookupOption=select).value?$scope.indicatorsList=$scope.config.indicators.filter(function(indicator){return indicator.bookmark}):"added"===select.value?$scope.indicatorsList=$scope.config.indicators.filter(function(indicator){return indicator.added}):$scope.indicatorsList=$scope.config.indicators},this.investmentTypeFilter=function(el){return!el.investmentType||el.investmentType.includes($scope.investmentType)},this.indicatorsFilter=function(param){return function(el){return el.name.toLowerCase().includes(param.toLowerCase())||el.fullName&&el.fullName.toLowerCase().includes(param.toLowerCase())}},this.clearBenchmarks=function(reload){$scope.symbols.forEach(function(symbol){$scope.indexes.hasOwnProperty(symbol.symbol)&&($scope.indexes[symbol.symbol]=!!reload&&$scope.indexes[symbol.symbol]),$scope.chart.get(symbol.symbol).remove(!1)}),reload||($scope.symbols=[],changeCompareType())},this.clearChart=function(){removeEventsFromChart(),removeBenchmarksFromChart(),$scope.includeBenchmarks=!1,$scope.benchmarks=[],$scope.api.clearBenchmarks(),$scope.api.clearDrawAnnotations(),$scope.api.clearIndicators(),$scope.chart.zoomOut(),$scope.zoomButton&&Object.keys($scope.zoomButton).length&&$scope.zoomButton.destroy()},this.clearIndicators=function(){$scope.addedIndicators.forEach(function(indicator){$scope.api.removeIndicatorFromChart(indicator),indicator.added=!1})},this.clearDrawAnnotations=function(){for(var i=$scope.chart.annotations.length-1;-1<i;--i)$scope.chart.removeAnnotation($scope.chart.annotations[i]);$scope.chart.navigationBindings&&$scope.chart.navigationBindings.popup&&$scope.chart.navigationBindings.popup.closePopup(),$scope.chart.annotations=[],$scope.chart.options.annotations=[]},this.changeActiveTab=function(tab){("comparison"===$scope.activeTab&&"indicators"===tab||"indicators"===$scope.activeTab&&"comparison"===tab)&&$scope.api.clearDrawAnnotations(),$scope.activeTab=tab},this.checkBoxClick=function(symbol,addSymbol){addSymbol?addSymbolToChart(symbol):this.removeSymbolFromChart(symbol)},this.toggleEvents=function(eventsName,show){if(show)$scope.category="earnings"===eventsName?"Earnings":"splits"===eventsName?"StockSplits":"Dividends",$scope.shouldLoadEvents=!0,$scope.callback=loadDividendsAndEvents,$scope.load();else{var series=$scope.chart.get(eventsName);series&&series.remove()}},this.toggleCurrentIndicator=function(indicator){indicator.added?this.removeIndicatorFromChart(indicator):$scope.addedIndicators.length<5&&addIndicatorToChart(indicator)};var symbolExists=function(symbol){return $scope.symbols.find(function(el){return el.symbol===symbol})},addSymbolToChart=function(symbolToAdd,reload){if($scope.loaded)if($scope.loaded=!1,$scope.symbols.length<5||reload){var symbol={};if(symbol=angular.isObject(symbolToAdd)&&symbolToAdd.symbol&&symbolToAdd.title?symbolToAdd:{symbol:symbolToAdd,title:symbolToAdd},!symbolExists(symbol.symbol)||reload){if(!reload){var notDuplicatedColor=function(){var existingColors=$scope.symbols.map(function(symbol){return symbol.color}),color={};if(existingColors.length)for(var i=0;i<$scope.colors.length;i++)if(-1===existingColors.indexOf($scope.colors[i].color)){color=$scope.colors[i];break}return color}();symbol.color=notDuplicatedColor.color?notDuplicatedColor.color:$scope.colors[$scope.symbols.length].color,symbol.textColor=notDuplicatedColor.text?notDuplicatedColor.text:$scope.colors[$scope.symbols.length].text}$scope.symbolToLoad=symbol,$scope.indexes.hasOwnProperty(symbol.symbol)&&($scope.indexes[symbol.symbol]=!0),$scope.newChart=!1,$scope.fundGrowthEnabled?$scope.callback=loadFundGrowthToCompare:$scope.callback=loadSymbolToCompare,$scope.load()}else $scope.loaded=!0}else $scope.loaded=!0;else $timeout(function(){addSymbolToChart(symbolToAdd,reload)},APP_CONFIG.autoLoadDelay)},addBenchmarksToChart=function(){$scope.benchmarks.length&&$scope.benchmarks.forEach(function(benchmark,i){var name=benchmark.name,data=benchmark.performance,seriesData=processFundGrowthData(data);$scope.chart.zoomOut(),$scope.chart.yAxis[0].update({labels:{formatter:function(){return this.value+"%"}}},!1),$scope.chart.addSeries({id:name,name:name,data:seriesData,zIndex:2,type:"line",color:$scope.colors[$scope.symbols.length+5+i].color,lineWidth:$scope.lineWidth},!1),$scope.chart.yAxis[0].setCompare("percent"),$scope.chart.rangeSelector.buttons[$scope.api.getSelectedTimespanIndex()].setState(2)})},removeBenchmarksFromChart=function(){$scope.benchmarks.length&&(0===$scope.symbols.length&&changeCompareType(),$scope.benchmarks.forEach(function(benchmark){var series=$scope.chart.get(benchmark.name);series&&series.remove()}))},updateBenchmarks=function(){$scope.benchmarks.length&&$scope.benchmarks.forEach(function(benchmark){var series=$scope.chart.get(benchmark.name);if(series){var seriesData=processFundGrowthData(benchmark.performance);series.setData(seriesData,!1),series.update({name:benchmark.name})}})},changeCompareType=function(){$scope.chart.yAxis[0].update({labels:{formatter:function(){return $filter("sviNumber")(this.value,2,!0,!1)}}},!1),$scope.chart.yAxis[0].setCompare("none")},getSymbolName=function(symbol){return $scope.symbols.filter(function(el){return el.symbol===symbol})[0].title},getSymbolColor=function(symbol){return symbol===$scope.symbol?$scope.lineColor:$scope.symbols.filter(function(el){return el.symbol===symbol})[0].color};$scope.api=this,widget.attach($scope,$element);var correctFloat=function(num,prec){return parseFloat(num.toPrecision(prec||14))},isNumber=function(n){return"number"==typeof n&&!isNaN(n)&&n<1/0&&-1/0<n},addIndicatorToChart=function(indicator){var previousChartType,chartRedraw=!0;indicator.chartType&&indicator.chartType!==$scope.chartType&&(previousChartType=$scope.chartType,chartRedraw=!1,$scope.api.changeChartType(indicator.chartType,chartRedraw));var chart=$scope.chart,seriesConfig={id:indicator.name,name:indicator.name,linkedTo:$scope.mainSeriesID,type:indicator.type,params:indicator.params,color:indicator.color,marker:{enabled:!1},tooltip:{pointFormatter:indicatorPointFormatter},zIndex:99};if(indicator.newAxis){var yAxis=chart.addAxis({id:"axis-"+indicator.type,title:{text:""},opposite:!0,maxPadding:.1},!1,!1);seriesConfig.yAxis=yAxis.options.id,indicator.nonVisibleAxis?yAxis.update({visible:!1,height:chart.yAxis[0].options.height,top:0},!1):resizeYAxes()}else seriesConfig.yAxis=chart.get(seriesConfig.linkedTo).options.yAxis;"ao"===indicator.type&&(seriesConfig.color=$scope.redGreenColors[0],seriesConfig.upColor=$scope.redGreenColors[1]),indicator.volumeSeriesID&&(seriesConfig.params.volumeSeriesID=$scope.volumeSeriesID),chart.addSeries(seriesConfig,chartRedraw),indicator.added=!0,$scope.addedIndicators.push(indicator),chartRedraw||$scope.api.changeChartType(previousChartType,!0)},toggleVolume=function(){var volumeSeries=$scope.chart.get($scope.volumeSeriesID);$scope.showVolume?volumeSeries.show():volumeSeries.hide(),$scope.chart.yAxis[1].update({visible:$scope.showVolume,height:"13%"},!1),resizeYAxes(),$scope.chart.redraw()},resizeYAxes=function(){function isResizable(yAxis){var id=yAxis.userOptions.id;return function(yAxis){return!angular.isDefined(yAxis.options.visible)||yAxis.options.visible}(yAxis)||id===$scope.volumeSeriesID}var chart=$scope.chart;defaultHeight=15;var yAxes=chart.yAxis.filter(function(yAxis){return isResizable(yAxis)}),nonResizableAxes=chart.yAxis.filter(function(yAxis){return!isResizable(yAxis)}),plotHeight=chart.plotHeight,positions=getYAxisPositions(yAxes,plotHeight,defaultHeight),allAxesLength=yAxes.length,allAxesHeight=positions.allAxesHeight,changedSpace=defaultHeight;1<allAxesHeight?(positions=allAxesLength<6?(positions[0].height=correctFloat(positions[0].height-changedSpace),recalculateYAxisPositions(positions,changedSpace)):(defaultHeight=100/allAxesLength,changedSpace=defaultHeight/(allAxesLength-1),recalculateYAxisPositions(positions,changedSpace,!0,-1)))[allAxesLength-1]={top:correctFloat(100-defaultHeight+2),height:defaultHeight-2}:(changedSpace=100*correctFloat(1-allAxesHeight),positions=allAxesLength<5?(positions[0].height=correctFloat(positions[0].height+defaultHeight),recalculateYAxisPositions(positions,changedSpace)):recalculateYAxisPositions(positions,changedSpace/=allAxesLength,!0,1)),positions.forEach(function(position,index){yAxes[index].update({height:position.height+"%",top:position.top+"%"},!1)}),nonResizableAxes.forEach(function(yAxis){yAxis.update({height:chart.yAxis[0].options.height},!1)})},getYAxisPositions=function(yAxes,plotHeight,defaultHeight){var positions,allAxesHeight=0;function isPercentage(prop){return angular.isDefined(prop)&&!isNumber(prop)&&prop.match("%")}return(positions=yAxes.map(function(yAxis,index){var height=isPercentage(yAxis.options.height)?parseFloat(yAxis.options.height)/100:yAxis.height/plotHeight,top=isPercentage(yAxis.options.top)?parseFloat(yAxis.options.top)/100:correctFloat(yAxis.top-yAxis.chart.plotTop)/plotHeight;return isNumber(height)||(height=(defaultHeight-2)/100),allAxesHeight=correctFloat(allAxesHeight+height+(0===index?0:.02)),{height:100*height,top:100*top}})).allAxesHeight=allAxesHeight,positions},recalculateYAxisPositions=function(positions,changedSpace,modifyHeight,adder){return positions.forEach(function(position,index){var prevPosition=positions[index-1];position.top=prevPosition?correctFloat(prevPosition.height+prevPosition.top+2):0,modifyHeight&&(position.height=correctFloat(position.height+adder*changedSpace))}),positions};this.displayModal=function(){$scope.modal?$scope.modal.$promise.then($scope.modal.show):($scope.modalScope=$scope.$new(),setModalScopeOptions($scope.modalScope),$scope.modal=$modal({scope:$scope,templateUrl:"advancedSymbolChart/advancedSymbolChartModal.tpl.html",container:".modals-section",backdrop:!1,animation:"",show:!0}))},this.hideModal=function(){$scope.modal&&$scope.modal.$isShown&&$scope.modal.hide()};var setModalScopeOptions=function(modalScope){modalScope.labels=$scope.labels,modalScope.close="Close",modalScope.id=$scope.id+"-modal",modalScope.indicatorLookup="",modalScope.indicatorLookupOption=$scope.indicatorLookupOption,modalScope.indicatorsOrder="name",modalScope.indicatorsOrderReverse=!1,modalScope.api=$scope.api,modalScope.indicatorsList=$scope.indicatorsList,modalScope.addedIndicators=$scope.addedIndicators,modalScope.config=$scope.config};$scope.getOptions=function(){var numberFilter=$filter("sviNumber");$scope.zoomButton={};var resetButtonPosition_x=-91,resetButtonPosition_y=20,options={chart:{renderTo:$element.find(".chart")[0],spacingTop:10,spacingBottom:60,resetZoomButton:{position:{align:"right",verticalAlign:"top",x:resetButtonPosition_x,y:resetButtonPosition_y},relativeTo:"chart"},events:{selection:function(event){if(event.xAxis&&event.xAxis.length&&(!event.yAxis||!event.yAxis.length)){$scope.zoomButton&&Object.keys($scope.zoomButton).length&&$scope.zoomButton.destroy();var ch=this;$scope.zoomButton=ch.renderer.button("Reset zoom",null,null,function(){ch.xAxis[0].setExtremes(null,null)},{zIndex:20}).attr({id:"resetZoom",align:"right",title:"Reset zoom level 1:1"}).add().align({align:"right",x:resetButtonPosition_x,y:resetButtonPosition_y},!1,null)}},render:function(evt){this.rangeDropdownLabel&&(this.rangeDropdownLabel.destroy(),this.rangeDropdownLabel=undefined,0!==this.rangeSelector.options.buttonPosition.x&&(this.rangeSelector.options.buttonPosition.x=0,this.rangeSelector.render())),evt.target.rangeSelector.hasVisibleDropdown&&($element.find(".chart  div  select option:contains('"+this.options.lang.rangeSelectorZoom+"')").css({display:"none"}),0===this.rangeSelector.options.buttonPosition.x&&(this.rangeSelector.options.buttonPosition.x=30,this.rangeSelector.render()),this.rangeDropdownLabel=this.renderer.g().add(),this.renderer.text('<span style="font-size:12px; color: #666666">'+this.options.lang.rangeSelectorZoom+"</span>",evt.target.rangeSelector.dropdown.offsetLeft-40,evt.target.rangeSelector.dropdown.offsetTop+15).add(this.rangeDropdownLabel)),$scope.showPriceInfo&&$scope.priceInfoText&&!this.priceInfoText&&(this.priceInfoText=this.renderer.g().add(),this.renderer.text('<span style="font-size:15px;font-weight: bold"">'+$scope.symbol+'</span><span style="color:'+$scope.priceInfoText.color+';font-weight: bold"">&nbsp;&nbsp;'+$scope.priceInfoText.text+"</span>",10,25).add(this.priceInfoText))},click:function(){0!==Object.keys(this.pane[0].chart).length&&$scope.chart.pointer.drop()}}},mapNavigation:{enabled:!0,enableButtons:!1},navigation:{bindingsClassName:"tools-container-"+$scope.id,events:{selectButton:function(event){(event.button.classList.contains("highcharts-zoom-x")||event.button.classList.contains("highcharts-zoom-y")||event.button.classList.contains("highcharts-zoom-xy"))&&this.chart.renderer.boxWrapper.addClass("highcharts-draw-mode")}},buttonOptions:{align:"right",verticalAlign:"bottom",y:0}},stockTools:{gui:{enabled:!1},indicatorsPopupContainer:{style:{display:"none"}}},accessibility:{landmarkVerbosity:"disabled",description:"Chart showing historical values for the selected symbol."},credits:{enabled:!1},scrollbar:{enabled:!1},navigator:{enabled:!1},rangeSelector:{enabled:$scope.showRangeButtons,allButtonsEnabled:!0,selected:$scope.api.getSelectedTimespanIndex(),inputEnabled:!1,buttons:"MutualFund"!==$scope.investmentType?rangeButtons:mutualFundRangeButtons,verticalAlign:"bottom",buttonTheme:{width:36,r:5,style:{fontSize:"12px"},states:{hover:{style:{color:"#333"}},select:{fill:"#777",style:{color:"#fff"}}}}},title:{text:"Advanced Chart",style:{display:"none"}},tooltip:{xDateFormat:"Today"===$scope.timespan?"%I:%M %p":"%b %d, %Y",pointFormatter:getPointFormatter,crosshairs:{dashStyle:"dash"},split:$scope.showVolume},xAxis:{type:"datetime",dateTimeLabelFormats:{hour:"%I:%M %p",second:"%I:%M:%S %p",millisecond:"%I:%M:%S.%L %p"},events:{setExtremes:function(evt){if(!evt.min&&!evt.max&&$scope.zoomButton&&Object.keys($scope.zoomButton).length&&$scope.zoomButton.destroy(),angular.isDefined(event)&&!event.min&&!event.max&&this.chart.renderer&&this.chart.renderer.boxWrapper.removeClass("highcharts-draw-mode"),angular.isDefined(evt.rangeSelectorButton)){var isCurrentActive=!1;return this.chart.rangeSelector.buttons.forEach(function(btn){2===btn.state&&evt.rangeSelectorButton.text===btn.textStr&&(isCurrentActive=!0)}),$scope.api.setTimespan(evt.rangeSelectorButton.filter),isCurrentActive&&reloadOnTimespanChanged(),!1}}}},yAxis:[{labels:{formatter:function(){return numberFilter(this.value,2,!0,!1)},style:{color:$scope.yAxisFontColor},align:"left"},events:{setExtremes:function(){angular.isDefined(event)&&!event.min&&!event.max&&this.chart.chartBackground&&this.chart.renderer.boxWrapper.removeClass("highcharts-draw-mode")}}}],responsive:{rules:[{condition:{maxWidth:400}}]},series:[getSeriesOptions()],legend:{enabled:$scope.includeBenchmarks,align:"left",itemStyle:{textDecoration:"none",color:"#05c"},itemHoverStyle:{textDecoration:"underline"}}};return $scope.showVolume&&(options.yAxis[0].height="85%",options.yAxis.push({labels:{style:{color:$scope.yAxisFontColor}},height:"13%",top:"87%",floor:0,tickPixelInterval:35}),options.series.push({id:$scope.volumeSeriesID,index:1,type:"column",name:"Volume",color:$scope.chartColorBegin,data:[],yAxis:1,dataGrouping:{groupPixelWidth:15,units:[["minute",[1,2,5,15,30]],["hour",[1,2,6,12]],["day",[1,2,3,4]],["week",[1,2]]]},showInLegend:!1})),options},$scope.priceInfoLoader=null,$scope.getPriceInfoLoader=function(loader){$scope.priceInfoLoader=loader},this.getOneDayPriceInfo=function(){piwik.trackEvent("GetOneDayPriceInfoAdvancedChart","Get Price Info Advanced Chart",$scope.symbol),!$scope.priceInfoText&&$scope.showPriceInfo&&($scope.priceInfoLoader?$scope.priceInfoLoader.setLoadHandler(getOneDayPriceInfoCallback).load(!0).then(oneDayPriceInfoSuccess,onError):$timeout($scope.api.getOneDayPriceInfo,200))},$timeout(function(){$scope.priceInfoText||$scope.api.getOneDayPriceInfo()},400);var getOneDayPriceInfoCallback=function(invalidateCache){return symbol.getPriceHistory($scope.symbol,"TodayOrYesterdayOrLastWeek",null,!0,invalidateCache)},oneDayPriceInfoSuccess=function(data){piwik.trackDataLoad($scope,data),data.symbolHistory.quotes&&data.symbolHistory.instrument&&data.symbolHistory.instrument.securityType!==$scope.mutualFundSecurityType&&showPriceInfo(data.symbolHistory.quotes),$scope.api.scheduleReloadPriceInfo(6e4)},showPriceInfo=function(quotes){var lastPrice=quotes[quotes.length-1].lastPrice,change=lastPrice-quotes[quotes.length-2].lastPrice,color=0<change?"green":"red",percentChange=change/lastPrice*100,priceInfoText=("-"===(0<change?"+":"-")?"":"+")+$filter("number")(change,2)+" | "+$filter("percent")(percentChange,2,!0,!0);$scope.priceInfoText={text:priceInfoText,color:color},$scope.chart&&($scope.chart.priceInfoText&&($scope.chart.priceInfoText.destroy(),$scope.chart.priceInfoText=undefined),$scope.chart.priceInfoText=$scope.chart.renderer.g().add(),$scope.chart.renderer.text('<span style="font-size:15px;font-weight: bold">'+$scope.symbol+'</span><span style="color:'+$scope.priceInfoText.color+';font-weight: bold">&nbsp;&nbsp;'+$scope.priceInfoText.text+"</span>",10,25).add($scope.chart.priceInfoText))};this.scheduleReloadPriceInfo=function(delay){null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout),$scope.reloadTimeout=$timeout(function(){$scope.priceInfoText=null,$scope.api.getOneDayPriceInfo()},delay)},$scope.ignoreEvents||(eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){data.hasOwnProperty("symbol")&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol),data.hasOwnProperty("investmentType")&&data.underlying&&"Option"===data.investmentType?($scope.symbol=data.underlying,$scope.showDisclaimer=!0):data.hasOwnProperty("investmentType")&&"MutualFund"===data.investmentType?($scope.showDisclaimer=!1,"Today"!==$scope.timespan&&"OneDay"!==$scope.timespan||($scope.timespan="ThreeMonth")):$scope.showDisclaimer=!1}),eventDispatcher.on("SYMBOL.CONTEXT.ADDED",function(e,data){data.hasOwnProperty("symbol")&&$scope.symbol!==data.symbol&&($scope.shouldClearInput=!0,addSymbolToChart(data.symbol))}),eventDispatcher.on("ADVANCED.CHART.TYPE.FILTER.CHANGED",function(e,data){$scope.chartType=data.value},!0),eventDispatcher.on("ADVANCED.CHART.INDICATOR.TYPE.FILTER.CHANGED",function(e,data){$scope.api.filterIndicators(data.value)},!0))}],link:function($scope,$element,$attrs){var template=$templateCache.get("advancedSymbolChart/advancedSymbol"+$scope.template+".tpl.html"),formTmpl=$templateCache.get("advancedSymbolChart/advancedSymbolChartWrapper.tpl.html");$element.html(template.replace("%CHART_WRAPPER%",formTmpl)),$compile($element.contents())($scope),"MutualFund"===$scope.investmentType?($element.find("#chartSettingsTab").addClass("active"),$element.find("#chartSettings").addClass("active"),$element.find("#chartSettings").addClass("in")):($element.find("#comparisonChartTab").addClass("active"),$element.find("#comparisonChart").addClass("active"),$element.find("#comparisonChart").addClass("in")),$timeout(function(){$scope.chartColorBegin=$attrs.chartColorBegin,$scope.useGradient=$attrs.useGradient,$scope.yAxisFontColor=$attrs.yAxisFontColor,$scope.parentTabSelector='.svi-sub-page-nav a[data-toggle="tab"]',$scope.parentTabSelector&&angular.element($scope.parentTabSelector).on("shown.bs.tab",function(e){$scope.chart&&$scope.chart.reflow()}),$element.find($scope.chartTabSelector).on("shown.bs.tab",function(e){$scope.chart&&$scope.chart.pointer&&$scope.chart.pointer.hasZoom&&$scope.chart.update({chart:{zoomType:""}})}),""!==$scope.symbol&&$scope.loadIndicatorsConfig()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("svi.symbol").directive("sviDetailedQuote",["$templateCache","$compile","$popover","APP_CONFIG","eventDispatcher","$timeout","labels","symbol","actionMenu","sviUrl","config","bsBreakpoint","piwik",function($templateCache,$compile,$popover,APP_CONFIG,eventDispatcher,$timeout,labels,symbol,actionMenu,sviUrl,config,bsBreakpoint,piwik){var updateSymbolClass=function($scope,$element){var empty=angular.isUndefined($scope.symbol)||""===$scope.symbol||angular.isArray($scope.symbol)&&!$scope.symbol.length;$element.toggleClass("no-symbol",empty),$element.toggleClass("has-symbol",!empty)},INVESTMENT_TYPE_stock="Stock",INVESTMENT_TYPE_option="Option",INVESTMENT_TYPE_etf="ETF";return{replace:!1,scope:{symbol:"@",eventName:"@",delayed:"@",template:"@",id:"@",useCache:"@",comm:"=?",showTitle:"@",mobileScrollOnUpdate:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultBoolean($scope,$attrs,"delayed",!APP_CONFIG.rtqEnabled),svi.ng.defaultValidString($scope,$attrs,"template",["detailed","popover","tradeWidget","tradePage","detailedWidget","mutualFundAAG","stockAAG","newPopover"],"detailed"),svi.ng.defaultString($scope,$attrs,"id",php.uniqid("quote")),svi.ng.defaultTrue($scope,$attrs,"useCache"),svi.ng.defaultFalse($scope,$attrs,"mobileScrollOnUpdate"),$scope.naValue=APP_CONFIG.naValue,$scope.quote=null,$scope.showOptionSearch=!1,$scope.isPopover=-1!==["popover","newPopover"].indexOf($scope.template),$scope.isOptionSearch=!1,$scope.investmentType="",$scope.securityType="",svi.ng.defaultTrue($scope,$attrs,"showTitle");var labelSets=["general","detailedQuote"];"mutualFundAAG"===$scope.template&&labelSets.push("mutualFundQuoteAAG"),"stockAAG"===$scope.template&&labelSets.push("stockQuoteAAG"),labels.setupLabels($scope,labelSets,{}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(invalidateCache){if(!$scope.loader)return $timeout($scope.load,200);angular.isUndefined($scope.symbol)||""===$scope.symbol||angular.isArray($scope.symbol)&&!$scope.symbol.length||(angular.isUndefined(invalidateCache)&&(invalidateCache=!$scope.useCache),$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError))},$timeout($scope.load);var loadCallback=function(invalidateCache){return $scope.quote=null,symbol.getQuote($scope.symbol,$scope.delayed,null,invalidateCache)},setLoaderError=function(msg){$scope.loader?$scope.loader.setError(msg):$timeout(function(){setLoaderError(msg)},APP_CONFIG.autoLoadDelay)},onSuccess=function(response){angular.isObject(response)&&response.hasOwnProperty("symbolQuote")&&angular.isObject(response.symbolQuote)&&response.symbolQuote.hasOwnProperty("instrumentQuotes")&&angular.isArray(response.symbolQuote.instrumentQuotes)&&response.symbolQuote.instrumentQuotes.length?(piwik.trackPage("detailedQuote","Detailed Quote",!!response.hasOwnProperty("_loaderMetadata")&&1e3*response._loaderMetadata.elapsedTime),$scope.quote=response.symbolQuote.instrumentQuotes,$scope.investmentType=getInvestmentType($scope.quote[0].instrument),$scope.securityType=JSON.stringify($scope.quote[0].instrument),$scope.tradeWidgetEnabled=response.symbolQuote.tradeWidgetEnabled,$scope.quote.length?($scope.isPopover&&$element.parents(".popover").attr("data-investment-type",$scope.quote[0].instrument.investmentType),$timeout(function(){angular.isArray($scope.quote)&&0<$scope.quote.length&&renderMarker($scope.quote[0].quote)},300),eventDispatcher.trigger("POPOVER.QUOTE.LOADED")):setLoaderError($scope.labels.noDataSymbol),$scope.mobileScrollOnUpdate&&bsBreakpoint.isMobile()&&$("html,body").animate({scrollTop:$element.offset().top-APP_CONFIG.navHeightMobile-150},300)):setLoaderError($scope.labels.dataRenderError)},onError=function(response){$scope.quote=null,404===response.status&&setLoaderError($scope.labels.noDataSymbol)},getInvestmentType=function(instrument){if(instrument&&instrument.investmentType)return instrument.investmentType&&instrument.subType===INVESTMENT_TYPE_etf?INVESTMENT_TYPE_etf:instrument.investmentType},renderMarker=function(quote){var rangechartEl=$($element.find(".rangechart"));if(quote&&0<rangechartEl.length){var lastPrice=parseFloat(quote.lastPrice),high52Price=parseFloat(quote.extendedQuote.high52Price),markerPos=Math.round(lastPrice/high52Price*30);rangechartEl.html("");var renderer=new Highcharts.Renderer(rangechartEl[0],30,10);renderer.path(["M",0,5,"L",30,5]).attr({"stroke-width":2,stroke:"grey"}).add(),renderer.path(["M",markerPos,0,"L",markerPos,10]).attr({"stroke-width":1,stroke:"red"}).add()}};$scope.getActionBarMaxItems=function(){return bsBreakpoint.getBreakpoint()>bsBreakpoint.XS?4:3},$scope.isTradeableBidAsk=function(){if($scope.quote&&0<$scope.quote.length){var quote=$scope.quote[0],investmentType=quote.instrument.investmentType;return quote.isTradeable&&(investmentType===INVESTMENT_TYPE_stock||investmentType===INVESTMENT_TYPE_option)}return!1},$scope.trade=function(target){if($scope.isTradeableBidAsk()){var side,quote=$scope.quote[0],limitPrice=quote.quote["ask"===target?"askPrice":"bidPrice"];if(side=quote.instrument.investmentType===INVESTMENT_TYPE_option?"bid"===target?"STO":"BTO":"bid"===target?"2":"1",$scope.tradeWidgetEnabled)eventDispatcher.trigger("QUOTE.ACTION.TRADE",{SYMBOL:$scope.symbol,side:side,limit:limitPrice,investmentType:quote.instrument.investmentType,price:"2"});else{var params={transaction:side,ordType:2,limitPrice:limitPrice,symbol:$scope.symbol},url="/Modules/Trading/Trade/Standard/"+quote.instrument.investmentType+"/enter.php?"+$.param(params);sviUrl.href(url)}}},$scope.$watch("symbol",function(newValue,oldValue){newValue!==oldValue&&(updateSymbolClass($scope,$element),$scope.load())},!0),this.setSymbol=function(symbol){return $scope.symbol=symbol,this},this.getSymbol=function(){return $scope.symbol},this.load=function(){$scope.load()},$scope.optionSearch={val:!1},this.handleOptionSearch=function(val){$scope.showOptionSearch=val,$scope.optionSearch.val=val,eventDispatcher.trigger("OPTION.SEARCH.ACTION",{symbol:$scope.symbol,showOptionSearch:val,isOptionSearch:$scope.isOptionSearch})},$scope.api=this,svi.ng.addCommWatch($scope),eventDispatcher.on("QUOTE.LOADED",function(event,data){(angular.isArray($scope.symbol)?$scope.symbol.join(","):$scope.symbol)===data.currentSymbol&&$scope.delayed===(!0===data.delayed||"true"===data.delayed)&&onSuccess(data)},null,$element),eventDispatcher.on("OPTION.SEARCH.SYMBOL.SUBMITTED",function(e,data){data&&data.symbol&&$scope.isPopover&&($scope.showOptionSearch=!1,$scope.optionSearch.val=!1,$scope.symbol=data.symbol,$scope.isOptionSearch=!0)},!1,$element),eventDispatcher.on($scope.eventName,function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList:angular.isDefined(data.symbol)&&""!==data.symbol&&($scope.symbol!==data.symbol?$scope.symbol=data.symbol:$scope.load())},null,$element),eventDispatcher.on("QUOTE.ACTION.ZOOM",function(e,data){$scope.isPopover&&eventDispatcher.trigger("POPOVER.HIDE",$scope.id),actionMenu.startHoldingZoom(data)},!1,$element),eventDispatcher.on("QUOTE.ACTION.CLEAR",function(e){$scope.quote=null,$scope.symbol=""},!1,$element),eventDispatcher.on("QUOTE.ACTION.TRADE",function(e,data){$scope.isPopover&&eventDispatcher.trigger("POPOVER.HIDE",$scope.id),actionMenu.startTradeWidget(data)},!1,$element)}],link:function($scope,$element){var template=$templateCache.get("detailedQuote/"+$scope.template+"Quote.tpl.html"),formTmpl=$templateCache.get("detailedQuote/ariaLiveQuote.tpl.html");$element.html(template.replace("%ARIA_LIVE%",formTmpl)).show(),$compile($element.contents())($scope),updateSymbolClass($scope,$element)}}}]),angular.module("svi.symbol").directive("sviPriceHistoryChart",["APP_CONFIG","$templateCache","eventDispatcher","$timeout","labels","symbol","highcharts","$filter","piwik","widget","$compile",function(APP_CONFIG,$templateCache,eventDispatcher,$timeout,labels,symbol,highcharts,$filter,piwik,widget,$compile){var TYPE_FUND="MutualFund",rangeButtons=[{type:"day",count:1,title:"1 Day",text:"1D",filter:"TodayOrYesterdayOrLastWeek",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["minute",[1,2,5,15,30]],["hour",[1,2,6,12]],["day",[1,2,3,4]]]}},{type:"week",count:1,title:"1 Week",text:"1W",filter:"OneWeek",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["minute",[1,2,5,15,30]],["hour",[1,2,6,12]],["day",[1,2,3,4]],["week",[1,2]]]}},{type:"month",count:1,title:"1 Month",text:"1M",filter:"OneMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:3,title:"3 Month",text:"3M",filter:"ThreeMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:6,title:"6 Month",text:"6M",filter:"SixMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:12,title:"1 Year",text:"1Y",filter:"OneYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:36,title:"3 Year",text:"3Y",filter:"ThreeYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:60,title:"5 Year",text:"5Y",filter:"FiveYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:120,title:"10 Year",text:"10Y",filter:"TenYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}}],mutualFundRangeButtons=[{type:"month",count:1,title:"1 Month",text:"1M",filter:"OneMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:3,title:"3 Month",text:"3M",filter:"ThreeMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:6,title:"6 Month",text:"6M",filter:"SixMonth",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:12,title:"1 Year",text:"1Y",filter:"OneYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:36,title:"3 Year",text:"3Y",filter:"ThreeYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:60,title:"5 Year",text:"5Y",filter:"FiveYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}},{type:"month",count:120,title:"10 Year",text:"10Y",filter:"TenYear",preserveDataGrouping:!0,dataGrouping:{forced:!0,units:[["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]]}}],frequencyOptions=[{text:"1 min",value:"OneMinute"},{text:"5 min",value:"FiveMinute"},{text:"30 min",value:"ThirtyMinute"}],oneDayTimespanArray=["Today","OneDay","TodayOrYesterday","Yesterday","TodayOrYesterdayOrLastWeek","TodayOrYesterdayOrLastWeek"];return{replace:!1,scope:{symbol:"@",timespan:"@",chartColorBegin:"@",useGradient:"@",yAxisFontColor:"@",lineColor:"@",lineWidth:"@",showTitle:"@",showSymbol:"@",showRangeButtons:"@",rangeButtonWidth:"@",showVolume:"@",showNavigator:"@",showPriceInfo:"@",showMarketActivity:"@",showFrequency:"@",eventName:"@",ignoreEvents:"@",reloadEvery:"@",template:"@",responsive:"@",investmentType:"@",marketHoursOnly:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.required($attrs,"symbol"),svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultValidString($scope,$attrs,"timespan",["Today","TodayOrYesterday","TodayOrYesterdayOrLastWeek","Yesterday","WTD","MTD","YTD","OneDay","OneWeek","OneMonth","ThreeMonth","SixMonth","OneYear","ThreeYear","FiveYear","TenYear"],"ThreeMonth"),svi.ng.defaultInt($scope,$attrs,"rangeButtonWidth",null),svi.ng.defaultString($scope,$attrs,"chartColorBegin","#FFFFFF"),svi.ng.defaultString($scope,$attrs,"lineColor","#8EBFEF"),svi.ng.defaultInt($scope,$attrs,"lineWidth",1),svi.ng.defaultFalse($scope,$attrs,"useGradient"),svi.ng.defaultString($scope,$attrs,"yAxisFontColor","#000000"),svi.ng.defaultString($scope,$attrs,"chartColorEnd",!1===$scope.useGradient?$scope.chartColorBegin:"#FFFFFF"),svi.ng.defaultTrue($scope,$attrs,"showTitle"),svi.ng.defaultFalse($scope,$attrs,"showSymbol"),svi.ng.defaultTrue($scope,$attrs,"showRangeButtons"),svi.ng.defaultFalse($scope,$attrs,"showVolume"),svi.ng.defaultFalse($scope,$attrs,"showNavigator"),svi.ng.defaultFalse($scope,$attrs,"showPriceInfo"),svi.ng.defaultFalse($scope,$attrs,"showMarketActivity"),svi.ng.defaultFalse($scope,$attrs,"showFrequency"),svi.ng.defaultFalse($scope,$attrs,"ignoreEvents"),svi.ng.defaultInt($scope,$attrs,"reloadEvery",0,null,60),svi.ng.defaultValidString($scope,$attrs,"template",["Widget","Chart"],"Chart"),svi.ng.defaultFalse($scope,$attrs,"responsive"),svi.ng.defaultValidString($scope,$attrs,"investmentType",["Stock","Option",TYPE_FUND],"Stock"),$scope.showDisclaimer=!1,$scope.showDisclaimer="Option"===$scope.investmentType,svi.ng.defaultFalse($scope,$attrs,"marketHoursOnly"),$scope.showActiveMarketHoursToggler=$scope.showMarketActivity&&-1!==oneDayTimespanArray.concat(["OneWeek"]).indexOf($scope.timespan),$scope.showAfterMarketActivity=!1,$scope.reloadTimeout=null,$scope.api=this,$scope.loaded=!1,$scope.id=php.uniqid("priceHistoryChart"),$scope.parentTabSelector='.svi-sub-page-nav a[data-toggle="tab"]',$scope.showFrequencySelection=$scope.showFrequency&&-1!==oneDayTimespanArray.indexOf($scope.timespan),$scope.frequencyOptions=frequencyOptions,$scope.selectedFrequency=frequencyOptions[0],$scope.frequency=$scope.showFrequencySelection&&$scope.selectedFrequency,$scope.mutualFundSecurityType="MutualFund",$scope.rangeSelectorShift=35,labels.setupLabels($scope,["general","priceHistoryChart"],{priceHistoryChartTitle:"Price History"}),$scope.title=$attrs.title||labels.priceHistoryChartTitle,$scope.setLoader=function(loader){$scope.loader=loader},$scope.scheduleReload=function(delay){null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout),$scope.reloadTimeout=$timeout(function(){$scope.load(!0)},delay)},$element.on("$destroy",function(){$scope.reloadEvery=!1,null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout)}),$scope.load=function(invalidateCache){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $scope.scheduleReload(APP_CONFIG.autoLoadDelay);""!==$scope.symbol&&(null!==$scope.reloadTimeout&&($timeout.cancel($scope.reloadTimeout),$scope.reloadTimeout=null),$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError))};var loadCallback=function(invalidateCache){return symbol.getPriceHistory($scope.symbol,$scope.timespan,null,$scope.marketHoursOnly,invalidateCache,$scope.frequency.value)},onSuccess=function(response){if(!response.success)return piwik.trackPage("priceHistoryChart/error","Error: Price History Chart",1e3*response._loaderMetadata.elapsedTime,[{name:"symbol",value:$scope.symbol}]),void $scope.loader.setError($scope.labels.dataRenderError);if(!response.symbolHistory||!angular.isArray(response.symbolHistory.quotes)||!response.symbolHistory.quotes.length)return piwik.trackPage("priceHistoryChart/noData","Price History Chart - No Data",1e3*response._loaderMetadata.elapsedTime,[{name:"symbol",value:$scope.symbol}]),void $scope.loader.setMessage($scope.labels.chartNoData);piwik.trackPage("priceHistoryChart","Price History Chart",1e3*response._loaderMetadata.elapsedTime,[{name:"symbol",value:$scope.symbol}]);var options=$.extend(!0,{},$scope.getOptions()),quotes=response.symbolHistory.quotes,seriesData=processData(quotes);options.series[0].data=seriesData[0],$scope.showVolume&&$scope.investmentType!==TYPE_FUND&&$scope.securityType!==TYPE_FUND&&(options.series[1].data=seriesData[1]);for(var isVolumeDataExists=!1,j=0;j<seriesData[1].length;j++)if(seriesData[1][j][1]!==undefined&&null!==seriesData[1][j][1]){isVolumeDataExists=!0;break}isVolumeDataExists||(options.yAxis[0].height="100%");var len=seriesData[0].length;if(0<len){for(var minPrice=seriesData[0][0][1],i=1;i<len;i++)seriesData[0][i][1]<minPrice&&(minPrice=seriesData[0][i][1]);options.yAxis.min=0<Math.floor(minPrice)?minPrice-10:Math.floor(minPrice)}$scope.chart&&$scope.chart.destroy(),$scope.chart=highcharts.getStockChart(options),$scope.showPriceInfo&&!$scope.priceInfoText&&showPriceInfo(quotes),$scope.loaded=!0,!$scope.reloadEvery||"Today"!==$scope.timespan&&"OneDay"!==$scope.timespan&&"Yesterday"!==$scope.timespan&&"TodayOrYesterdayOrLastWeek"!==$scope.timespan||$scope.scheduleReload(1e3*$scope.reloadEvery)},onError=function(response){piwik.trackPage("priceHistoryChart/error","Error: Price History Chart",!1,[{name:"symbol",value:$scope.symbol}]),response.invalidSymbol||$scope.loader.setError($scope.labels.dataRenderError),$scope.chart&&($scope.chart.destroy(),$scope.chart=null)},processData=function(data){for(var prices=[],volume=[],i=0;i<data.length;i++){var timestamp=data[i].quoteTime.toString().replace(/\-[0-9]{4,4}/g,"Z"),d=new Date(timestamp);try{prices.push([d.getTime(),data[i].lastPrice])}catch(e){prices.push([d.getTime(),null])}if($scope.showVolume&&$scope.investmentType!==TYPE_FUND&&$scope.securityType!==TYPE_FUND)try{volume.push([d.getTime(),data[i].extendedQuote.volume])}catch(e){volume.push([d.getTime(),null])}}return[prices,volume]},showPriceInfo=function(quotes){var lastPrice=quotes[quotes.length-1].lastPrice,change=lastPrice-quotes[quotes.length-2].lastPrice,color=0<change?"green":"red",percentChange=change/lastPrice*100,priceInfoText=("-"===(0<change?"+":"-")?"":"+")+$filter("number")(change,2)+" | "+$filter("percent")(percentChange,2,!0,!0);if($scope.priceInfoText={text:priceInfoText,color:color},$scope.chart){$scope.chart.priceInfoText&&($scope.chart.priceInfoText.destroy(),$scope.chart.priceInfoText=undefined),$scope.chart.priceInfoText=$scope.chart.renderer.g().add();var dayChangeFeatureText='<span style="font-size:15px; font-weight: bold">'+$scope.symbol+"</span>";$scope.chart.renderer.text(dayChangeFeatureText,10,11).add($scope.chart.priceInfoText)}};$scope.selectFrequency=function(frequency){$scope.selectedFrequency=frequency},$scope.$watch("selectedFrequency",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&($scope.frequency=$scope.showFrequencySelection&&$scope.selectedFrequency,$scope.load(!0))}),$scope.$watchGroup(["symbol","timespan"],function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&($scope.showFrequencySelection=$scope.showFrequency&&-1!==oneDayTimespanArray.indexOf(newVal[1]),$scope.showActiveMarketHoursToggler=$scope.showMarketActivity&&-1!==oneDayTimespanArray.concat(["OneWeek"]).indexOf(newVal[1]),$scope.marketHoursOnly=$scope.showActiveMarketHoursToggler,$scope.showAfterMarketActivity=!$scope.showActiveMarketHoursToggler,$scope.frequency=$scope.showFrequencySelection&&$scope.selectedFrequency,$scope.load())}),$scope.$watch("symbol",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&$scope.showPriceInfo&&($scope.priceInfoText=null)}),$scope.$watch("showAfterMarketActivity",function(newVal,oldVal){null!==newVal&&""!==newVal&&oldVal!==newVal&&($scope.marketHoursOnly=!newVal,$scope.load())}),this.setTimespan=function(timespan){$scope.$applyAsync(function(){$scope.timespan=timespan})},this.setSymbol=function(symbol){$scope.$applyAsync(function(){$scope.symbol=symbol})},widget.attach($scope,$element);$scope.getOptions=function(){var numberFilter=$filter("sviNumber"),options={chart:{renderTo:$element.find(".chart")[0],marginTop:15,marginLeft:5,marginRight:5,spacingTop:45,spacingBottom:40,reflow:!0,events:{render:function(evt){$timeout(function(){!function(evt){if(!evt.target.rangeSelector||!$scope.chart||!$scope.chart.rangeSelector)return;var spaceAfterRangeButtons=evt.target.rangeSelector.chart.chartWidth-evt.target.rangeSelector.initialButtonGroupWidth;if(spaceAfterRangeButtons<35&&0<=spaceAfterRangeButtons&&($scope.chart.rangeSelector.options.buttonPosition.x=35,$scope.chart.rangeSelector.render(),evt.target.rangeSelector.collapseButtons(0)),$scope.chart.rangeDropdownLabel&&($scope.chart.rangeDropdownLabel.destroy(),$scope.chart.rangeDropdownLabel=undefined,0!==$scope.chart.rangeSelector.options.buttonPosition.x&&35<=spaceAfterRangeButtons&&($scope.chart.rangeSelector.options.buttonPosition.x=0,$scope.chart.rangeSelector.render())),evt.target.rangeSelector.hasVisibleDropdown&&($element.find(".chart  div  select option:contains('"+$scope.chart.options.lang.rangeSelectorZoom+"')").css({display:"none"}),0===$scope.chart.rangeSelector.options.buttonPosition.x&&($scope.chart.rangeSelector.options.buttonPosition.x=35,$scope.chart.rangeSelector.render()),$scope.chart.rangeDropdownLabel=$scope.chart.renderer.g().add(),$scope.chart.renderer.text('<span style="font-size:12px; color: #666666">'+$scope.chart.options.lang.rangeSelectorZoom+"</span>",0,evt.target.rangeSelector.dropdown.offsetTop+15).add($scope.chart.rangeDropdownLabel)),$scope.showPriceInfo&&$scope.priceInfoText&&!$scope.chart.priceInfoText){$scope.chart.priceInfoText=$scope.chart.renderer.g().add();var dayChangeFeatureText='<span style="font-size:15px; font-weight: bold">'+$scope.symbol+"</span>";$scope.chart.renderer.text(dayChangeFeatureText,10,11).add($scope.chart.priceInfoText)}$scope.chart.rangeSelector.initialButtonGroupWidth&&$scope.originalRangeButtonsWidth&&($scope.chart.rangeSelector.initialButtonGroupWidth=$scope.originalRangeButtonsWidth,$scope.originalRangeButtonsWidth=null)}(evt)},50)},load:function(){$timeout(function(){$scope.chart&&$scope.chart.reflow()},400)},click:function(){0!==Object.keys(this.pane[0].chart).length&&$scope.chart.pointer.drop()}}},title:{text:" "},accessibility:{landmarkVerbosity:"disabled",description:"Chart showing historical values for the selected symbol."},credits:{enabled:!1},scrollbar:{enabled:!1},navigator:{enabled:$scope.showNavigator},rangeSelector:{enabled:$scope.showRangeButtons,allButtonsEnabled:!0,selected:$scope.investmentType===TYPE_FUND?highcharts.getSelectedTimespanIndex(mutualFundRangeButtons,$scope.timespan):highcharts.getSelectedTimespanIndex(rangeButtons,$scope.timespan),buttons:$scope.investmentType===TYPE_FUND?mutualFundRangeButtons:rangeButtons,inputEnabled:!1,verticalAlign:"bottom",buttonTheme:highcharts.getRangeSelectorButtonsStyle()},navigation:{buttonOptions:{align:"right",verticalAlign:"bottom",y:34}},tooltip:{xDateFormat:"Today"===$scope.timespan?"%I:%M %p":"%b %d, %Y",pointFormatter:function(){return"Volume"===this.series.name?this.series.name+": <b>"+numberFilter(this.y,0,2,!1)+"</b>":"<b>"+numberFilter(this.y,2,2,!1)+"</b>"},crosshairs:{dashStyle:"dash"},split:$scope.showVolume&&$scope.investmentType!==TYPE_FUND&&$scope.securityType!==TYPE_FUND},xAxis:{type:"datetime",dateTimeLabelFormats:{hour:"%I:%M %p",second:"%I:%M:%S %p",millisecond:"%I:%M:%S.%L %p"},events:{setExtremes:function(evt){if($scope.chart.rangeSelector.hasVisibleDropdown&&$scope.chart.rangeSelector.initialButtonGroupWidth&&!$scope.originalRangeButtonsWidth&&$scope.chart.containerWidth>$scope.chart.rangeSelector.initialButtonGroupWidth&&($scope.originalRangeButtonsWidth=$scope.chart.rangeSelector.initialButtonGroupWidth,$scope.chart.rangeSelector.initialButtonGroupWidth+=$scope.rangeSelectorShift),angular.isDefined(evt.rangeSelectorButton))return $scope.api.setTimespan(evt.rangeSelectorButton.filter),!1}}},yAxis:[{labels:{formatter:function(){return numberFilter(this.value)},style:{color:$scope.yAxisFontColor}},floor:0}],responsive:{rules:[{condition:{maxWidth:400}}]},series:[{id:"price",name:"Price",data:[],tooltip:{valueDecimals:2},type:"area",threshold:null,color:$scope.chartColorBegin,lineColor:$scope.lineColor,lineWidth:$scope.lineWidth,fillColor:{linearGradient:[0,0,0,500],stops:[[0,$scope.chartColorBegin],[1,new Highcharts.Color($scope.chartColorEnd).setOpacity(0).get("rgba")]]}}]};return $scope.showVolume&&$scope.investmentType!==TYPE_FUND&&$scope.securityType!==TYPE_FUND&&(options.yAxis[0].height="80%",options.yAxis.push({labels:{enabled:!1},height:"15%",top:"85%",floor:0}),options.series.push({type:"column",name:"Volume",data:[],yAxis:1})),options},$scope.priceInfoLoader=null,$scope.getPriceInfoLoader=function(loader){$scope.priceInfoLoader=loader},this.getOneDayPriceInfo=function(){piwik.trackEvent("GetOneDayPriceInfo","Get Price Info",$scope.symbol),!$scope.priceInfoText&&$scope.showPriceInfo&&($scope.priceInfoLoader?$scope.priceInfoLoader.setLoadHandler(getOneDayPriceInfoCallback).load(!0).then(oneDayPriceInfoSuccess,onError):$timeout($scope.api.getOneDayPriceInfo,200))},$timeout(function(){$scope.priceInfoText,0},APP_CONFIG.autoLoadDelay);var getOneDayPriceInfoCallback=function(invalidateCache){return symbol.getPriceHistory($scope.symbol,"TodayOrYesterdayOrLastWeek",null,!0,invalidateCache)},oneDayPriceInfoSuccess=function(data){piwik.trackDataLoad($scope,data),data.symbolHistory.quotes&&data.symbolHistory.instrument&&data.symbolHistory.instrument.securityType!==$scope.mutualFundSecurityType&&showPriceInfo(data.symbolHistory.quotes),$scope.api.scheduleReload(6e4)};this.scheduleReload=function(delay){null!=$scope.reloadTimeout&&$timeout.cancel($scope.reloadTimeout),$scope.reloadTimeout=$timeout(function(){$scope.priceInfoText=null,$scope.api.getOneDayPriceInfo()},delay)},$scope.ignoreEvents||eventDispatcher.on($scope.eventName,function(e,data){data.hasOwnProperty("symbol")&&$scope.symbol!==data.symbol&&($scope.symbol=data.symbol),data.hasOwnProperty("securityType")&&($scope.securityType=data.securityType),data.hasOwnProperty("investmentType")?($scope.investmentType=data.investmentType,data.underlying&&"Option"===data.investmentType?($scope.symbol=data.underlying,$scope.showDisclaimer=!0):data.hasOwnProperty("investmentType")&&data.investmentType===TYPE_FUND?($scope.showDisclaimer=!1,"Today"!==$scope.timespan&&"OneDay"!==$scope.timespan&&"TodayOrYesterday"!==$scope.timespan&&"Yesterday"!==$scope.timespan&&"TodayOrYesterdayOrLastWeek"!==$scope.timespan||($scope.timespan="ThreeMonth")):$scope.showDisclaimer=!1):($scope.showDisclaimer=!1,$scope.investmentType="Stock")})}],link:function($scope,$element,$attrs){var template=$templateCache.get("priceHistoryChart/priceHistory"+$scope.template+".tpl.html");$element.html(template).show(),$compile($element.contents())($scope),$timeout(function(){$scope.chartColorBegin=$attrs.chartColorBegin,$scope.useGradient=$attrs.useGradient,$scope.yAxisFontColor=$attrs.yAxisFontColor,""!==$scope.symbol&&$scope.load(),$scope.parentTabSelector&&angular.element($scope.parentTabSelector).on("shown.bs.tab",function(){$scope.chart&&$scope.chart.reflow()})},APP_CONFIG.autoLoadDelay)}}}]),angular.module("svi.symbol").directive("sviSnapQuote",["$templateCache","labels","$popover","$tooltip","$timeout","eventDispatcher","piwik",function($templateCache,labels,$popover,$tooltip,$timeout,eventDispatcher,piwik){return{replace:!1,scope:{symbol:"@",symbolLookup:"@",osi:"@",placement:"@"},template:$templateCache.get("snapQuote/snapQuote.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultFalse($scope,$attrs,"symbolLookup"),svi.ng.defaultFalse($scope,$attrs,"osi"),svi.ng.defaultString($scope,$attrs,"placement","top")}catch(e){throw"sviSnapQuote: "+e}$scope.inputSymbolComm={},$scope.stealFocus=!1,$scope.ariaMessage="",$scope.id=php.uniqid("snapquote"),labels.setupLabels($scope,["general","snapQuote"],{snapQuoteLabel:"Get a Quote",snapQuotePlaceholder:"Enter Symbol"}).then(function(){$scope.inputSymbolComm.placeholder=$scope.labels.snapQuotePlaceholder,$scope.inputSymbolComm.arialabel=$scope.labels.snapQuoteLabel});var getQuoteCtrl=svi.ng.getControllerFactory($element,$scope,"svi-detailed-quote"),getInputCtrl=svi.ng.getControllerFactory($element,$scope,"svi-input-symbol");this.setSymbol=function(symbol){return $scope.$applyAsync('symbol = "'+symbol+'"'),this},this.getSymbol=function(){return $scope.symbol},this.showQuote=function(){$scope.api.getPopover().$promise.then(function(){piwik.trackPage("snapQuote","Snap Quote",!1,[{name:"symbol",value:$scope.symbol}]),$scope.popover.show();var ctrl=getQuoteCtrl(!0);ctrl&&ctrl.setSymbol($scope.symbol),$scope.stealFocus&&($scope.stealFocus=!1,$timeout(function(){$scope.popover.$element.find(".aria-quote-target").focus()},1e3))})};var invalidTooltip=null;this.showInvalidTooltip=function(){var msg=$scope.labels.snapQuoteInvalidSymbol;if(-1!=$scope.symbol.search(/^[a-z]+[0-9]? c?p?/i)&&(msg=$scope.labels.snapQuoteInvalidOption),!invalidTooltip){var options={placement:"right",trigger:"manual",autoClose:!0,type:"danger",title:msg},navEl=$element.parents(".nav").first();navEl&&(options.container=navEl),invalidTooltip=$tooltip($element,options)}invalidTooltip.$scope.title=msg,invalidTooltip.$promise.then(invalidTooltip.show),$scope.ariaMessage=msg},this.hideInvalidTooltip=function(){invalidTooltip&&invalidTooltip.$promise.then(invalidTooltip.hide),$scope.ariaMessage=""},this.hideQuote=function(){$scope.api.getPopover().$promise.then($scope.popover.hide)},$scope.popover=null,this.getPopover=function(){if($scope.popover)$scope.popover.$scope.title=$scope.symbol;else{var el=$element.find(".svi-snap-quote");$scope.popover=$popover(el,{container:$element.parents(".svi-dock").length?".svi-dock":".svi-bs",placement:$scope.placement,target:el,trigger:"manual",autoClose:!1,title:$scope.symbol,templateUrl:"snapQuote/popover.tpl.html",id:$scope.id+"-popover",parentId:$scope.id}),$scope.popover.$scope.id=$scope.id+"-popover",$scope.popover.$scope.parentId=$scope.id,$scope.popover.$scope.title=$scope.symbol,$scope.popover.$scope.api=$scope.api,$scope.popover.$scope.labels=$scope.labels}return $scope.popover},this.go=function(){$scope.stealFocus=!0,$scope.api.validateInput()},this.validateInput=$.debounce(1e3,function(newVar,oldVar){if(!(angular.isUndefined($scope.symbol)||angular.isDefined(newVar)&&newVar===oldVar))if(""!==$scope.symbol){var ctrl=getInputCtrl();!ctrl||ctrl.isValid()?($scope.api.hideInvalidTooltip(),$scope.api.showQuote()):($scope.api.hideQuote(),$scope.api.showInvalidTooltip())}else $scope.api.hideQuote(),$scope.api.hideInvalidTooltip()}),$scope.api=this,eventDispatcher.on("POPOVER.HIDE",function(e,data){angular.isString(data)&&$scope.popover&&($scope.popover.$scope.id===data||"ALL"===data)&&$scope.api.hideQuote()}),eventDispatcher.on("GET.SNAP.QUOTE.POPOVER",function(){$scope.api.validateInput()})}]}}]),angular.module("directives").directive("sviSparklineChart",["APP_CONFIG","$templateCache","$timeout","loader","highcharts","piwik","symbol","labels",function(APP_CONFIG,$templateCache,$timeout,loader,highcharts,piwik,symbol,labels){return{replace:!1,scope:{symbol:"@",symbolFormat:"@"},template:$templateCache.get("sparklineChart/sparklineChart.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.api=this,$scope.chart=null,$scope.values=[],this.name="sparklineChart",this.friendlyName="Sparkline chart";try{svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultValidString($scope,$attrs,"symbolFormat",["ticker","ric"],"ticker")}catch(e){throw"sviSparklineChart: "+e}labels.setupLabels($scope,["general"]),$scope.getOptions=function(){return{chart:{type:"area",renderTo:$element.find(".sparkline-chart")[0],height:$element.find(".sparkline-chart").height()||30,backgroundColor:null,marginBottom:0,marginTop:0,style:{overflow:"visible"}},title:{text:""},credits:{enabled:!1},exporting:{enabled:!1},accessibility:{landmarkVerbosity:"disabled",description:"This chart illustrates the index performance during the most recent session."},xAxis:{labels:{enabled:!1},title:null,tickLength:0},yAxis:{labels:{enabled:!1},plotLines:[{color:APP_CONFIG.chartColors.sparkline[0],width:1,value:0}],title:null,gridLineWidth:0},legend:{enabled:!1},tooltip:{enabled:!1},plotOptions:{series:{lineWidth:1,fillOpacity:.25,states:{hover:{enabled:!1}},marker:{enabled:!1},color:APP_CONFIG.chartColors.sparkline[1],negativeColor:APP_CONFIG.chartColors.sparkline[2]}},series:[{data:[]}]}};loader.attach($scope,$element,function(invalidateCache){return symbol.getPriceHistory($scope.symbol,"TodayOrYesterday",$scope.symbolFormat,!0,invalidateCache)},function(data){piwik.trackPage($scope,data);var options=$.extend(!0,{},$scope.getOptions()),seriesData=function(data){return data.map(function(quote,index){return $scope.values.push(quote.change),{x:moment(quote.quoteTime).valueOf(),y:quote.change,marker:index===data.length-1?{enabled:!0,radius:2}:0}})}(data.symbolHistory.quotes);options.series[0].data=seriesData,options.yAxis.min=0<Math.min.apply(this,$scope.values)?-5:Math.min.apply(this,$scope.values)-5,options.yAxis.max=0<Math.max.apply(this,$scope.values)?Math.max.apply(this,$scope.values)+5:5;var lastPoint=seriesData[seriesData.length-1].x,firstPointPlus8Hr=options.xAxis.max=seriesData[0].x+288e5;options.xAxis.max=Math.max(lastPoint,firstPointPlus8Hr),$scope.chart&&$scope.chart.destroy(),$scope.chart=highcharts.getChart(options)},function(reason){var name=$scope.api.name||"unknown",friendlyName=$scope.api.friendlyName||name;piwik.trackPage(name+"/error","Error: "+friendlyName,!1),$scope.chart&&$scope.chart.destroy(),$scope.loader.clearAllMessages().setWarning($scope.labels.chartNoDataShort)}),$scope.api.isReadyToLoad=function(){return!(null===$scope.symbol||!1===$scope.symbol||""===$scope.symbol)},$timeout(function(){""!==$scope.symbol&&null!==$scope.symbol&&null===$scope.chart&&$scope.api.load()},APP_CONFIG.autoLoadDelay)}]}}]),angular.module("directives").directive("sviSymbolHoldings",["$templateRequest","APP_CONFIG","widget","$compile","eventDispatcher","$timeout","accountList","labels","holdings","piwik","$log",function($templateRequest,APP_CONFIG,widget,$compile,eventDispatcher,$timeout,accountList,labels,holdings,piwik,$log){return{replace:!1,scope:{useParentData:"@",accounts:"=?",columns:"@",columnPriority:"@",responsiveColumns:"@",symbol:"@",eventName:"@",showAcctType:"@",showTitle:"@",template:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$attrs.hasOwnProperty("accounts")||($scope.accounts=$attrs.accounts=[accountList.getCurrentAccountIndex()]),$scope._symbol=$attrs.symbol,$scope.api=this,svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultTrue($scope,$attrs,"showAcctType"),svi.ng.defaultTrue($scope,$attrs,"showTitle"),svi.ng.defaultString($scope,$attrs,"columns",'["symbol", "accountType", "qty", "marketValueChange", "marketValue"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["symbol", "accountType", "qty", "marketValueChange", "marketValue"]'),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns");try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.error("sviSymbolHoldings: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviSymbolHoldings: Error parsing columnPriority: ",e,$attrs.columnPriority)}$scope.loaded=!1,svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultValidString($scope,$attrs,"template",["Widget",""],""),labels.setupLabels($scope,["general","holdings","symbolHoldings"],{}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.symbol=$scope._symbol?$scope._symbol:$scope.$parent.symbol,""!==$scope.symbol&&null!==$scope.symbol&&!1!==$scope.symbol&&$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){if(!0===$scope.useParentData||"true"===$scope.useParentData)return $scope.$parent.loadCallback();var query={filterField:["instrument.symbol"],filterValue:[angular.isArray($scope.symbol)?$scope.symbol:[$scope.symbol]],includeHeldAway:"All",columns:JSON.stringify($scope.columns)};return"Option"==$scope.$parent.investmentType&&(delete query.filterField,delete query.filterValue),holdings.getHoldings($scope.accounts[0],query)},onSuccess=function(response){piwik.trackPage("symbolHoldings","Symbol Holdings",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1},{name:"symbol",value:$scope.symbol}]),$scope.positions=holdings.filterBySymbol($scope.symbol,response.holdings.positions),0===$scope.positions.length?($scope.loader.setWarning($scope.labels.noDataSymbol),$scope.loaded=!1):$scope.loaded=!0},onError=function(response){"A new load request canceled this one."!=response.message&&(piwik.trackPage("symbolHoldings/error","Error: Symbol Holdings",!1,[{name:"numAccounts",index:1,value:angular.isArray($scope.account)?$scope.account.length:1},{name:"symbol",value:$scope.symbol}]),$scope.loader.setError($scope.labels.dataRenderError))};$scope.$watch("accounts",function(newVal,oldVal){null!==newVal&&newVal!=oldVal&&0<$scope.accounts.length&&($scope.loaded=!1,$scope.load())},!0),$scope.$watch("_symbol",function(newVal,oldVal){null!==newVal&&newVal!=oldVal&&($scope.loaded=!1,$scope.load())}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data.currentAccount&&$scope.accounts!=data.currentAccount&&($scope.accounts=data.currentAccount)}),eventDispatcher.on($scope.eventName,function(e,data){if(data.hasOwnProperty("symbolList")&&angular.isArray(data.symbolList)&&0<data.symbolList.length)$scope._symbol=data.symbolList;else{if(!data.symbol||$scope._symbol==data.symbol)return;$scope._symbol=data.symbol}}),$scope.responsiveColumnsSettings={enabled:!0,priority:$scope.columnPriority,formatters:{qty:"sviNumber:3",marketValueChange:"currencyChange",marketValue:"sviCurrency"},breakpoints:{xs:3,sm:3,md:4}}}],link:function($scope,$element,$attrs){var config={columns:$scope.columns},tplPath="symbol/symbolHoldings/symbolHoldings"+$scope.template+".tpl.phtml";"Widget"===$scope.template&&widget.attach($scope,$element),$templateRequest(tplPath,config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)}),$timeout(function(){$scope._symbol=$attrs.symbol,$scope.load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviSymbolLookup",["$templateCache","labels","eventDispatcher","$popover",function($templateCache,labels,eventDispatcher,$popover){return{replace:!1,scope:{name:"@",value:"@",minLength:"@",inputCls:"@",debounceDelay:"@",placement:"@",id:"@"},require:"?ngModel",template:$templateCache.get("symbolLookup/symbolLookup.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"name","symbol-lookup"),svi.ng.defaultString($scope,$attrs,"value",""),svi.ng.defaultInt($scope,$attrs,"minLength",3,null,2),svi.ng.defaultString($scope,$attrs,"inputCls","form-control"),svi.ng.defaultInt($scope,$attrs,"debounceDelay",1e3),svi.ng.defaultValidString($scope,$attrs,"placement",["top","bottom"],"top"),svi.ng.defaultString($scope,$attrs,"id",php.uniqid("symbolLookup"))}catch(e){throw"sviSymbolLookup: "+e}labels.setupLabels($scope,["general"],{}),this.getId=function(){return $scope.id},this.getValue=function(){return $scope.value},this.setValue=function(value){return $scope.value=value,this},$scope.selectedSymbol=null,this.getSelectedSymbol=function(){return $scope.selectedSymbol},this.setSelectedSymbol=function(value){return $scope.selectedSymbol=value,this},this.isValid=function(value){return!0},this.search=$.debounce($scope.debounceDelay,function(){angular.isString($scope.value)&&$scope.value.length?$scope.api.showSearch():$scope.api.hideSearch()}),$scope.$watch("value",function(newValue,oldValue){newValue!==oldValue&&$scope.api.search()});var getGridCtrl=svi.ng.getControllerFactory(".svi-symbol-lookup-popover",$scope,"svi-symbol-lookup-grid");$scope.popoverId=$scope.id+"-popover",$scope.popover=null,this.getPopover=function(){if($scope.popover)$scope.popover.$scope.title=$scope.value;else{var el=$element.find("input");$scope.popover=$popover(el,{container:$element.parents(".svi-dock").length?".svi-dock":".svi-bs",placement:$scope.placement,target:el,trigger:"manual",autoClose:!1,title:$scope.value,templateUrl:"symbolLookup/popover.tpl.html",id:$scope.popoverId,parentId:$scope.id}),$scope.popover.$scope.id=$scope.popoverId,$scope.popover.$scope.parentId=$scope.id,$scope.popover.$scope.api=$scope.api}return $scope.popover},this.showSearch=function(){return $scope.api.getPopover().$promise.then(function(){$scope.popover.show();var ctrl=getGridCtrl(!0);ctrl&&ctrl.setSearch($scope.value)}),this},this.hideSearch=function(){return $scope.api.getPopover().$promise.then($scope.popover.hide),this},$scope.api=this,eventDispatcher.on("SYMBOL_LOOKUP.SYMBOL.SELECTED",function(evt,data){if(!(angular.isObject(data)&&data.hasOwnProperty("id")&&data.id==$scope.popoverId&&data.hasOwnProperty("symbol")&&angular.isString(data.symbol)))return!1;$scope.selectedSymbol=data.symbol,$scope.api.hideSearch()},!1)}],link:function($scope,$element,$attrs,modelCtrl){$scope.$watch("selectedSymbol",function(newValue,oldValue){newValue!==oldValue&&null!==newValue&&modelCtrl&&(modelCtrl.$setViewValue(newValue,"symbol_lookup_selection"),$scope.selectedSymbol=null)})}}}]),angular.module("directives").directive("sviSymbolLookupGrid",["$templateCache","$timeout","eventDispatcher","labels","symbol","piwik",function($templateCache,$timeout,eventDispatcher,labels,symbol,piwik){return{replace:!1,scope:{search:"@",id:"@",pageSize:"@",showPaging:"@"},template:$templateCache.get("symbolLookupGrid/symbolLookupGrid.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"search",""),svi.ng.defaultString($scope,$attrs,"id",php.uniqid("symolLookupGrid")),svi.ng.defaultInt($scope,$attrs,"pageSize",10),svi.ng.defaultTrue($scope,$attrs,"showPaging")}catch(e){throw"sviSymbolLookupGrid: "+e}$scope.currentPage=0,$scope.pageSize&&($scope.currentPage=1),$scope.totalPages=0,labels.setupLabels($scope,["general"],{}),$scope.initComplete=!1,$scope.symbols=!1,$scope.ariaMsg="",$scope.getLoadParameters=function(){var data={search:$scope.search};return $scope.pageSize&&(data.limit=$scope.pageSize,data.start=($scope.currentPage-1)*$scope.pageSize),data},$scope.setLoader=function(loader){$scope.loader=loader},this.load=function(invalidateCache){if($scope.initComplete){if(angular.isUndefined(invalidateCache)&&(invalidateCache=!1),!$scope.loader)return $timeout($scope.api.load,200);!angular.isString($scope.search)||$scope.search.length<1||$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError)}};var loadCallback=function(invalidateCache){var data=$scope.getLoadParameters();return symbol.lookup(data,invalidateCache)},onSuccess=function(response){piwik.trackPage("symbolLookupGrid","Symbol Lookup Grid",1e3*response._loaderMetadata.elapsedTime,[{name:"search",value:$scope.search}]),$scope.symbols=response.results,$scope.symbols&&$scope.symbols.length&&response.totalResults?($scope.totalPages=Math.ceil(response.totalResults/$scope.pageSize),$timeout(function(){$scope.ariaMsg=$scope.labels.symbolLookupResultsMessage,svi.ui.pulse(".svi-symbol-lookup-grid-table, .svi-symbol-lookup-grid-table tr")})):($scope.totalPages=0,$scope.loader.setWarning($scope.labels.noSymbolsFound))},onError=function(reason){piwik.trackPage("symbolLookupGrid/error","Error: Symbol Lookup Grid",!1,[{name:"search",value:$scope.search}]),$scope.ariaMsg="Error while loading Symbol Lookup Grid"};$scope.$watch("search",function(newVal,oldVal){newVal!==oldVal&&angular.isString(newVal)&&0<newVal.length&&$scope.api.load()}),$scope.$watch("currentPage",function(newVal,oldVal){newVal!==oldVal&&$scope.api.load()}),this.setSearch=function(search){return $scope.$applyAsync(function(){$scope.search=search}),this},this.getSearch=function(){return $scope.search},this.selectSymbol=function(symbol){$(".svi-bs > .tooltip").remove(),eventDispatcher.trigger("SYMBOL_LOOKUP.SYMBOL.SELECTED",{id:$scope.id,symbol:symbol})},$scope.api=this,$timeout(function(){$scope.initComplete=!0,$scope.symbols||$scope.api.load()},400),eventDispatcher.on("SYMBOL_LOOKUP.SEARCH.CHANGED",function(e,data){angular.isString(data)&&0<data.length&&($scope.search=data)},!1),eventDispatcher.on("SYMBOL_LOOKUP.PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.currentPage=data)},!0),eventDispatcher.on("SYMBOL_LOOKUP.REFRESH",function(){$scope.api.load(!0)})}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviSymbolNews",["APP_CONFIG","$templateCache","$compile","eventDispatcher","$timeout","$log","labels","symbol","exchange","piwik","$modal","widget","$document",function(APP_CONFIG,$templateCache,$compile,eventDispatcher,$timeout,$log,labels,symbol,exchange,piwik,$modal,widget,$document){return{replace:!1,scope:{symbol:"@",eventName:"@",useModal:"@",allowOverall:"@",showTitle:"@",showSymbol:"@",limit:"@",limitDisplay:"@",title:"@",template:"@",showSourceFilter:"@",newsType:"@",eventId:"@",showOnlyNewsText:"@",eventToShowOnlyNewsText:"@",newsTypes:"="},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){($scope.api=this).name="symbolNews",this.friendlyName="Symbol News",$scope.showOnlyNewsTextFlag=!1,$scope.storyHtmlNewsParts=[],$scope.prevNewsStoryIndex=!1,$scope.nextNewsStoryIndex=!1,$scope.newsStoryLimit=2500,$scope.newsId=php.uniqid("news"),svi.ng.defaultValidString($scope,$attrs,"template",["","Widget","TwoColumns"],""),svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultFalse($scope,$attrs,"useModal"),svi.ng.defaultFalse($scope,$attrs,"allowOverall"),svi.ng.defaultTrue($scope,$attrs,"showTitle"),svi.ng.defaultString($scope,$attrs,"eventId","SYMBOL"),svi.ng.defaultFalse($scope,$attrs,"showOnlyNewsText"),svi.ng.defaultString($scope,$attrs,"eventToShowOnlyNewsText",""),svi.ng.defaultTrue($scope,$attrs,"showSymbol"),svi.ng.defaultInt($scope,$attrs,"limit",0,null,0),svi.ng.defaultInt($scope,$attrs,"limitDisplay",0,15,0),svi.ng.defaultFalse($scope,$attrs,"showSourceFilter"),svi.ng.defaultValidString($scope,$attrs,"newsType",["Headlines","PressReleases","FrontPage","USCompanies","All"],""),$scope.id=$scope.symbol?php.uniqid($scope.newsType):php.uniqid("news"),$scope.newsItems=null,$scope.showMore=!1,$scope.describShowMoreLess="",$scope.modal=null,$scope.modalScope=null,$scope.maxSize="125",$scope.horizontal=!1,$scope.symbol||($scope.reservedNewsType=["Headlines","PressReleases"]),svi.ng.defaultString($scope,$attrs,"title",""),$scope.useModal&&($scope.showOnlyNewsText=!1),$scope.showOnlyNewsText&&($scope.maxSize="600");var getTabCtrl=svi.ng.getControllerFactory($element,$scope,"svi-tabs");labels.setupLabels($scope,["general","loader","symbolNews"],{}).then(function(){""===$scope.title&&($scope.symbol?$scope.title=$scope.labels.symbolNewsTitle:$scope.title="TwoColumns"===$scope.template?$scope.labels.globalNews:$scope.labels.marketOverviewTitle);var tabs=getTabCtrl();tabs&&$timeout(tabs.updateTabs)}),"Widget"==$scope.template&&(widget.attach($scope,$element),$scope.$watch("showMore",function(){$scope.api.widgetResize()})),$scope.hasSymbol=function(){return!(""===$scope.symbol||null===$scope.symbol||!1===$scope.symbol)},$scope.api.setLoader=function(loader){$scope.loader=loader},$scope.api.load=function(){if(!$scope.loader)return $timeout($scope.api.load,200);$scope.newsItems=null,($scope.allowOverall||$scope.hasSymbol())&&$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return $scope.newsItems=null,$scope.hasSymbol()?symbol.getNews($scope.symbol,$scope.limit,1,$scope.newsType):exchange.getNews($scope.limit,null,$scope.newsType)},onSuccess=function(response){if(!response.success||!response.news.newsItems.length)return $scope.loader.setWarning($scope.labels.symbolNewsNoDataError),void callNewsLoadedEvent();piwik.trackPage("symbolNews","Symbol News",1e3*response._loaderMetadata.elapsedTime,[{name:"symbol",value:$scope.symbol}]),$scope.newsItems=response.news.newsItems,callNewsLoadedEvent(),$scope.stories=[],eventDispatcher.trigger("RESIZE",{source:"symbolNews"})},onError=function(response){$scope.newsItems=null,callNewsLoadedEvent(),piwik.trackPage("symbolNews/error","Error: Symbol News",!1,[{name:"symbol",value:$scope.symbol}]),response.hasOwnProperty("shouldShowError")&&!response.shouldShowError||($scope.loader.setWarning(!1),$scope.loader.setError($scope.labels.dataRenderError)),$scope.showOnlyNewsText&&($scope.showLoader=!1)},callNewsLoadedEvent=function(){eventDispatcher.trigger($scope.eventId+".NEWS.LOADED",{newsExists:$scope.newsItems&&$scope.newsItems.length})};$scope.fetchStory=function(storyId){return $scope.hasSymbol()?symbol.getNewsStory($scope.symbol,storyId).then(processStory,onError):exchange.getNewsStory(storyId).then(processStory,onError)};var processStory=function(data){for(var storyId,response=data;angular.isObject(response)&&response.hasOwnProperty("data");)response=response.data;if(response.success&&response.newsStory.newsItems.length){storyId=response.newsStory.newsItems[0].storyID;var storyHtml=response.newsStory.newsItems[0].story;if(storyHtml+='<style type="text/css">body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size: 15px}</style>',$scope.showOnlyNewsText)eventDispatcher.trigger("SET.NEWS.STORY.TEXT."+$scope.newsId,{storyHtml:storyHtml});else{var target="#"+$scope.id+"-story-"+storyId,addStory=function(){var el=$(target);if(el){var iframe=document.createElement("iframe");return el.html(iframe),iframe.contentWindow.document.open(),iframe.contentWindow.document.write(storyHtml),iframe.contentWindow.document.close(),!0}return $timeout(addStory,200),!1};if($scope.useModal&&$scope.modal)target="#"+$scope.id+"-story",$scope.modal.$promise.then(function(){$scope.modalScope.showLoader=!1;try{$timeout(addStory)}catch(e){$log.warn(e),$scope.loader.setWarning(!1),$scope.loader.setError($scope.labels.dataRenderError),$scope.modal.hide()}});else try{addStory()}catch(e){$log.warn(e),$scope.loader.setWarning(!1),$scope.loader.setError($scope.labels.dataRenderError)}}}else if($scope.loader.setWarning(!1),$scope.loader.setError($scope.labels.dataRenderError),$scope.useModal&&$scope.modal)$timeout(function(){$element.parents().find(".close-modal").click()},1e3);else try{storyId=response.storyId,$("#"+$scope.id+"-story-"+storyId).empty()}catch(e){}};$scope.returnToNewsList=function(){eventDispatcher.trigger("NEWS.HIDE.FULL.TEXT."+$scope.newsId)},$scope.displayOnlyText=function(storyId,headline,dateTime){$scope.showOnlyNewsText&&eventDispatcher.trigger("NEWS.SHOW.FULL.TEXT."+$scope.newsId,{storyId:storyId,headline:headline,dateTime:dateTime})};var chunkNewsStoryByLimit=function(html){for(var nodes=[],key=0,tmpDiff=0,innerText="",sum=0,i=0;i<html.children.length;i++)innerText=html.children[i].innerText,tmpDiff=nodes[key]?sum/$scope.newsStoryLimit:0,nodes[key=parseInt(tmpDiff)]===undefined&&(nodes[key]=[]),nodes[key].push(html.children[i]),sum+=innerText.length;var div="";$scope.storyHtmlNewsParts=[],nodes.map(function(nodeItem,j){div=document.createElement("div"),nodeItem.map(function(node){div.append(node)}),$scope.storyHtmlNewsParts.push(div.outerHTML)})};$scope.showNextNewsPart=function(index){if(index!==undefined){$scope.nextNewsStoryIndex=!!$scope.storyHtmlNewsParts[index+1]&&index+1,$scope.prevNewsStoryIndex=index-1,$scope.storyHtml=$scope.storyHtmlNewsParts[index];var scrollTopOffset=200;window.screen.width<=991&&(scrollTopOffset=500),$document.find("#svi-holding-zoom-modal .modal-body").animate({scrollTop:scrollTopOffset},"slow")}},$scope.showPrevNewsPart=function(index){index!==undefined&&($scope.prevNewsStoryIndex=!(!$scope.storyHtmlNewsParts[index-1]||0===index)&&index-1,$scope.nextNewsStoryIndex=index+1,$scope.storyHtml=$scope.storyHtmlNewsParts[index])},eventDispatcher.on("NEWS.SHOW.FULL.TEXT."+$scope.newsId,function(e,data){$scope.showOnlyNewsTextFlag=!0,$scope.showLoader=!0,$scope.headline=data.headline?data.headline:"",$scope.dateTime=data.dateTime?data.dateTime:"",$scope.eventToShowOnlyNewsText&&$scope.fetchStory(data.storyId)}),eventDispatcher.on("NEWS.HIDE.FULL.TEXT."+$scope.newsId,function(){$scope.showOnlyNewsTextFlag=!1,$scope.storyHtml="",$scope.prevNewsStoryIndex=!1,$scope.nextNewsStoryIndex=!1,$scope.storyHtmlNewsParts=[]}),eventDispatcher.on("SET.NEWS.STORY.TEXT."+$scope.newsId,function(e,data){var storyHtml,html;data.storyHtml&&($scope.storyHtml=(storyHtml=data.storyHtml,(html=document.createElement("div")).innerHTML=storyHtml,angular.element(html).find("title").remove(),html.innerText&&html.innerText.length>$scope.newsStoryLimit&&chunkNewsStoryByLimit(html),html.outerHTML),$scope.storyHtmlNewsParts.length&&($scope.storyHtml=$scope.storyHtmlNewsParts[0],$scope.storyHtmlNewsParts[1]&&($scope.nextNewsStoryIndex=1)),$scope.showOnlyNewsTextFlag=!0,$scope.showLoader=!1)}),$scope.showMoreLess=function(){$scope.showMore=!$scope.showMore,$scope.showMore&&$timeout(function(){var links=$("div#accordion-"+$scope.id+" a.story-link");if(links){var target=links.get($scope.limitDisplay);target&&target.focus()}},100),$scope.describShowMoreLess=$scope.showMore?"Extra news headline is displayed":"Extra news headlines is hidden"},$scope.displayModal=function(storyId,title,dateTime,close){if($scope.modal){$scope.modalScope.dateTime=dateTime,$scope.modalScope.storyId=storyId,$scope.modalScope.title=title||"News Story",$scope.modalScope.close=close||"Close",$scope.modalScope.showLoader=!0;try{$("#"+$scope.id+"-story").empty()}catch(e){}$scope.modal.$promise.then($scope.modal.show)}else $scope.modalScope=$scope.$new(),$scope.modalScope.dateTime=dateTime,$scope.modalScope.id=$scope.id,$scope.modalScope.storyId=storyId,$scope.modalScope.title=title||"News Story",$scope.modalScope.close=close||"Close",$scope.modalScope.showLoader=!0,$scope.modal=$modal({scope:$scope.modalScope,templateUrl:"symbolNews/symbolNewsModal.tpl.html",container:".modals-section",backdrop:!1,animation:"",show:!0});$scope.fetchStory(storyId)},$scope.showSourceFilter||eventDispatcher.on($scope.eventName,function(e,data){if($scope.showOnlyNewsText&&eventDispatcher.trigger("NEWS.HIDE.FULL.TEXT."+$scope.newsId),data.hasOwnProperty("symbol")&&""!==data.symbol){if($scope.symbol==data.symbol)return;data.hasOwnProperty("underlying")&&null!==data.underlying||!data.hasOwnProperty("rootSymbol")||(data.underlying=data.rootSymbol),$scope.symbol=data.symbol,data.hasOwnProperty("investmentType")&&"Option"===data.investmentType&&($scope.symbol=data.underlying)}else if(data.hasOwnProperty("instrumentList")&&angular.isArray(data.instrumentList)){for(var instrument,symbolList=[],i=0,l=data.instrumentList.length;i<l;i++)(instrument=data.instrumentList[i]).hasOwnProperty("symbol")&&instrument.hasOwnProperty("investmentType")&&(instrument.hasOwnProperty("underlying")&&null!==instrument.underlying||!instrument.hasOwnProperty("rootSymbol")||(instrument.underlying=instrument.rootSymbol),"Option"===instrument.investmentType?""!==instrument.underlying&&null!==instrument.underlying&&symbolList.push(instrument.underlying):""!==instrument.symbol&&symbolList.push(instrument.symbol));$scope.symbol=symbolList.join(",")}else data.hasOwnProperty("symbolList")&&angular.isArray(data.symbolList)&&($scope.symbol=data.symbolList.join(","))},null,$element)}],link:function($scope,$element,$attrs){var template=$templateCache.get("symbolNews/symbolNews"+$scope.template+".tpl.html"),formTmpl=$templateCache.get("symbolNews/symbolNewsContent.tpl.html");$scope.horizontal="TwoColumns"===$scope.template,$element.html(template.replace("%NEWS_CONTENT%",formTmpl)),$compile($element.contents())($scope);var showNewsCallback=function(e,d){var storyId=(d&&d.id||e.target.id).replace($scope.id+"-panel-","");$("#"+$scope.id+"-story-"+storyId+" .loader").html()!==undefined&&$scope.fetchStory(storyId)};$timeout(function(){$scope.useModal||$scope.showOnlyNewsText||$($element.find("#accordion-"+$scope.id)).on("show.bs.collapse",showNewsCallback),$scope.showSourceFilter||($scope.$watch("symbol",function(){$scope.api.load()}),$scope.newsItems||$scope.api.load())},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviSymbolOrderStatus",["$templateCache","APP_CONFIG","eventDispatcher","$compile","$timeout","accountList","labels","orders","piwik","widget",function($templateCache,APP_CONFIG,eventDispatcher,$compile,$timeout,accountList,labels,orders,piwik,widget){return{replace:!1,scope:{useParentData:"@",accounts:"=?",symbol:"@",eventName:"@",showAcctType:"@",showTitle:"@",template:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$attrs.hasOwnProperty("accounts")||($scope.accounts=$attrs.accounts=[accountList.getCurrentAccountIndex()]),$scope._symbol=$attrs.symbol,$scope.api=this,svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultTrue($scope,$attrs,"showAcctType"),svi.ng.defaultTrue($scope,$attrs,"showTitle"),$scope.loaded=!1,svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultValidString($scope,$attrs,"template",["Widget",""],""),labels.setupLabels($scope,["general","symbolOrderStatus","orderStatus","orderStatusTypes"],{}),$scope.getDesc=function(order){var desc;switch(order.order.instrument.securityType.toLowerCase()){case"commonstock":case"mutualfund":case"fixedincome":desc=order.order.instrument.symbol;break;case"option":desc=order.order.instrument.desc}return desc},$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.symbol=$scope._symbol?$scope._symbol:$scope.$parent.symbol,""!==$scope.symbol&&null!==$scope.symbol&&!1!==$scope.symbol&&$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return!0===$scope.useParentData||"true"===$scope.useParentData?$scope.$parent.loadCallback():orders.getAccountOrders($scope.accounts[0])},onSuccess=function(response){if(!angular.isArray(response.orders.orderStatus))return $scope.loaded=!1,void $scope.loader.setError($scope.labels.dataRenderError);piwik.trackPage("symbolOrderStatus","Symbol Order Status",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1},{name:"symbol",value:$scope.symbol}]),$scope.loaded=!0,$scope.orders=orders.filterBySymbol($scope._symbol,response.orders.orderStatus),0===$scope.orders.length&&($scope.loader.setWarning($scope.labels.noOrdersForSymbol),$scope.loaded=!1)},onError=function(response){"A new load request canceled this one."!=response.message&&(piwik.trackPage("symbolOrderStatus/error","Error: Symbol Order Status",!1,[{name:"numAccounts",value:1},{name:"symbol",value:$scope.symbol}]),$scope.loader.setError($scope.labels.dataRenderError))};$scope.$watch("accounts",function(newVal,oldVal){null!==newVal&&newVal!==oldVal&&0<$scope.accounts.length&&($scope.loaded=!1,$scope.load())},!0),$scope.$watch("_symbol",function(newVal,oldVal){null!==newVal&&newVal!==oldVal&&($scope.loaded=!1,$scope.load())}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data.currentAccount&&$scope.accounts!=data.currentAccount&&($scope.accounts=data.currentAccount)}),eventDispatcher.on($scope.eventName,function(e,data){if(data.hasOwnProperty("symbolList")&&angular.isArray(data.symbolList)&&0<data.symbolList.length)$scope._symbol=data.symbolList;else{if(!data.symbol||$scope._symbol==data.symbol)return;$scope._symbol=data.symbol}})}],link:function($scope,$element,$attrs){var template=$templateCache.get("symbolOrderStatus/symbolOrderStatus"+$scope.template+".tpl.html");$element.html(template).show(),$compile($element.contents())($scope),"Widget"===$scope.template&&widget.attach($scope,$element),$timeout(function(){$scope._symbol=$attrs.symbol,""!==$scope._symbol&&$scope.load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviSymbolUgl",["$templateRequest","APP_CONFIG","widget","$compile","eventDispatcher","$timeout","accountList","labels","costbasis","piwik","$log","symbol",function($templateRequest,APP_CONFIG,widget,$compile,eventDispatcher,$timeout,accountList,labels,costbasis,piwik,$log,symbol){return{replace:!1,scope:{useParentData:"@",accounts:"=?",symbol:"@",eventName:"@",underlying:"@",investmentType:"@",showEvent:"@",showAcctType:"@",showTitle:"@",columns:"@",columnPriority:"@",responsiveColumns:"@",template:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$attrs.hasOwnProperty("accounts")||($scope.accounts=$attrs.accounts=[accountList.getCurrentAccountIndex()]),$scope._symbol=$attrs.symbol,$scope.api=this,svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultString($scope,$attrs,"underlying",""),svi.ng.defaultString($scope,$attrs,"investmentType",""),svi.ng.defaultTrue($scope,$attrs,"showAcctType"),svi.ng.defaultTrue($scope,$attrs,"showEvent"),$scope.loaded=!1,svi.ng.defaultFalse($scope,$attrs,"useParentData"),svi.ng.defaultTrue($scope,$attrs,"showTitle"),svi.ng.defaultString($scope,$attrs,"columns",'["symbol", "dateAcquired", "qty", "unitCost", "gainLoss", "eventDesc", "accountType"]'),svi.ng.defaultString($scope,$attrs,"columnPriority",'["symbol", "dateAcquired", "qty", "unitCost", "gainLoss", "eventDesc", "accountType"]'),svi.ng.defaultValidString($scope,$attrs,"template",["Widget",""],""),svi.ng.defaultTrue($scope,$attrs,"responsiveColumns");try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.error("sviSymbolUgl: Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn("sviSymbolUgl: Error parsing columnPriority: ",e,$attrs.columnPriority)}labels.setupLabels($scope,["general","symbolUgl"]),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.symbol=$scope._symbol?$scope._symbol:$scope.$parent.symbol,""!==$scope.symbol&&null!==$scope.symbol&&!1!==$scope.symbol&&$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){if(!($scope.gainLoss=null)===$scope.useParentData||"true"===$scope.useParentData)return $scope.$parent.loadCallback();var index=0,query={sortField:"dateAcquired",filterField:["symbol"],filterValue:[[$scope.symbol]],switchAccounts:"N"};if("Option"===$scope.investmentType){var optionSymbol=symbol.osiSubmitFormat($scope.symbol);index=0,query.filterValue[index]=[optionSymbol.symbol],index++,query.filterField[index]="investmentType",query.filterValue[index]=["Option"],index++,query.filterField[index]="putOrCall",query.filterValue[index]=[optionSymbol.putOrCall],index++,query.filterField[index]="expirationDate",query.filterValue[index]=[optionSymbol.expDate.replace(/\//g,"-")],index++,query.filterField[index]="strikePrice",query.filterValue[index]=[optionSymbol.strikePrice],index++}return costbasis.getUGL($scope.accounts[0],query,!1)},onSuccess=function(response){piwik.trackPage("symbolUgl","Symbol Unrealized Gain Loss",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1},{name:"symbol",value:$scope.symbol}]),$scope.gainLoss=response.costbasis.gainLoss,angular.isArray($scope.gainLoss)&&0!==$scope.gainLoss.length?$scope.loaded=!0:($scope.loader.setWarning($scope.labels.noDataSymbol),$scope.loaded=!1)},onError=function(response){"A new load request canceled this one."!=response.message&&(piwik.trackPage("symbolUgl/error","Error: Symbol Unrealized Gain Loss",!1,[{name:"numAccounts",index:1,value:1},{name:"symbol",value:$scope.symbol}]),$scope.loader.setError($scope.labels.dataRenderError))};$scope.$watch("accounts",function(newVal,oldVal){null!==newVal&&newVal!=oldVal&&0<$scope.accounts.length&&($scope.loaded=!1,$scope.load())},!0),$scope.$watch("_symbol",function(newVal,oldVal){null!==newVal&&newVal!=oldVal&&($scope.loaded=!1,$scope.load())}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data.currentAccount&&$scope.accounts!=data.currentAccount&&($scope.accounts=data.currentAccount)}),eventDispatcher.on($scope.eventName,function(e,data){data.symbol&&$scope._symbol!=data.symbol&&(data.hasOwnProperty("underlying")&&($scope.underlying=data.underlying),data.hasOwnProperty("investmentType")&&($scope.investmentType=data.investmentType),$scope._symbol=data.symbol)}),$scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{symbol:!1,dateAcquired:"fancyDate",qty:"sviNumber:3",unitCost:"sviCurrency",gainLoss:"currencyIndicator"},breakpoints:{xs:4,sm:4,md:5}}}],link:function($scope,$element,$attrs){var config={columns:$scope.columns},tplPath="symbol/symbolUgl/symbolUgl"+$scope.template+".tpl.phtml";$templateRequest(tplPath,config).then(function(data){$element.html(data).show(),$compile($element.contents())($scope)}),"Widget"===$scope.template&&widget.attach($scope,$element),$timeout(function(){$scope._symbol=$attrs.symbol,""!==$scope._symbol&&$scope.load()},APP_CONFIG.autoLoadDelay)}}}]),angular.module("directives").directive("sviWatchlist",["APP_CONFIG","$templateCache","$timeout","watchlist","labels","$tooltip","preferences","$popover","piwik","eventDispatcher","$document",function(APP_CONFIG,$templateCache,$timeout,watchlist,labels,$tooltip,preferences,$popover,piwik,eventDispatcher,$document){return{replace:!1,scope:{template:"@",switchEnabled:"@",watchlistName:"@"},template:$templateCache.get("watchlist/watchlist.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultString($scope,$attrs,"template","watchlist"),svi.ng.defaultFalse($scope,$attrs,"switchEnabled")}catch(e){throw"sviWatchlist: "+e}$scope.viewMode=APP_CONFIG.viewMode,$scope.defaultWatchlist="DEFAULT";var prefsCb=function(response){if(angular.isObject(response)&&response.hasOwnProperty("data")){var data=response.data;angular.isObject(data)&&data.hasOwnProperty("success")&&data.success&&($scope.defaultWatchlist=data.resource)}try{svi.ng.defaultString($scope,$attrs,"watchlistName",$scope.defaultWatchlist)}catch(e){throw"sviWatchlist: "+e}};preferences.get(["watchlist","default"]).then(prefsCb,prefsCb),$scope.watchlistList=null,$scope.watchlist=null,$scope.symbol="",$scope.data={symbolFront:"",symbolBack:"",newWatchlistName:""},$scope.inputSymbolComm={},$scope.inputSymbolCommBack={},labels.setupLabels($scope,["general","watchlist"],{}).then(function(){$scope.inputSymbolComm.placeholder=$scope.labels.watchlistEntryPlaceholder,$scope.inputSymbolCommBack.placeholder=$scope.labels.watchlistEntryPlaceholder}),$scope.minWidgetSize=APP_CONFIG.defaultWidgetSize+2;var getWidgetCtrl=svi.ng.getControllerFactory($element,$scope,"svi-widget"),widgetResize=function(){var widgetCtrl=getWidgetCtrl();widgetCtrl&&widgetCtrl.checkWidgetSize(100)};$scope.loader=null,$scope.setLoader=function(loader){$scope.loader=loader,$scope.watchlistName||$scope.loader.setMessage(labels.watchlistPrefsLoading);var widgetCtrl=getWidgetCtrl();widgetCtrl&&widgetCtrl.setLoader(loader)},$scope.symbolLoader=null,$scope.setSymbolLoader=function(loader){$scope.symbolLoader=loader;var widgetCtrl=getWidgetCtrl();widgetCtrl&&(widgetCtrl.setScopeVar("symbolLoader",loader),widgetCtrl.addWatch("symbolLoader.showSpinner"))},$scope.watchlistLoader=null,$scope.setWatchlistLoader=function(loader){$scope.watchlistLoader=loader;var widgetCtrl=getWidgetCtrl();widgetCtrl&&(widgetCtrl.setScopeVar("watchlistLoader",loader),widgetCtrl.addWatch("watchlistLoader.showSpinner"))},this.load=function(invalidateCache){if(!$scope.watchlistName)return!1;angular.isUndefined(invalidateCache)&&(invalidateCache=!1),$scope.loader?$scope.loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError):$timeout($scope.api.load,200)};var loadCallback=function(invalidateCache){return $scope.watchlist=null,watchlist.getWatchlist($scope.watchlistName,invalidateCache)},onSuccess=function(response){piwik.trackPage("watchlist","Watchlist",1e3*response._loaderMetadata.elapsedTime),$scope.watchlist=response.watchlist.watchListQuote},onError=function(reason){piwik.trackPage("watchlist/error","Error: Watchlist")};this.addSymbol=function(){if(!validateSymbolInputInternal())return!1;piwik.trackEvent("Watchlist","Add Symbol",$scope.symbol),$scope.symbolLoader?$scope.symbolLoader.setLoadHandler(addSymbolCallback).load().then(onSymbolSuccess,onSymbolError):$timeout($scope.api.addSymbol,200)};var addSymbolCallback=function(){return widgetResize(),watchlist.addSymbol($scope.watchlistName,$scope.symbol)},onSymbolSuccess=function(){$scope.api.load(!0),$scope.api.loadList(!0),$scope.symbol="",$scope.data.symbolFront="",$scope.data.symbolBack=""},onSymbolError=function(){$scope.api.showInvalidSymbolError()},symbolToRemove=!1;this.removeSymbol=function(symbol){if(angular.isUndefined(symbol))return!1;symbolToRemove=symbol,piwik.trackEvent("Watchlist","Remove Symbol",symbol),$scope.symbolLoader?$scope.symbolLoader.setLoadHandler(removeSymbolCallback).load().then(onSymbolSuccess,onError):$timeout($scope.api.removeSymbol,200)};var removeSymbolCallback=function(){return watchlist.removeSymbol($scope.watchlistName,symbolToRemove)},invalidWatchlistTooltip=null;this.showInvalidWatchlistTooltip=function(duplicate){var title=$scope.labels.watchlistEntryInvalidWatchlist;if(duplicate&&(title=$scope.labels.watchlistEntryDuplicateWatchlist),!invalidWatchlistTooltip){var options={placement:"top",trigger:"manual",autoClose:!0,type:"danger",title:title};invalidWatchlistTooltip=$tooltip($element.find(".watchlist-create-entry"),options)}invalidWatchlistTooltip.$scope.title=title,invalidWatchlistTooltip.$promise.then(invalidWatchlistTooltip.show)},this.hideInvalidWatchlistTooltip=function(){invalidWatchlistTooltip&&invalidWatchlistTooltip.$promise.then(invalidWatchlistTooltip.hide)};var validateWatchlistInputInternal=function(newVar,oldVar){if(angular.isUndefined(newVar)||newVar===oldVar)return!1;if(""!==newVar){if(angular.isString(newVar)&&/^[a-zA-Z0-9_]{1,25}$/.test(newVar)){if(angular.isArray($scope.watchlistList))for(var i=0,l=$scope.watchlistList.length;i<l;i++)if($scope.watchlistList[i].name==newVar)return $scope.api.showInvalidWatchlistTooltip(!0),!1;return $scope.api.hideInvalidWatchlistTooltip(),!0}$scope.api.showInvalidWatchlistTooltip()}else $scope.api.hideInvalidWatchlistTooltip();return!1};this.validateWatchlistInput=$.debounce(1e3,validateWatchlistInputInternal);var watchlistToCreate=null;this.createWatchlist=function(name){if(!validateWatchlistInputInternal(name))return!1;piwik.trackEvent("Watchlist","Create Watchlist"),watchlistToCreate=name,$scope.watchlistLoader?$scope.watchlistLoader.setLoadHandler(createWatchlistCallback).load().then(onCreateWatchlistSuccess,onError):$timeout($scope.api.createWatchlist,200)};var createWatchlistCallback=function(){return watchlist.create(watchlistToCreate)},onCreateWatchlistSuccess=function(){$scope.watchlistName=watchlistToCreate,$scope.data.newWatchlistName="",$scope.api.load(!0),$scope.api.loadList(!0)};this.deleteWatchlist=function(){if($scope.api.hideDeleteWatchlistPopover(),!$scope.watchlistName)return!1;piwik.trackEvent("Watchlist","Delete Watchlist"),$scope.watchlistLoader?$scope.watchlistLoader.setLoadHandler(removeWatchlistCallback).load().then(onRemoveWatchlistSuccess,onError):$timeout($scope.api.deleteWatchlist,200)};var removeWatchlistCallback=function(){return watchlist.remove($scope.watchlistName)},onRemoveWatchlistSuccess=function(){$scope.watchlistName===$scope.defaultWatchlist?(angular.isArray($scope.watchlistList)&&1<$scope.watchlistList.length?$scope.watchlistList[0].name!==$scope.watchlistName?$scope.watchlistName=$scope.watchlistList[0].name:$scope.watchlistName=$scope.watchlistList[1].name:$scope.watchlistName="DEFAULT",$scope.watchlistName!==$scope.defaultWatchlist&&$scope.api.setDefaultWatchlist(!0)):$scope.watchlistName=$scope.defaultWatchlist,$scope.api.load(!0),$scope.api.loadList(!0)};this.loadList=function(invalidateCache){angular.isUndefined(invalidateCache)&&(invalidateCache=!1),$scope.watchlistLoader?$scope.watchlistLoader.setLoadHandler(loadListCallback).load(invalidateCache).then(onListSuccess,onError):$timeout($scope.api.load,200)};var loadListCallback=function(invalidateCache){return watchlist.getList(invalidateCache)},onListSuccess=function(data){var response=data.data||data;$scope.watchlistList=response.watchlists.watchList,$scope.watchlistList.length||$scope.watchlistList.push({name:$scope.defaultWatchlist,securities:[]}),$scope.symbolToActivate&&$scope.activateNewAddedSymbol()};$scope.checkIsPopoverInside=function(){var popover=$document.find(".svi-directive.svi-symbol-popover");if(popover.length&&popover.attr("id")&&popover.attr("id").indexOf(!1)){var id=popover.attr("id").split("-")[0],elInside=$document.find(".symbol-wrapper #"+id),elOutside=$document.find("#"+id);(elInside.length||!elInside.length&&!elOutside.length)&&($scope.isWithinWidget=!0),!elInside.length&&elOutside.length&&($scope.isWithinWidget=!1)}},$scope.activateNewAddedSymbol=function(){$scope.symbolToActivateString=-1<$scope.symbolToActivate.indexOf(":")?svi.util.convertOptionSymbol($scope.symbolToActivate):$scope.symbolToActivate,$scope.symbolToActivateString&&$timeout(function(){var sviSymbolElement=$element.find('.symbol-wrapper .svi-symbol[data-symbol="'+$scope.symbolToActivateString+'"]').parent();sviSymbolElement.length&&(this.getSymbolController=svi.ng.getControllerFactory(sviSymbolElement,$scope,"svi-symbol"),this.getSymbolController(!0).showQuote(),$scope.isWithinWidget=!0)},500),$scope.symbolToActivate=""};var getFrontInputCtrl=svi.ng.getControllerFactory($element.find(".front"),$scope,"svi-input-symbol","sviInputSymbolCtrlFront"),getBackInputCtrl=svi.ng.getControllerFactory($element.find(".back"),$scope,"svi-input-symbol","sviInputSymbolCtrlBack");this.showInvalidSymbolError=function(){$scope.symbolLoader&&($scope.symbolLoader.setError($scope.labels.watchlistEntryInvalidSymbol),widgetResize())},this.hideInvalidSymbolError=function(){$scope.symbolLoader&&($scope.symbolLoader.setError(!1),widgetResize())},this.showDuplicateSymbolWarning=function(){$scope.symbolLoader&&($scope.symbolLoader.setWarning($scope.labels.watchlistDuplicateSymbol),widgetResize())},this.hideDuplicateSymbolWarning=function(){$scope.symbolLoader&&($scope.symbolLoader.setWarning(!1),widgetResize())};var validateSymbolInputInternal=function(newVar,oldVar){if(angular.isUndefined($scope.symbol)||angular.isDefined(newVar)&&newVar===oldVar)return!1;if($scope.api.hideDuplicateSymbolWarning(),""!==$scope.symbol){var ctrl,widgetCtrl=getWidgetCtrl();if(widgetCtrl&&(ctrl=widgetCtrl.getFlipped()?getBackInputCtrl():getFrontInputCtrl()),!ctrl||ctrl.isValid()){if($scope.api.hideInvalidSymbolError(),angular.isArray($scope.watchlist))for(var i=0,l=$scope.watchlist.length;i<l;i++)if($scope.watchlist[i].instrument.symbol==$scope.symbol)return $scope.api.showDuplicateSymbolWarning(),!1;return!0}$scope.api.showInvalidSymbolError()}else $scope.api.hideInvalidSymbolError();return!1};this.validateSymbolInput=$.debounce(1e3,validateSymbolInputInternal),this.switchWatchlist=function(name){$scope.watchlistName=name},this.toggleSettings=function(){var widgetCtrl=getWidgetCtrl();widgetCtrl&&(widgetCtrl.getFlipped()?$scope.api.hideSettings():$scope.api.showSettings())},this.showSettings=function(){piwik.trackEvent("Watchlist","Show Settings");var widgetCtrl=getWidgetCtrl();widgetCtrl&&(widgetCtrl.flip(!0),$scope.labels.watchlistView="Edit Watchlists"),$scope.api.loadList(!0)},this.hideSettings=function(){piwik.trackEvent("Watchlist","Hide Settings");var widgetCtrl=getWidgetCtrl();widgetCtrl&&(widgetCtrl.flip(!1),$scope.labels.watchlistView="Return to Watchlist")},this.setDefaultWatchlist=function(keepSettingsOpen){$scope.defaultWatchlist=$scope.watchlistName,preferences.set(["watchlist","default"],$scope.defaultWatchlist),piwik.trackEvent("Watchlist","Set Default Watchlist"),svi.ng.strToBoolean(keepSettingsOpen,!1)||$scope.api.hideSettings()},$scope.deleteWatchlistPopover=null;var getDeleteWatchlistPopover=function(){if(!$scope.deleteWatchlistPopover){var el=$element.find(".watchlist-delete");$scope.deleteWatchlistPopover=$popover(el,{placement:"top",target:el,trigger:"manual",autoClose:!0,title:$scope.labels.confirmDeleteWatchlist,templateUrl:"watchlist/deleteWatchlistPopover.tpl.html"}),$scope.deleteWatchlistPopover.$scope.api=$scope.api,$scope.deleteWatchlistPopover.$scope.labels=$scope.labels}return $scope.deleteWatchlistPopover};this.showDeleteWatchlistPopover=function(){getDeleteWatchlistPopover().$promise.then($scope.deleteWatchlistPopover.show)},this.hideDeleteWatchlistPopover=function(){getDeleteWatchlistPopover().$promise.then($scope.deleteWatchlistPopover.hide)},$scope.api=this,$scope.$watch("symbol",this.validateSymbolInput);var updateSymbol=function(newVal,oldVal){newVal!==oldVal&&null!==newVal&&($scope.symbol=newVal)};$scope.$watch("data.symbolFront",updateSymbol),$scope.$watch("data.symbolBack",updateSymbol),$scope.$watch("newWatchlistName",this.validateWatchlistInput),$scope.$watch("watchlistName",function(newVal,oldVal){newVal!==oldVal&&newVal&&$scope.api.load()}),eventDispatcher.on("SYMBOL.IN.WATCHLIST.ADDED",function(evt,data){if(angular.isDefined(data.watchlistName)&&data.watchlistName!==$scope.watchlistName)return!1;$scope.checkIsPopoverInside(),$scope.isWithinWidget&&($scope.symbolToActivate=data.symbol,$scope.isWithinWidget=!1),$scope.api.load(!0),$scope.api.loadList(!0)}),eventDispatcher.on("SYMBOL.IN.WATCHLIST.REMOVED",function(evt,data){if(angular.isDefined(data.watchlistName)&&data.watchlistName!==$scope.watchlistName)return!1;$scope.checkIsPopoverInside(),$scope.isWithinWidget&&eventDispatcher.trigger("POPOVER.HIDE","ALL"),$scope.api.load(!0),$scope.api.loadList(!0)}),eventDispatcher.on("POPOVER.QUOTE.LOADED",function(){$scope.isWithinWidget=!1}),$timeout(function(){$scope.api.load()},200)}]}}]),angular.module("directives").directive("sviBonusTrades",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","bonusTrades","piwik",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,bonusTrades,piwik){return{replace:!1,scope:{account:"@",showTitle:"@",showExpiration:"@",listener:"@",eventAccount:"@"},template:$templateCache.get("bonusTrades/bonusTrades.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultTrue($scope,$attrs,"showTitle"),svi.ng.defaultTrue($scope,$attrs,"showExpiration"),svi.ng.defaultString($scope,$attrs,"listener","ACCOUNT.CONTEXT.CHANGED"),svi.ng.defaultString($scope,$attrs,"eventAccount","index")}catch(e){throw"sviBonusTrades: "+e}$scope.bonusTrades=null,labels.setupLabels($scope,["general","bonusTrades"],{}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.launchDetailModal=function(){eventDispatcher.trigger("BONUS_TRADES.SHOW",{account:$scope.account})},this.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$.isNumeric($scope.account)&&($scope.bonusTrades=null,$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError))};var loadCallback=function(){return bonusTrades.getBonusTradesProcessedAccount($scope.account)},onSuccess=function(response){piwik.trackPage("bonusTrades","Bonus Trades",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]),response.bonusTrades?($scope.bonusTrades=response.bonusTrades,$scope.bonusTrades.wasEligible?$element.show():$element.hide()):$scope.loader.setError($scope.labels.dataRenderError)},onError=function(response){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("bonusTrades/error","Error: Bonus Trades",!1,[{name:"numAccounts",index:1,value:1}])};$scope.api=this,$timeout(function(){!$scope.bonusTrades&&$scope.api&&$scope.api.load()},200),$scope.$watch("account",function(newVal,oldVal){newVal!=oldVal&&$scope.api.load()}),eventDispatcher.addSingleAccountListener($scope,$element)}]}}]),angular.module("directives").directive("sviBonusTradesModal",["$templateCache","APP_CONFIG","eventDispatcher","$timeout","accountList","labels","bonusTrades","state","piwik","$filter",function($templateCache,APP_CONFIG,eventDispatcher,$timeout,accountList,labels,bonusTrades,state,piwik,$filter){return{replace:!1,scope:{account:"@",showExpiration:"@"},template:$templateCache.get("bonusTradesModal/bonusTradesModal.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultInt($scope,$attrs,"account",accountList.getCurrentAccountIndex()),svi.ng.defaultTrue($scope,$attrs,"showExpiration")}catch(e){throw"sviBonusTradesModal: "+e}$scope.bonusTrades=null,$scope.accountDisplay=accountList.getCurrentAccountDisplay(),$scope.sortable=!0,$scope.sortDir=state.get("bonusTrades-sortDir","desc"),$scope.sortField=state.get("bonusTrades-sortField","orderDate"),$scope.$watch("sortField",function(val){state.set("bonusTrades-sortField",val).save()}),$scope.$watch("sortDir",function(val){state.set("bonusTrades-sortDir",val).save()}),$scope.id=php.uniqid("bt"),($scope.api=this).getModalCtrl=svi.ng.getControllerFactory($element,$scope,"svi-modal"),labels.setupLabels($scope,["general","bonusTrades","bonusTradesDetail","orderStatus","orderStatusTypes"]).then(function(){var modalCtrl=$scope.api.getModalCtrl();modalCtrl&&modalCtrl.setTitle($scope.getTitle())}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)},$scope.getTitle=function(){return $filter("substitute")($scope.labels.bonusTradesDetailTitle,{"%ACCOUNT%":$scope.accountDisplay})};var loadCallback=function(){var data={sortField:$scope.sortField,sortDir:$scope.sortDir};return bonusTrades.getBonusTradesActivity($scope.account,data)},onSuccess=function(response){piwik.trackPage("bonusTradesModal","Bonus Trades Modal",1e3*response._loaderMetadata.elapsedTime,[{name:"numAccounts",index:1,value:1}]);var modalCtrl=$scope.api.getModalCtrl();modalCtrl&&modalCtrl.setTitle($scope.getTitle()),response.bonusTrades?$scope.bonusTrades=response.bonusTrades:$scope.loader.setError($scope.labels.dataRenderError)},onError=function(response){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("bonusTradesModal/error","Error: Bonus Trades Modal",!1,[{name:"numAccounts",index:1,value:1}])},modalCallback=function(active,data){if(active){if(angular.isObject(data)&&data.hasOwnProperty("account")){var account=data.account;$.isNumeric(account)&&$scope.account!=account&&($scope.account=account,$scope.accountDisplay=accountList.getAccountsWithNicknames()[$scope.account],$scope.bonusTrades=null)}$scope.bonusTrades||$scope.load()}},init=function(){var modalCtrl=$scope.api.getModalCtrl();modalCtrl?(modalCtrl.setCallback(modalCallback),modalCtrl.setTitle($scope.getTitle()),modalCtrl.isActive()&&!$scope.bonusTrades&&$scope.load()):$timeout(init,APP_CONFIG.autoLoadDelay)};init(),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){if(angular.isObject(data)&&data.hasOwnProperty("index")){$scope.account=data.index,$scope.accountDisplay=accountList.getCurrentAccountDisplay(),$scope.bonusTrades=null;var modalCtrl=$scope.api.getModalCtrl();modalCtrl&&modalCtrl.isActive()&&$scope.load()}},null,$element),eventDispatcher.on("BT_ACTIVITY.SORT.CHANGED",function(e,data){if($scope.sortField!==data.field||$scope.sortDir!==data.dir){$scope.sortField=data.field,$scope.sortDir=data.dir;var modalCtrl=$scope.api.getModalCtrl();modalCtrl&&modalCtrl.isActive()&&$scope.load()}},!0,$element)}]}}]),angular.module("directives").directive("sviProspectusDisplay",["$templateCache","eventDispatcher","labels","$sce","$modal","piwik","$timeout",function($templateCache,eventDispatcher,labels,$sce,$modal,piwik,$timeout){return{replace:!1,scope:{symbol:"@",url:"@",width:"@",height:"@",eventName:"@",showEvent:"@",eventSymbol:"@"},template:$templateCache.get("prospectusDisplay/prospectusDisplay.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){svi.ng.defaultString($scope,$attrs,"symbol",""),svi.ng.defaultString($scope,$attrs,"url",""),svi.ng.defaultString($scope,$attrs,"width","100%"),svi.ng.defaultString($scope,$attrs,"height","600"),svi.ng.defaultString($scope,$attrs,"eventName","SYMBOL.CONTEXT.CHANGED"),svi.ng.defaultString($scope,$attrs,"showEvent",""),svi.ng.defaultString($scope,$attrs,"eventSymbol","symbol"),$scope.id=php.uniqid("prospectus"),labels.setupLabels($scope,["prospectusDisplay"]),$scope.prospectusUrl="",$scope.modal=null,this.show=function(){$scope.prospectusUrl&&(piwik.trackEvent("Prospectus","Show",$scope.symbol),$scope.modal?$scope.modal.$promise.then($scope.modal.show):$scope.modal=$modal({scope:$scope,templateUrl:"prospectusDisplay/prospectusDisplayModal.tpl.html",container:".modals-section",backdrop:!1,animation:"",show:!0}))},this.hide=function(){$scope.modal&&$scope.modal.$isShown&&$scope.modal.$promise.then($scope.modal.hide)},this.setSymbol=function(symbol){return $scope.symbol=symbol,$scope.api},this.getSymbol=function(){return $scope.symbol},$scope.api=this,$scope.$watch("symbol",function(newVal,oldVal){angular.isString(newVal)&&5==newVal.length&&"X"==newVal.charAt(4)?($scope.prospectusUrl=$scope.url.replace("*SYMBOL*",newVal),$scope.prospectusUrl=$sce.trustAsResourceUrl($scope.prospectusUrl)):($scope.prospectusUrl="",$scope.api.hide())}),eventDispatcher.on($scope.eventName,function(e,data){data.hasOwnProperty("symbolList")&&angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope.symbol=data.symbolList[data.symbolList.length-1]:data.hasOwnProperty("symbol")&&($scope.symbol=data.symbol)}),$scope.showEvent&&eventDispatcher.on($scope.showEvent,function(e,data){data.hasOwnProperty($scope.eventSymbol)&&($scope.symbol=data[$scope.eventSymbol]),$scope.symbol&&$timeout($scope.api.show,200)}),eventDispatcher.on("QUOTE.ACTION.CLEAR",function(){$scope.symbol=""})}]}}]),angular.module("directives").directive("sviTradeMenu",["$templateCache","$timeout","eventDispatcher","accountList","labels","cache","config",function($templateCache,$timeout,eventDispatcher,accountList,labels,cache,config){return{replace:!1,scope:{},template:$templateCache.get("tradeMenu/tradeMenu.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.accountIndex=accountList.getCurrentAccountIndex(),$scope.actionMenuComm={},labels.setupLabels($scope,["general"],{}).then(function(){$scope.actionMenuComm.label=$scope.labels.tradeMenuLabel,$scope.actionMenuComm.ariaLabel=$scope.labels.tradeMenuLabel});var getCacheKey=function(){return"tradeMenu-"+accountList.getAccountByIndex($scope.accountIndex)};$scope.config=cache.get(getCacheKey());var loadCallback=function(){return config.getTradeMenu($scope.accountIndex)},onSuccess=function(data){$scope.config=data.menuItems,cache.set(getCacheKey(),$scope.config,36e5)},onError=function(reason){};this.getLoader=svi.ng.getLoaderFactory($element,$scope),this.load=function(){var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load().then(onSuccess,onError):$timeout($scope.api.load,400)},$scope.api=this,$timeout(function(){$scope.api.load()},400),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(e,data){data.hasOwnProperty("index")&&$scope.accountIndex!=data.index&&($scope.accountIndex=data.index,$scope.api.load())})}],link:function($scope,$element,$attrs){}}}]),angular.module("directives").directive("sviTradePricing",["$templateCache","$timeout","labels","piwik","config",function($templateCache,$timeout,labels,piwik,config){return{replace:!1,scope:{},template:$templateCache.get("tradePricing/tradePricing.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.pricing=!1,labels.setupLabels($scope,["general","tradePricing"],{tradePricingTitle:"Trade Pricing"}),$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var loadCallback=function(){return config.getConfig(["trading","pricing"])},onSuccess=function(response){piwik.trackPage("tradePricing","Trade Pricing",1e3*response._loaderMetadata.elapsedTime),response&&response.hasOwnProperty("config")?$scope.pricing=response.config&&response.config.length?response.config:null:$scope.loader.setError($scope.labels.dataRenderError)},onError=function(response){$scope.loader.setError($scope.labels.dataRenderError),piwik.trackPage("tradePricing/error","Error: Trade Pricing",!1)};$timeout(function(){$scope.pricing||$scope.load()},200)}]}}]),angular.module("directives").directive("sviTradeWidget",["$templateCache","$compile","$filter","$popover","eventDispatcher","labels","balances","holdings","$timeout","accountList","orders","sviUrl","navigation","$log","screenText","piwik",function($templateCache,$compile,$filter,$popover,eventDispatcher,labels,balances,holdings,$timeout,accountList,orders,sviUrl,navigation,$log,screenText,piwik){var MARKET_INFO=["ARCX: NYSE ARCA","BATS: CBOE BZX U.S. EQUITIES EXCHANGE","BATY: CBOE BYX U.S. EQUITIES EXCHANGE","CBSX: CBOE STOCK EXCHANGE","EDGA: CBOE EDGA U.S. EQUITIES EXCHANGE","EDGX: CBOE EDGX U.S. EQUITIES EXCHANGE","EPRL: MIAMI PEARL EQUITY EXCHANGE","FINY: FINRA/NYSE TRF","IEXG: INVESTORS EXCHANGE","LTSE: LONG TERM STOCK EXCHANGE","MEMX: MEMBERS EXCHANGE","OOTC: OTHER OTC","OTCM: OTC MARKETS","XASE: NYSE AMERICAN","XBOS: NASDAQ OMX BX","XCHI: NYSE CHICAGO","XCIS: NATIONAL STOCK EXCHANGE","XISE: INTERNATIONAL STOCK EXCHANGE","XNMS: NASDAQ","XNYS: NEW YORK STOCK EXCHANGE","XOTC: OTC BULLETIN BOARD","XPHL: NASDAQ OMX PSX"];return{replace:!1,scope:{config:"@",investmentType:"@",allowSymbolEdit:"@",allowAccountEdit:"@",symbol:"@",exchangeToSymbol:"@",qty:"@",fundQty:"@",side:"@",price:"@",limit:"@",stop:"@",instructions:"@",timeInForce:"@",reinvestDiv:"@",reinvestCap:"@",initialPurchase:"@",readProspectus:"@",quantityType:"@",disposalMethod:"@",template:"@",mode:"@",origOrderId:"@",useTradingPassword:"@",symbolEvent:"@",isMarginAccount:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){var originalQuantityTypeOptions;$scope.initData={};var getOptions=function(){var options;return angular.isObject($scope.config)&&$scope.config.hasOwnProperty($scope.investmentType)?(originalQuantityTypeOptions=(options=$scope.config.hasOwnProperty("All")?$.extend({},$scope.config.All,$scope.config[$scope.investmentType]):$.extend({},$scope.config[$scope.investmentType])).quantityType,options):{}},setOptionQtyType=function(){$scope.options.quantityTypeHideSharesForBuy&&"1"==$scope.side?($scope.options.quantityType&&angular.isArray($scope.options.quantityType)&&angular.forEach($scope.options.quantityType,function(quantityType,index){var quantityTypeDollars;"dollars"==quantityType.value&&(quantityTypeDollars=$scope.options.quantityType[index],$scope.options.quantityType=[quantityTypeDollars])}),$scope.quantityType="dollars"):$scope.options.quantityType=originalQuantityTypeOptions};try{svi.ng.parseJSON($scope,$attrs,"config"),$scope.initData.investmentType=svi.ng.defaultValidString($scope,$attrs,"investmentType",php.array_keys($scope.config),"Stock"),$scope.options=getOptions(),svi.ng.required($scope,"options"),svi.ng.defaultFalse($scope,$attrs,"allowSymbolEdit"),svi.ng.defaultTrue($scope,$attrs,"allowAccountEdit"),$scope.initData.symbol=svi.ng.defaultString($scope,$attrs,"symbol",""),$scope.initData.side=svi.ng.defaultValidString($scope,$attrs,"side",svi.array.extractValues($scope.options.side,"value"),"Option"==$scope.initData.investmentType?"BTO":"1"),"X"==$scope.side||"Y"==$scope.side?$scope.initData.exchangeToSymbol=svi.ng.defaultString($scope,$attrs,"exchangeToSymbol",""):$scope.initData.exchangeToSymbol=$scope.exchangeToSymbol=$attrs.exchangeToSymbol="",$scope.initData.price=svi.ng.defaultValidString($scope,$attrs,"price",svi.array.extractValues($scope.options.price,"value"),"1"),"MutualFund"===$scope.initData.investmentType?($scope.initData.qty=svi.ng.defaultFloat($scope,$attrs,"qty",0),$scope.initData.fundQty=svi.ng.defaultFloat($scope,$attrs,"fundQty",0)):($scope.initData.qty=svi.ng.defaultInt($scope,$attrs,"qty",0),$scope.initData.fundQty=svi.ng.defaultInt($scope,$attrs,"fundQty",0)),$scope.options&&$scope.options.hasEmptyInitialPurchaseValue&&($scope.hasEmptyInitialPurchaseValue=!0,$scope.hasInitialPurchaseError=!1),$scope.initData.limit=svi.ng.defaultFloat($scope,$attrs,"limit",""),$scope.initData.stop=svi.ng.defaultFloat($scope,$attrs,"stop",""),$scope.initData.instructions=svi.ng.defaultValidString($scope,$attrs,"instructions",["","AON","DNR","AONDNR"],""),$scope.initData.reinvestDiv=svi.ng.defaultFalse($scope,$attrs,"reinvestDiv"),$scope.initData.reinvestCap=svi.ng.defaultFalse($scope,$attrs,"reinvestCap"),$scope.initData.initialPurchase="MutualFund"===$scope.investmentType&&$scope.hasEmptyInitialPurchaseValue?$scope.EMPTY_VALUE:svi.ng.defaultFalse($scope,$attrs,"initialPurchase"),$scope.initData.readProspectus=svi.ng.defaultFalse($scope,$attrs,"readProspectus"),$scope.initData.timeInForce=svi.ng.defaultValidString($scope,$attrs,"timeInForce",svi.array.extractValues($scope.options.timeInForce,"value"),"0"),$scope.initData.quantityType=svi.ng.defaultValidString($scope,$attrs,"quantityType",svi.array.extractValues($scope.options.quantityType,"value"),"shares"),$scope.options.hasAdvancedFundsDisplay&&($scope.initData.hasAdvancedFundsDisplay=!0),svi.ng.defaultValidString($scope,$attrs,"template",["Modal","Inline"],"Modal"),svi.ng.defaultValidString($scope,$attrs,"mode",["place","edit","cancel"],"place"),"place"!=$scope.mode&&svi.ng.required($scope,"origOrderId"),svi.ng.defaultFalse($scope,$attrs,"useTradingPassword"),svi.ng.defaultString($scope,$attrs,"symbolEvent","SYMBOL.CONTEXT.CHANGED")}catch(e){throw"sviTradeWidget: "+e}$scope.id=php.uniqid("tradewidget"),$scope.allowQtyEdit=!0,$scope.visible=!1,$scope.orderStep="entry",$scope.warnings=[],$scope.errors=[],$scope.formInvalidMsg="",$scope.account=accountList.getCurrentAccountIndex(),$scope.acctType="AUTO",$scope.balances=null,$scope.fundsAvail=0,$scope.holdings=null,$scope.quote=null,$scope.currentShares=0,$scope.currentShortShares=0,$scope.lastPx=0,$scope.sharePx=0,$scope.maxShares=0,$scope.investAmount="",$scope.underlyingSymbol="",$scope.contractSize=100,$scope.dollarUnits=!1,$scope.formAction="",$scope.insufficientFunds=!1,$scope.insufficientShares=!1,$scope.reinvestDiv=!1,$scope.reinvestCap=!1,$scope.initialPurchase=!("MutualFund"!==$scope.investmentType||!$scope.hasEmptyInitialPurchaseValue)&&$scope.initData.initialPurchase,$scope.readProspectus=!1,$scope.quantityType="shares",$scope.spinnerStep=".01",$scope.bonusTrades=null,$scope.unknownSymbolQuote=!1,$scope.inputSymbolComm={},$scope.inputExchangeSymbolComm={},$scope.previewOrderId="";var skipReset=!($scope.EMPTY_VALUE="EMPTY_VALUE"),processLabels=function(){$scope.hasOwnProperty("labelsObj")&&($scope.labels=php.array_merge($scope.labelsObj,$scope.labelsObj[$scope.investmentType+"Labels"])),$scope.inputSymbolComm.investmentType=$scope.investmentType,$scope.inputSymbolComm.placeholder=$scope.labels.symbolPlaceholder,$scope.inputExchangeSymbolComm.investmentType=$scope.investmentType,$scope.inputExchangeSymbolComm.placeholder=$scope.labels.exchangeToSymbolPlaceholder};labels.setupLabels($scope,["tradeWidget","orderStatusTypes"],{}).then(function(result){$scope.labelsObj=$scope.labels,processLabels()});var recalcTimeout=null,internalRecalc=function(){switch($scope.price){case"2":case"4":$scope.sharePx=$scope.limit;break;case"3":$scope.sharePx=$scope.stop;break;default:$scope.sharePx=$scope.lastPx}switch("Option"==$scope.investmentType&&($scope.contractSize?$scope.sharePx*=$scope.contractSize:$scope.sharePx*=100),$scope.estimatedCost=$scope.qty*$scope.sharePx,"MutualFund"==$scope.investmentType?("dollars"==$scope.quantityType&&"L"!=$scope.side&&"X"!=$scope.side?$scope.estimatedCost=$scope.fundQty:$scope.estimatedCost=$scope.fundQty*$scope.sharePx,$scope.qty=Math.floor($scope.fundQty),0<$scope.fundQty&&0===$scope.qty&&($scope.qty=1)):$scope.fundQty=1,$scope.side){case"1":case"5":case"BTO":case"STO":"MutualFund"==$scope.investmentType&&"dollars"==$scope.quantityType&&0<$scope.fundsAvail?$scope.maxShares=$scope.fundsAvail:0<$scope.fundsAvail&&$scope.sharePx?$scope.maxShares=Math.floor($scope.fundsAvail/$scope.sharePx):$scope.maxShares=0,$scope.balances?$scope.insufficientFunds=$scope.estimatedCost>$scope.fundsAvail:$scope.insufficientFunds=!1,$scope.insufficientShares=!1;break;case"C":case"BTC":$scope.maxShares=Math.max(0,$scope.currentShortShares),$scope.insufficientFunds=!1,$scope.holdings?$scope.insufficientShares=$scope.qty>$scope.maxShares:$scope.insufficientShares=!1;break;case"2":case"STC":case"Y":$scope.maxShares=Math.max(0,$scope.currentShares),$scope.insufficientFunds=!1,$scope.holdings?"MutualFund"==$scope.investmentType&&"dollars"==$scope.quantityType?($scope.insufficientShares=$scope.fundQty>$scope.currentShares*$scope.sharePx,$scope.maxShares=Math.max(0,$scope.currentShares*$scope.sharePx)):"MutualFund"==$scope.investmentType?$scope.insufficientShares=$scope.fundQty>$scope.currentShares:$scope.insufficientShares=$scope.qty>$scope.currentShares:$scope.insufficientShares=!1;break;case"L":case"X":$scope.holdings?$scope.maxShares=$scope.fundQty=Math.max(0,$scope.currentShares):$scope.maxShares=1,$scope.qty=Math.floor($scope.maxShares),$scope.fundQty=$scope.maxShares,$scope.insufficientShares=0===$scope.fundQty,0<$scope.fundQty&&0===$scope.qty&&($scope.qty=1)}skipReset=!1,triggerResize()};$scope.recalculate=function(){$timeout.cancel(recalcTimeout),recalcTimeout=$timeout(internalRecalc,250)};var resizeTimeout=null;triggerResize=function(){$timeout.cancel(resizeTimeout),resizeTimeout=$timeout(function(){eventDispatcher.trigger("RESIZE",{source:$scope.id})},100)};var modalInit=!(this.init=$scope.init=function(data,noReset){return data&&data.hasOwnProperty("investmentType")&&data.investmentType?(!angular.isUndefined(noReset)&&noReset||$scope.reset(!1),$scope.investmentType=data.investmentType,angular.isString(data.exchangeToSymbol)&&data.exchangeToSymbol?eventDispatcher.trigger($scope.symbolEvent,{symbolList:[data.symbol,data.exchangeToSymbol],investmentType:$scope.investmentType,origin:"sviTradeWidget"}):eventDispatcher.trigger($scope.symbolEvent,{symbol:data.symbol,investmentType:$scope.investmentType,origin:"sviTradeWidget"}),"place"!==$scope.mode?($scope.allowAccountEdit=!1,$scope.allowSymbolEdit=!1,"edit"==$scope.mode?$scope.allowQtyEdit=svi.ng.strToBoolean($scope.options.allowQtyEditOnEdit,!0):$scope.allowQtyEdit=!1):(data.hasOwnProperty("account")?($scope.account=data.account,$scope.allowAccountEdit=!1):($scope.account=accountList.getCurrentAccountIndex(),$scope.allowAccountEdit=!0),$scope.allowAccountEdit=svi.ng.strToBoolean(data.allowAccountEdit,$scope.allowAccountEdit),$scope.allowSymbolEdit=svi.ng.strToBoolean(data.allowSymbolEdit,$scope.allowSymbolEdit),$scope.allowQtyEdit=!0),$scope.symbol=data.symbol,"MutualFund"==data.investmentType&&data.qty&&!data.fundQty&&(data.fundQty=data.qty),data.side?$scope.side=data.side:"Option"==$scope.investmentType?$scope.side="BTO":$scope.side="1",!data.hasOwnProperty("exchangeToSymbol")||"X"!=$scope.side&&"Y"!=$scope.side||($scope.exchangeToSymbol=data.exchangeToSymbol),$scope.price=data.price?data.price:"1",data.limit&&($scope.limit=data.limit),data.stop&&($scope.stop=data.stop),$scope.timeInForce=data.hasOwnProperty("timeInForce")?data.timeInForce:"0",$scope.instructions=data.instructions?data.instructions:"",$scope.disposalMethod=data.disposalMethod?data.disposalMethod:"",$scope.reinvestDiv=!!data.reinvestDiv,$scope.reinvestCap=!!data.reinvestCap,$scope.initialPurchase=$scope.hasEmptyInitialPurchaseValue&&"MutualFund"===$scope.investmentType&&$scope.isBuySide()&&"edit"!==$scope.mode?$scope.EMPTY_VALUE:!!data.initialPurchase,$scope.readProspectus=0==$scope.options.showProspectus||!!data.readProspectus,$scope.quantityType=data.quantityType?data.quantityType:"shares",$scope.options.quantityTypeHideSharesForBuy&&"1"==$scope.side&&($scope.quantityType="dollars"),$scope.qty=data.qty?Math.floor(Math.abs(data.qty)):0,$scope.fundQty=data.fundQty?Math.abs(data.fundQty):0,skipReset=!0,$scope.visible=!0,$scope.loadBalances(),$scope.loadHoldings(),piwik.trackPage("tradeWidget","Trade Widget",!1,[{name:"symbol",value:$scope.symbol},{name:"investmentType",value:$scope.investmentType}]),!0):($log.fatal("Trade Widget could not be started because investment type was not specified.",data),!1)});"Modal"==$scope.template&&eventDispatcher.on("TRADEWIDGET.SHOW",function(e,data){$scope.init(data)&&(modalInit?$element.find(".tradeWidget").modal("show"):(modalInit=!0,$element.find(".tradeWidget").modal({backdrop:!1,show:!0}).draggable({handle:".modal-content"})),$scope.options.hasEmptyInitialPurchaseValue&&"MutualFund"===data.investmentType&&$scope.isBuySide()&&($scope.hasEmptyInitialPurchaseValue=!0))},!0,$element),eventDispatcher.on("QUOTE.LOADED",function(event,data){var currentSymbol=$scope.symbol.replace(/\//gi,"");"X"!=$scope.side&&"Y"!=$scope.side||!$scope.exchangeToSymbol||(currentSymbol+=","+$scope.exchangeToSymbol),angular.isObject(data)&&data.success&&data.currentSymbol==currentSymbol&&angular.isObject(data.symbolQuote)&&0<data.symbolQuote.instrumentQuotes.length&&($scope.quote=data.symbolQuote.instrumentQuotes,$scope.quote[0].unknownSymbol?($scope.lastPx=0,$scope.contractSize=100,$scope.unknownSymbolQuote=!0,$scope.underlyingSymbol=""):($scope.unknownSymbolQuote=!1,$scope.options.prefillLimitPrice&&$scope.limit==$scope.lastPx&&($scope.limit=""),"Option"==$scope.investmentType?($scope.underlyingSymbol=$scope.quote[0].undly.symbol,$scope.contractSize=$scope.quote[0].quote.extendedQuote.contractSize):($scope.underlyingSymbol=$scope.quote[0].instrument.symbol,$scope.contractSize=100),$scope.lastPx=$scope.quote[0].quote.lastPrice,$scope.options.prefillLimitPrice&&"2"==$scope.price&&!$scope.limit&&($scope.limit=$scope.lastPx=parseFloat($filter("number")($scope.lastPx,$scope.lastPx<1?4:2).replace(/,/g,"")))))},!0,$element),$scope.investToQty=function(){if($scope.allowQtyEdit&&$scope.investAmount&&$scope.sharePx){var amount=parseFloat($scope.investAmount);isNaN(amount)||($scope.qty=Math.floor(amount/$scope.sharePx),svi.ui.pulse($element.find(".quantity input")),piwik.trackEvent("Trade Widget","Invest to Qty"))}},$scope.maxSharesToQty=function(){$scope.allowQtyEdit&&($scope.qty=Math.floor($scope.maxShares),svi.ui.pulse($element.find(".quantity input")),piwik.trackEvent("Trade Widget","Max Shares to Qty"))},$scope.maxSharesToFundQty=function(){$scope.allowQtyEdit&&($scope.fundQty=$scope.maxShares,svi.ui.pulse($element.find(".fundQuantity input")),piwik.trackEvent("Trade Widget","Max Shares to Qty"))};var orderStatusUrlCallback=function(response){response.data.success?$scope.options.orderStatusUrl=svi.url.getHost()+response.data.url:getOrderStatusUrl()},getOrderStatusUrl=function(){navigation.getLaminasUrl($scope.options.orderStatusUrl).then(orderStatusUrlCallback)};$scope.showBalancesLoader=function(){return!$scope.balances&&$scope.isBuySide()!=$scope.isShortSide()},$scope.showHoldingsLoader=function(){return!($scope.holdings||$scope.isSellSide()==$scope.isShortSide()||!$scope.symbol)},$scope.showSharesToQtyButton=function(){return!!($scope.holdings&&$scope.isSellSide()!=$scope.isShortSide()||$scope.balances&&$scope.isBuySide()!=$scope.isShortSide())},$scope.showEstimatedCostCalculation=function(){return($scope.isBuySide()||$scope.isSellSide())&&0<$scope.estimatedCost},$scope.showInvestAmount=function(){return!1},$scope.showQuantityTypeDropdown=function(){return("2"==$scope.side||"Y"==$scope.side)&&"MutualFund"==$scope.investmentType},$scope.showBonusTrades=function(){return"Stock"==$scope.investmentType&&$scope.bonusTrades&&$scope.bonusTrades.wasEligible},$scope.showTradeDisclosure=function(){return $scope.options.showDisclosures&&(!!$scope.getTradeDisclosure()||$scope.options.disclosuresSection)},$scope.getTradeDisclosure=function(){var isCash=!$scope.isMarginAccount,isMargin=$scope.isMarginAccount;if($scope.options.showDisclosures&&($scope.balances&&$scope.options.disclosureRules&&"object"==typeof $scope.options.disclosureRules))return Object.keys($scope.options.disclosureRules).find(function(key){var shouldDisplayDislosure=!1;return(!($scope.options.disclosureRules[key].balances&&$scope.options.disclosureRules[key].balances.field&&$scope.options.disclosureRules[key].balances.value)||(Array.isArray($scope.options.disclosureRules[key].balances.value)&&(shouldDisplayDislosure=$scope.options.disclosureRules[key].balances.value.includes($scope.balances[$scope.options.disclosureRules[key].balances.field])),shouldDisplayDislosure=$scope.balances[$scope.options.disclosureRules[key].balances.field]===$scope.options.disclosureRules[key].balances.value))&&(!($scope.options.disclosureRules[key].session&&!(shouldDisplayDislosure=$scope.options.disclosureRules[key].session.isCashAccount&&isCash||$scope.options.disclosureRules[key].session.isMarginAccount&&isMargin))&&shouldDisplayDislosure)})},$scope.isBuySide=function(){return $scope.isBuy($scope.side)},$scope.isSellSide=function(){return $scope.isSell($scope.side)},$scope.isShortSide=function(){return $scope.isShort($scope.side)},$scope.isBuy=function(code){return"1"==code||"Y"==code||"BTO"==code||"BTC"==code||"C"==code},$scope.isSell=function(code){return"2"==code||"5"==code||"STO"==code||"STC"==code||"L"==code},$scope.isShort=function(code){return"5"==code||"C"==code||"STO"==code||"BTC"==code||"Y"==code},$scope.showQuantityTypeDollars=function(){return"dollars"==$scope.quantityType},$scope.showDisposalMethodDropdown=function(){return!!$scope.options.disposalMethodDropdown&&(("2"==$scope.side||"C"==$scope.side)&&"Stock"===$scope.investmentType||("L"==$scope.side||"2"==$scope.side||"X"==$scope.side)&&"MutualFund"==$scope.investmentType)},$scope.clearField=function(field,onlyIfFalsy,event){angular.isUndefined(onlyIfFalsy)&&(onlyIfFalsy=!1),$scope.hasOwnProperty(field)&&(onlyIfFalsy&&$scope[field]&&"0"!==$scope[field]?onlyIfFalsy&&"limit"==field&&$scope.options.prefillLimitPrice&&$scope.limit==$scope.lastPx&&(angular.isUndefined(event.toElement)?$scope.tradingForm.limit.$pristine&&($scope[field]=""):$scope.tradingForm.limit.$pristine&&$scope.limit==event.toElement.valueAsNumber&&($scope[field]="")):$scope[field]="")},$scope.focusSelect=function(event){event.target.select()},$scope.showTitle=function(){var showTitle=!$scope.symbol||!$scope.tradingForm.symbol.$valid;return $scope.unknownSymbolQuote&&(showTitle=!1),showTitle},$scope.$watch("investAmount",$scope.investToQty),$scope.$watch("qty",$scope.recalculate),$scope.$watch("fundQty",$scope.recalculate),$scope.$watch("fundsAvail",$scope.recalculate),$scope.$watch("holdings",$scope.recalculate),$scope.$watch("currentShares",$scope.recalculate),$scope.$watch("currentShortShares",$scope.recalculate),$scope.$watch("limit",$scope.recalculate),$scope.$watch("stop",$scope.recalculate),$scope.$watch("quantityType",$scope.recalculate),$scope.$watch("price",function(){"1"==$scope.price&&($scope.timeInForce="0"),$scope.recalculate()}),$scope.$watch("investmentType",function(){$scope.options=getOptions(),svi.permissions.advancedTrading||($scope.options.advancedOrdersUrl=!1),angular.isString($scope.options.orderStatusUrl)||getOrderStatusUrl(),setOptionQtyType(),processLabels()}),$scope.$watch("side",function(newVal,oldVal){"1"!=$scope.side&&"2"!=$scope.side&&"L"!=$scope.side||"MutualFund"!=$scope.investmentType||($scope.exchangeToSymbol=""),$scope.hasEmptyInitialPurchaseValue&&"MutualFund"===$scope.investmentType&&($scope.initialPurchase="1"===newVal&&$scope.EMPTY_VALUE,$scope.hasInitialPurchaseError=!1),$scope.fundQty=0,$scope.disposalMethod="",setOptionQtyType(),$scope.recalculate()}),$scope.$watch("lastPx",function(newVal,oldVal){$scope.recalculate(),$scope.spinnerStep=$scope.lastPx<1?".0001":".01"}),eventDispatcher.on("ACCOUNT.CONTEXT.CHANGED",function(event,data){$scope.account=data.index},!0,$element),eventDispatcher.on("ACCOUNT.FILTERED",function(event,data){$scope.account=null},!0,$element),eventDispatcher.on($scope.symbolEvent,function(event,data){data.hasOwnProperty("origin")&&"sviTradeWidget"==data.origin||(angular.isUndefined(data.symbol)||$scope.symbol==data.symbol)&&!angular.isArray(data.symbolList)||(angular.isArray(data.symbolList)?0<data.symbolList.length&&($scope.symbol=data.symbolList[0],1<data.symbolList.length&&($scope.exchangeToSymbol=data.symbolList[1])):$scope.symbol=data.symbol)},!1,$element),eventDispatcher.on("TRADEWIDGET.QUANTITY.TYPE.FILTER.CHANGED",function(event,data){data&&data.hasOwnProperty("value")&&data.value&&$scope.quantityType!==data&&$scope.allowQtyEdit&&($scope.quantityType=data.value,$scope.clearField("fundQty",!1),$scope.clearField("qty",!1))},!1,$element),eventDispatcher.on("TRADEWIDGET.INITIAL.PURCHASE.FILTER.CHANGED",function(event,data){data&&data.hasOwnProperty("value")&&$scope.initialPurchase!==data&&($scope.hasEmptyInitialPurchaseValue&&"MutualFund"===$scope.investmentType&&$scope.isBuySide()&&($scope.hasInitialPurchaseError=data.value===$scope.EMPTY_VALUE),$scope.initialPurchase=data.value,!1===data.value&&$scope.options.reinvestRequiresInitialPurchase&&($scope.clearField("reinvestDiv",!1),$scope.clearField("reinvestCap",!1)))},!1,$element);var processResponse=function(response){return!!response.success&&($scope.warnings=response.order.warnings,$scope.errors=response.order.errors,$scope.orderId=response.order.orderID,$scope.orderStatus=response.order.orderStatus,$scope.commission=response.order.commission,$scope.postage=response.order.postage,$scope.principal=response.order.principal,$scope.tradeValue=response.order.tradeValue,$scope.useTradingPassword=response.useTradingPassword,response.hasOwnProperty("submitData")?($scope.account!=response.submitData.accountIndex&&($scope.account=response.submitData.accountIndex),$scope.accountDisplay=accountList.getAccountsWithNicknames()[$scope.account],$scope.side=response.submitData.action,$scope.timeInForce=response.submitData.duration,"Option"==response.submitData.instrument.investmentType?$scope.symbol=response.submitData.instrument.origSymbol:$scope.symbol=response.submitData.instrument.symbol,$scope.price=response.submitData.orderType,$scope.qty=response.submitData.quantity,$scope.quantityType=response.submitData.quantityType,$scope.limit=response.submitData.price,$scope.stop=response.submitData.stopPrice,$scope.instructions=response.submitData.instructions,$scope.disposalMethod=response.submitData.disposalMethod,$scope.reinvestDiv=response.submitData.reinvestDividends,$scope.reinvestCap=response.submitData.reinvestCapitalGains,$scope.initialPurchase=response.submitData.initialPurchase,$scope.readProspectus=response.submitData.readProspectus):response.hasOwnProperty("submitParams")&&($scope.account!=response.submitParams.accountIndex&&($scope.account=response.submitParams.accountIndex),$scope.accountDisplay=accountList.getAccountsWithNicknames()[$scope.account]),response.order.instrumentQuote&&($scope.quote[0]=response.order.instrumentQuote,eventDispatcher.trigger("QUOTE.LOADED",{currentSymbol:$scope.symbol,delayed:"false",success:!0,symbolQuote:{errors:[],warnings:[],instrumentQuotes:$scope.quote,status:{statusCode:"",statusMessage:""}},origin:"sviTradeWidget"})),!0)};this.preview=$scope.preview=function(){null===$scope.account||$scope.tradingForm.$invalid||$scope.submitLoader.showSpinner||$scope.hasEmptyInitialPurchaseValue&&"MutualFund"===$scope.investmentType&&$scope.isBuySide()&&$scope.initialPurchase===$scope.EMPTY_VALUE?$scope.formInvalidMsg=$scope.labels.formInvalidMsg:($scope.submitLoader.labels.loading=$scope.labels.previewingTrade,$scope.submitLoader.setLoadHandler(previewCallback).load().then(onPreviewSuccess,onPreviewError),piwik.trackEvent("Trade Widget","Preview",$scope.symbol),triggerResize())};var getSubmitData=function(preview){var securityType,quantity=$scope.tradingForm.qty.$modelValue;switch($scope.investmentType){case"Stock":securityType="CommonStock";break;case"MutualFund":securityType="MutualFund",quantity=$scope.tradingForm.fundQty.$modelValue;break;default:securityType=$scope.investmentType}var data={params:{preview:preview?"true":"false",previewOrderId:$scope.previewOrderId},account:$scope.tradingForm.currentAccount.$modelValue,action:$scope.tradingForm.side.$modelValue,quantity:quantity,quantityType:$scope.tradingForm.quantityType.$modelValue,instrument:{symbol:$scope.symbol,securityType:securityType,investmentType:$scope.investmentType},orderType:$scope.tradingForm.price.$modelValue,duration:$scope.tradingForm.timeInForce.$modelValue,instructions:$scope.tradingForm.instructions.$modelValue,reinvestDividends:$scope.tradingForm.reinvestDiv.$modelValue,reinvestCapitalGains:$scope.tradingForm.reinvestCap.$modelValue,initialPurchase:$scope.tradingForm.initialPurchase.$modelValue,readProspectus:!$scope.options.showProspectus||$scope.tradingForm.readProspectus.$modelValue,disposalMethod:$scope.tradingForm.disposalMethod.$modelValue};switch($scope.price){case"2":data.price=$scope.tradingForm.limit.$modelValue;break;case"3":data.stopPrice=$scope.tradingForm.stop.$modelValue;break;case"4":data.price=$scope.tradingForm.limit.$modelValue,data.stopPrice=$scope.tradingForm.stop.$modelValue}return"Y"!==$scope.side&&"X"!==$scope.side||(data.exchangeForSymbol=$scope.tradingForm.exchangeToSymbol.$modelValue),preview||(data.params.overrideWarnings=$scope.tradingForm.overrideWarnings.$viewValue?"true":"false",$scope.useTradingPassword&&(data.params.transactionPassword=$scope.tradingForm.tradingPassword.$modelValue)),data},previewCallback=function(){return"edit"==$scope.mode?orders.edit($scope.origOrderId,getSubmitData(!0)):orders.create(getSubmitData(!0))},onPreviewSuccess=function(response){processResponse(response)&&0===$scope.errors.length&&($scope.orderStep="preview"),$scope.orderId="",$scope.previewOrderId=response.order.previewOrderId,$scope.orderStatus="",triggerResize()},onPreviewError=function(reason){reason&&reason.data&&reason.data.order&&reason.data.order.status&&reason.data.order.status.statusMessage&&($scope.submitLoader.setError(reason.data.order.status.statusMessage),$scope.submitLoader.setMessage(!1),$scope.previewOrderId=reason.data.order.previewOrderId),triggerResize()};this.submit=$scope.submit=function(){null===$scope.account||$scope.tradingForm.$invalid||$scope.submitLoader.showSpinner?$scope.formInvalidMsg=$scope.labels.formInvalidMsg:($scope.submitLoader.labels.loading=$scope.labels.submittingTrade,$scope.submitLoader.setLoadHandler(submitCallback).load().then(onSubmitSuccess,onSubmitError),piwik.trackEvent("Trade Widget","Submit",$scope.symbol),triggerResize())};var submitCallback=function(){if("edit"==$scope.mode)return orders.edit($scope.origOrderId,getSubmitData(!1));if("cancel"!=$scope.mode)return orders.create(getSubmitData(!1));var params={overrideWarnings:$scope.tradingForm.overrideWarnings.$viewValue?"true":"false"};return $scope.useTradingPassword&&(params.transactionPassword=$scope.tradingForm.tradingPassword.$modelValue),orders.cancel($scope.origOrderId,params)},onSubmitSuccess=function(response){processResponse(response)&&0===$scope.warnings.length&&0===$scope.errors.length&&($scope.orderStep="confirm"),triggerResize()},onSubmitError=function(reason){reason&&reason.data&&reason.data.order&&reason.data.order.status&&reason.data.order.status.statusMessage&&($scope.submitLoader.setError(reason.data.order.status.statusMessage),$scope.submitLoader.setMessage(!1)),triggerResize()};$scope.advancedOrder=function(){piwik.trackEvent("Trade Widget","Advanced Order",$scope.symbol),$scope.formAction=$scope.options.advancedOrdersUrl,$timeout(function(){$element.find("form").submit()})},this.close=$scope.close=function(){piwik.trackEvent("Trade Widget","Close"),$($element.find(".tradeWidget")).modal("hide"),$scope.visible=!1,$scope.reset(!1,!0)},$scope.disclosures=function(){var tmpl;switch($scope.investmentType){case"MutualFund":tmpl="FUND_TRADE_ENTER";break;case"Option":tmpl="OPTION_TRADE_ENTER";break;default:case"Stock":tmpl="STOCK_TRADE_ENTER"}var disclosure=$scope.getTradeDisclosure();screenText.displayModal(tmpl,disclosure||$scope.options.disclosuresSection,$scope.id,$scope.labels.tradeDisclosure)},$scope.invalidSymbolFormClear=function(){$scope.lastPx=0,$scope.sharePx=0,$scope.qty=0,$scope.unknownSymbolQuote=!1,$scope.tradingForm.qty.$setPristine(),$scope.tradingForm.qty.$setUntouched(),$scope.fundQty=0,$scope.tradingForm.fundQty.$setPristine(),$scope.tradingForm.fundQty.$setUntouched(),$scope.limit="",$scope.tradingForm.limit.$setPristine(),$scope.tradingForm.limit.$setUntouched(),$scope.visible&&(eventDispatcher.trigger("QUOTE.ACTION.CLEAR"),eventDispatcher.trigger($scope.symbolEvent,{symbol:"",underlying:"",investmentType:$scope.investmentType,origin:"sviTradeWidget"}))},this.reset=$scope.reset=function(keepSymbol,closing){keepSymbol&&skipReset?skipReset=!1:(angular.isUndefined(keepSymbol)&&(keepSymbol=!$scope.allowSymbolEdit),angular.isUndefined(closing)&&(closing=!1),"cancel"==$scope.mode?($scope.orderStep="preview",$scope.accountDisplay=accountList.getAccountsWithNicknames()[$scope.account]):$scope.orderStep="entry",$scope.submitLoader&&$scope.submitLoader.clearAllMessages(),keepSymbol||($scope.id=php.uniqid("tradewidget"),$scope.symbol="",$scope.exchangeToSymbol="",$scope.contractSize=100,"Option"==$scope.investmentType?$scope.side="BTO":$scope.side="1",$scope.timeInForce="0",$scope.lastPx=0,$scope.maxShares=0,$scope.sharePx=0,$scope.unknownSymbolQuote=!1,$scope.tradingForm.limit.$setPristine(),$scope.tradingForm.limit.$setUntouched(),$scope.tradingForm.$setPristine(),$scope.tradingForm.$setUntouched(),$scope.holdings=null,$scope.currentShares=0,$scope.currentShortShares=0),$scope.price="1",$scope.tradingForm.price.$setPristine(),$scope.tradingForm.price.$setUntouched(),$scope.investAmount="",$scope.tradingForm.investAmount.$setPristine(),$scope.tradingForm.investAmount.$setUntouched(),$scope.allowQtyEdit&&($scope.qty=0,$scope.tradingForm.qty.$setPristine(),$scope.tradingForm.qty.$setUntouched(),$scope.fundQty=0,$scope.tradingForm.fundQty.$setPristine(),$scope.tradingForm.fundQty.$setUntouched()),$scope.timeInForce="0",$scope.tradingForm.timeInForce.$setPristine(),$scope.tradingForm.timeInForce.$setUntouched(),$scope.limit=keepSymbol&&"2"==$scope.price&&$scope.options.prefillLimitPrice&&$scope.lastPx?$scope.lastPx:"",$scope.tradingForm.limit.$setPristine(),$scope.tradingForm.limit.$setUntouched(),$scope.stop="",$scope.tradingForm.stop.$setPristine(),$scope.tradingForm.stop.$setUntouched(),$scope.instructions="",$scope.tradingForm.instructions.$setPristine(),$scope.tradingForm.instructions.$setUntouched(),$scope.hasEmptyInitialPurchaseValue&&"MutualFund"===$scope.investmentType?($scope.initialPurchase=$scope.EMPTY_VALUE,$scope.hasInitialPurchaseError=!1):$scope.initialPurchase=!1,$scope.tradingForm.initialPurchase.$setPristine(),$scope.tradingForm.initialPurchase.$setUntouched(),$scope.reinvestDiv=!1,$scope.tradingForm.reinvestDiv.$setPristine(),$scope.tradingForm.reinvestDiv.$setUntouched(),$scope.reinvestCap=!1,$scope.tradingForm.reinvestCap.$setPristine(),$scope.tradingForm.reinvestCap.$setUntouched(),$scope.readProspectus=!1,$scope.options.showProspectus?($scope.tradingForm.readProspectus.$setPristine(),$scope.tradingForm.readProspectus.$setUntouched()):$scope.readProspectus=!0,$scope.tradingPassword="",$scope.tradingForm.tradingPassword.$setPristine(),$scope.tradingForm.tradingPassword.$setUntouched(),$scope.overrideWarnings=!1,$scope.tradingForm.overrideWarnings.$setPristine(),$scope.tradingForm.overrideWarnings.$setUntouched(),(closing||"MutualFund"!=$scope.investmentType||"dollars"!=$scope.quantityType)&&($scope.quantityType="shares"),$scope.disposalMethod="",$scope.tradingForm.disposalMethod.$setPristine(),$scope.tradingForm.disposalMethod.$setUntouched(),$scope.warnings=[],$scope.errors=[],$scope.orderId="",$scope.orderStatus="",$scope.commission="",$scope.postage="",$scope.principal="",$scope.tradeValue="",$scope.estimatedCost=0,"place"!=$scope.mode&&$scope.init($scope.initData,!0))},$scope.modify=function(){piwik.trackEvent("Trade Widget","Modify"),$scope.orderStep="entry",$scope.overrideWarnings=!1,$scope.warnings=[],$scope.errors=[],$scope.recalculate()},$scope.showOrderStatus=function(){piwik.trackEvent("Trade Widget","Order Status");var url=$scope.options.orderStatusUrl;$scope.orderId&&(url=url+"?orderId="+encodeURIComponent($scope.orderId)),sviUrl.href(url)},$scope.setBalancesLoader=function(loader){$scope.balancesLoader=loader},$scope.setHoldingsLoader=function(loader){$scope.holdingsLoader=loader},$scope.setSubmitLoader=function(loader){$scope.submitLoader=loader};var loadBalancesTimeout=null;$scope.loadBalances=function(){loadBalancesTimeout&&$timeout.cancel(loadBalancesTimeout),$scope.visible&&null!==$scope.account&&$scope.balancesLoader?$scope.balancesLoader.setLoadHandler(loadBalancesCallback).load().then(onBalancesSuccess,onError):loadBalancesTimeout=$timeout($scope.loadBalances,250)};var loadBalancesCallback=function(){return $scope.balances=null,$scope.fundsAvail=0,$scope.buyingPower=null,$scope.buyingPowerLabel=null,balances.getTradingBalances($scope.account)},onBalancesSuccess=function(response){if(response&&angular.isObject(response)&&response.hasOwnProperty("success")&&response.success&&($scope.balances=response.tradingBalances.tradingBalance[0],$scope.bonusTrades=response.bonusTrades,$scope.isMarginAccount=response.isMarginAccount),$scope.balances)if($scope.initData.hasAdvancedFundsDisplay){var availableFundsData=function(isMargin,investmentType,balances){var data={fundsAvail:balances.cashEquiv,fundsAvailLabel:$scope.labels.fundsAvailable};switch(investmentType){case"Stock":isMargin&&(data.buyingPower=0<balances.stockBuyingPower?balances.stockBuyingPower:0,data.buyingPowerLabel=$scope.labels.stockBuyingPower);break;case"Option":data.buyingPower=0<balances.optionsBuyingPower?balances.optionsBuyingPower:0,data.buyingPowerLabel=$scope.labels.optionBuyingPower}return data}($scope.isMarginAccount,$scope.investmentType,$scope.balances);$scope.fundsAvail=availableFundsData.fundsAvail,$scope.fundsAvailLabel=availableFundsData.fundsAvailLabel,(availableFundsData.buyingPower||0===availableFundsData.buyingPower)&&($scope.buyingPower=availableFundsData.buyingPower,$scope.buyingPowerLabel=availableFundsData.buyingPowerLabel)}else{switch($scope.investmentType){case"Stock":$scope.fundsAvail=$scope.balances.stockBuyingPower,$scope.fundsAvailLabel=$scope.labels.stockBuyingPower;break;case"Option":$scope.fundsAvail=$scope.balances.optionsBuyingPower,$scope.fundsAvailLabel=$scope.labels.optionBuyingPower;break;case"MutualFund":$scope.fundsAvail=$scope.balances.cashEquiv,$scope.fundsAvailLabel=$scope.labels.fundsAvailable}0===$scope.fundsAvail&&($scope.fundsAvail=$scope.balances.cashEquiv,$scope.fundsAvailLabel=$scope.labels.fundsAvailable)}};$scope.$watch("investmentType",onBalancesSuccess);var loadHoldingsTimeout=null;$scope.loadHoldings=function(){angular.isDefined($scope.symbol)&&""!==$scope.symbol&&(loadHoldingsTimeout&&$timeout.cancel(loadHoldingsTimeout),$scope.visible&&null!==$scope.account&&$scope.holdingsLoader?$scope.holdingsLoader.setLoadHandler(loadHoldingsCallback).load().then(onHoldingsSuccess,onError):loadHoldingsTimeout=$timeout($scope.loadHoldings,250))};var loadHoldingsCallback=function(){$scope.holdings=null,$scope.currentShares=0,$scope.currentShortShares=0;var data={filterField:["instrument.symbol"],filterValue:[[$scope.symbol]]};return holdings.getHoldings($scope.account,data)},onHoldingsSuccess=function(response){var position;$scope.holdings=[],$scope.currentShares=0;for(var i=$scope.currentShortShares=0;i<response.holdings.positions.length;i++)response.holdings.positions[i].instrument.symbol==$scope.symbol&&(position=response.holdings.positions[i],$scope.holdings.push(position),("Short"==position.accountType||position.qty<0)&&($scope.currentShortShares-=position.qty),0<position.qty&&($scope.currentShares+=position.qty))},onError=function(reason){};(this.scope=$scope).api=this,$scope.popover=null,this.getPopover=function(){if(!$scope.popover){var el=$element.find(".info-link");$scope.popover=$popover(el,{container:".svi-bs .modals-section",placement:"bottom",trigger:"manual",autoClose:!1,templateUrl:"tradeWidget/popover.tpl.html",id:"info-popover",parentId:"info-link-id"}),$scope.popover.$scope.id="info-popover",$scope.popover.$scope.api=$scope.api,$scope.popover.$scope.parentId="info-link-id",$scope.popover.$scope.symbols=MARKET_INFO}return $scope.popover},this.showPopover=function(){$scope.api.getPopover().$promise.then(function(){$scope.popover.show(),$timeout(function(){$scope.popover.$applyPlacement()})})},this.hideQuote=function(){$scope.api.getPopover().$promise.then($scope.popover.hide)}}],link:function($scope,$element,$attrs){var template=$templateCache.get("tradeWidget/tradeWidget"+$scope.template+".tpl.html"),formTmpl=$templateCache.get("tradeWidget/tradeWidgetTradingForm.tpl.html");$element.html(template.replace("%TRADING_FORM%",formTmpl)).show(),$compile($element.contents())($scope),"Modal"!=$scope.template&&$timeout(function(){$scope.init($scope.initData)},200);var inputSymbolCtrl=$element.find('div[data-ng-model="symbol"] .svi-input-symbol').controller("sviInputSymbol"),inputExchangeToSymbolCtrl=$element.find('div[data-ng-model="exchangeToSymbol"] .svi-input-symbol').controller("sviInputSymbol");$scope.$watchGroup(["quote","side"],function(newValue,oldValue){newValue!==oldValue&&($scope.tradingForm.symbol.$validate(),$scope.tradingForm.exchangeToSymbol.$validate())},!0),$scope.$watch("warnings",function(newValue,oldValue){newValue!==oldValue&&$scope.tradingForm.overrideWarnings.$validate()},!0);var addValidators=function(){$scope.tradingForm?($scope.tradingForm.symbol.$validators.symbolRegexTW=function(modelValue,viewValue){var value=modelValue||viewValue;return!(inputSymbolCtrl&&!inputSymbolCtrl.isValid(value))},$scope.tradingForm.symbol.$validators.unknownSymbol=function(modelValue,viewValue){var value=modelValue||viewValue;return!($scope.quote&&0<$scope.quote.length&&$scope.quote[0].instrument.symbol==value&&$scope.quote[0].unknownSymbol)},$scope.tradingForm.exchangeToSymbol.$validators.symbolRegexTW=function(modelValue,viewValue){var value=modelValue||viewValue;if("X"==$scope.side||"Y"==$scope.side){if(inputExchangeToSymbolCtrl&&!inputExchangeToSymbolCtrl.isValid(value))return!1}else inputExchangeToSymbolCtrl&&inputExchangeToSymbolCtrl.setValid(!0);return!0},$scope.tradingForm.exchangeToSymbol.$validators.unknownSymbol=function(modelValue,viewValue){var value=modelValue||viewValue;return!($scope.quote&&1<$scope.quote.length&&$scope.quote[1].instrument.symbol==value&&$scope.quote[1].unknownSymbol)},$scope.tradingForm.exchangeToSymbol.$validators.sameSymbol=function(modelValue,viewValue){var value=modelValue||viewValue;return"X"!=$scope.side&&"Y"!=$scope.side||value!=$scope.symbol},$scope.tradingForm.fundQty.$validators.positiveNumber=function(modelValue,viewValue){return!((modelValue||viewValue)<=0)},$scope.tradingForm.stop.$validators.validStop=function(modelValue,viewValue){if("3"!==$scope.price&&"4"!==$scope.price)return!0;var value=modelValue||viewValue;return $scope.lastPx<1?/^\s*(?=.*[1-9])\d*(?:\.\d{1,4})?\s*$/.test(value):/^\s*(?=.*[1-9])\d*(?:\.\d{1,2})?\s*$/.test(value)},$scope.tradingForm.limit.$validators.validLimit=function(modelValue,viewValue){if("2"!==$scope.price&&"4"!==$scope.price)return!0;var value=modelValue||viewValue;return $scope.lastPx<1?/^\s*(?=.*[1-9])\d*(?:\.\d{1,4})?\s*$/.test(value):/^\s*(?=.*[1-9])\d*(?:\.\d{1,2})?\s*$/.test(value)},$scope.tradingForm.overrideWarnings.$validators.required=function(modelValue,viewValue){return!(0<$scope.warnings.length&&!viewValue)}):$timeout(addValidators,250)};$timeout(addValidators);var broadcastSymbolChange=function(){$scope.visible&&(""==$scope.underlyingSymbol&&"Option"==$scope.investmentType&&($scope.underlyingSymbol=$scope.symbol.split(" ")[0]),angular.isString($scope.exchangeToSymbol)&&""!==$scope.exchangeToSymbol?eventDispatcher.trigger($scope.symbolEvent,{symbolList:[$scope.symbol,$scope.exchangeToSymbol],investmentType:$scope.investmentType,origin:"sviTradeWidget"}):eventDispatcher.trigger($scope.symbolEvent,{symbol:$scope.symbol,underlying:$scope.underlyingSymbol,investmentType:$scope.investmentType,origin:"sviTradeWidget"}))};$scope.$watch("account",function(newValue,oldValue){newValue!==oldValue&&null!==newValue&&$scope.visible&&($scope.loadBalances(),$scope.loadHoldings())}),$scope.$watch("symbol",function(newValue,oldValue){newValue!==oldValue&&(null!==newValue&&!1!==newValue||(newValue=""),$scope.underlyingSymbol="",$scope.reset(""!==newValue||"MutualFund"===$scope.investmentType&&""!==$scope.exchangeToSymbol),$scope.allowSymbolEdit?!angular.isFunction(inputSymbolCtrl.isValid)||inputSymbolCtrl.isValid()?(broadcastSymbolChange(),$scope.loadHoldings()):""!==newValue&&$scope.tradingForm.symbol.$valid||$scope.invalidSymbolFormClear():(broadcastSymbolChange(),$scope.loadHoldings()))}),$scope.$watch("exchangeToSymbol",function(newValue,oldValue){newValue!==oldValue&&($scope.reset(!0),""!==$scope.exchangeToSymbol&&angular.isFunction(inputExchangeToSymbolCtrl.isValid)&&!inputExchangeToSymbolCtrl.isValid()||broadcastSymbolChange())}),$scope.$watch("underlyingSymbol",function(newValue,oldValue){newValue!==oldValue&&""!==newValue&&broadcastSymbolChange()})}}}]),angular.module("directives").directive("sviCombinedAgreements",["$templateCache","$compile","$timeout","sviUrl","eventDispatcher","labels","agreements",function($templateCache,$compile,$timeout,sviUrl,eventDispatcher,labels,agreements){return{replace:!1,scope:{template:"@",destination:"@",mode:"@",showUser:"@",showRtq:"@",allowSkipRtq:"@",firstName:"@",lastName:"@",countryUsOnly:"@",countryUsMenu:"@",countryMenu:"@",stateMenu:"@",occupationMenu:"@",validation:"@"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultValidString($scope,$attrs,"template",["Modal","Inline"],"Inline"),svi.ng.defaultValidString($scope,$attrs,"mode",["combined","user","rtq"],"combined"),svi.ng.defaultString($scope,$attrs,"destination",null),svi.ng.defaultTrue($scope,$attrs,"showUser"),svi.ng.defaultTrue($scope,$attrs,"showRtq"),svi.ng.defaultFalse($scope,$attrs,"allowSkipRtq"),svi.ng.defaultString($scope,$attrs,"firstName",""),svi.ng.defaultString($scope,$attrs,"lastName",""),svi.ng.defaultFalse($scope,$attrs,"countryUsOnly"),svi.ng.defaultString($scope,$attrs,"countryUsMenu","[{&quot;display&quot;:&quot;United States&quot;,&quot;value&quot;:&quot;US&quot;}]"),svi.ng.defaultString($scope,$attrs,"countryMenu","[{&quot;display&quot;:&quot;United States&quot;,&quot;value&quot;:&quot;US&quot;},{&quot;display&quot;:&quot;Afghanistan&quot;,&quot;value&quot;:&quot;AF&quot;},{&quot;display&quot;:&quot;Albania&quot;,&quot;value&quot;:&quot;AL&quot;},{&quot;display&quot;:&quot;Algeria&quot;,&quot;value&quot;:&quot;AG&quot;},{&quot;display&quot;:&quot;Andorra&quot;,&quot;value&quot;:&quot;AN&quot;},{&quot;display&quot;:&quot;Angola&quot;,&quot;value&quot;:&quot;AO&quot;},{&quot;display&quot;:&quot;Anguilla&quot;,&quot;value&quot;:&quot;AV&quot;},{&quot;display&quot;:&quot;Antarctica&quot;,&quot;value&quot;:&quot;AY&quot;},{&quot;display&quot;:&quot;Antigua &amp; Barbuda&quot;,&quot;value&quot;:&quot;AC&quot;},{&quot;display&quot;:&quot;Argentina&quot;,&quot;value&quot;:&quot;AR&quot;},{&quot;display&quot;:&quot;Armenia&quot;,&quot;value&quot;:&quot;AM&quot;},{&quot;display&quot;:&quot;Aruba&quot;,&quot;value&quot;:&quot;AA&quot;},{&quot;display&quot;:&quot;Ashmore and Cartier Islands&quot;,&quot;value&quot;:&quot;AT&quot;},{&quot;display&quot;:&quot;Australia&quot;,&quot;value&quot;:&quot;AUS&quot;},{&quot;display&quot;:&quot;Austria&quot;,&quot;value&quot;:&quot;AUT&quot;},{&quot;display&quot;:&quot;Azerbaijan&quot;,&quot;value&quot;:&quot;AJ&quot;},{&quot;display&quot;:&quot;Bahamas, The&quot;,&quot;value&quot;:&quot;BF&quot;},{&quot;display&quot;:&quot;Bahrain&quot;,&quot;value&quot;:&quot;BA&quot;},{&quot;display&quot;:&quot;Baker Island&quot;,&quot;value&quot;:&quot;FQ&quot;},{&quot;display&quot;:&quot;Bangladesh&quot;,&quot;value&quot;:&quot;BG&quot;},{&quot;display&quot;:&quot;Barbados&quot;,&quot;value&quot;:&quot;BB&quot;},{&quot;display&quot;:&quot;Bassas Da India&quot;,&quot;value&quot;:&quot;BS&quot;},{&quot;display&quot;:&quot;Belarus&quot;,&quot;value&quot;:&quot;BO&quot;},{&quot;display&quot;:&quot;Belgium&quot;,&quot;value&quot;:&quot;BE&quot;},{&quot;display&quot;:&quot;Belize&quot;,&quot;value&quot;:&quot;BH&quot;},{&quot;display&quot;:&quot;Benin (Dahomey)&quot;,&quot;value&quot;:&quot;BN&quot;},{&quot;display&quot;:&quot;Bermuda&quot;,&quot;value&quot;:&quot;BD&quot;},{&quot;display&quot;:&quot;Bhutan&quot;,&quot;value&quot;:&quot;BT&quot;},{&quot;display&quot;:&quot;Bolivia&quot;,&quot;value&quot;:&quot;BL&quot;},{&quot;display&quot;:&quot;Bosnia-Herzegovina&quot;,&quot;value&quot;:&quot;BK&quot;},{&quot;display&quot;:&quot;Botswana&quot;,&quot;value&quot;:&quot;BC&quot;},{&quot;display&quot;:&quot;Bouvet Island&quot;,&quot;value&quot;:&quot;BV&quot;},{&quot;display&quot;:&quot;Brazil&quot;,&quot;value&quot;:&quot;BR&quot;},{&quot;display&quot;:&quot;British Indian Ocean Territory&quot;,&quot;value&quot;:&quot;IO&quot;},{&quot;display&quot;:&quot;Brunei&quot;,&quot;value&quot;:&quot;BX&quot;},{&quot;display&quot;:&quot;Bulgaria&quot;,&quot;value&quot;:&quot;BU&quot;},{&quot;display&quot;:&quot;Burkina Faso (Upper Volta)&quot;,&quot;value&quot;:&quot;UV&quot;},{&quot;display&quot;:&quot;Burundi&quot;,&quot;value&quot;:&quot;BY&quot;},{&quot;display&quot;:&quot;Cambodia (Kampuchea)&quot;,&quot;value&quot;:&quot;CB&quot;},{&quot;display&quot;:&quot;Cameroon&quot;,&quot;value&quot;:&quot;CM&quot;},{&quot;display&quot;:&quot;Canada&quot;,&quot;value&quot;:&quot;CA&quot;},{&quot;display&quot;:&quot;Cape Verde&quot;,&quot;value&quot;:&quot;CV&quot;},{&quot;display&quot;:&quot;Cayman Islands&quot;,&quot;value&quot;:&quot;CJ&quot;},{&quot;display&quot;:&quot;Central African Republic&quot;,&quot;value&quot;:&quot;CT&quot;},{&quot;display&quot;:&quot;Chad&quot;,&quot;value&quot;:&quot;CD&quot;},{&quot;display&quot;:&quot;Chile&quot;,&quot;value&quot;:&quot;CI&quot;},{&quot;display&quot;:&quot;China, Peoples Republic (Inner Mongolia, Tibet &amp; Manchuria)&quot;,&quot;value&quot;:&quot;CH&quot;},{&quot;display&quot;:&quot;Christmas Island (Indian)&quot;,&quot;value&quot;:&quot;KT&quot;},{&quot;display&quot;:&quot;Clipperton Island&quot;,&quot;value&quot;:&quot;IP&quot;},{&quot;display&quot;:&quot;Cocos (Keeling) Islands&quot;,&quot;value&quot;:&quot;CK&quot;},{&quot;display&quot;:&quot;Colombia&quot;,&quot;value&quot;:&quot;CO&quot;},{&quot;display&quot;:&quot;Comoros&quot;,&quot;value&quot;:&quot;CN&quot;},{&quot;display&quot;:&quot;Congo (Brazzaville)&quot;,&quot;value&quot;:&quot;CF&quot;},{&quot;display&quot;:&quot;Cook Islands&quot;,&quot;value&quot;:&quot;CW&quot;},{&quot;display&quot;:&quot;Coral Sea Islands Territory&quot;,&quot;value&quot;:&quot;CR&quot;},{&quot;display&quot;:&quot;Corsica&quot;,&quot;value&quot;:&quot;VP&quot;},{&quot;display&quot;:&quot;Costa Rica&quot;,&quot;value&quot;:&quot;CS&quot;},{&quot;display&quot;:&quot;Cote d&apos;Ivoire (Ivory Coast)&quot;,&quot;value&quot;:&quot;CI&quot;},{&quot;display&quot;:&quot;Croatia&quot;,&quot;value&quot;:&quot;HR&quot;},{&quot;display&quot;:&quot;Cuba&quot;,&quot;value&quot;:&quot;CU&quot;},{&quot;display&quot;:&quot;Cyprus&quot;,&quot;value&quot;:&quot;CY&quot;},{&quot;display&quot;:&quot;Czech Republic&quot;,&quot;value&quot;:&quot;EZ&quot;},{&quot;display&quot;:&quot;Denmark&quot;,&quot;value&quot;:&quot;DA&quot;},{&quot;display&quot;:&quot;Djibouti&quot;,&quot;value&quot;:&quot;DJ&quot;},{&quot;display&quot;:&quot;Dominica&quot;,&quot;value&quot;:&quot;DO&quot;},{&quot;display&quot;:&quot;Dominican Republic&quot;,&quot;value&quot;:&quot;DR&quot;},{&quot;display&quot;:&quot;Ecuador&quot;,&quot;value&quot;:&quot;EC&quot;},{&quot;display&quot;:&quot;Egypt&quot;,&quot;value&quot;:&quot;EG&quot;},{&quot;display&quot;:&quot;El Salvador&quot;,&quot;value&quot;:&quot;ES&quot;},{&quot;display&quot;:&quot;Equatorial Guinea&quot;,&quot;value&quot;:&quot;EK&quot;},{&quot;display&quot;:&quot;Eritrea&quot;,&quot;value&quot;:&quot;ER&quot;},{&quot;display&quot;:&quot;Estonia&quot;,&quot;value&quot;:&quot;EN&quot;},{&quot;display&quot;:&quot;Ethiopia&quot;,&quot;value&quot;:&quot;ET&quot;},{&quot;display&quot;:&quot;Europa Island&quot;,&quot;value&quot;:&quot;EU&quot;},{&quot;display&quot;:&quot;Faroe Islands&quot;,&quot;value&quot;:&quot;FO&quot;},{&quot;display&quot;:&quot;Federated States of Micronesia&quot;,&quot;value&quot;:&quot;FM&quot;},{&quot;display&quot;:&quot;Fiji&quot;,&quot;value&quot;:&quot;FJ&quot;},{&quot;display&quot;:&quot;Finland&quot;,&quot;value&quot;:&quot;FI&quot;},{&quot;display&quot;:&quot;France&quot;,&quot;value&quot;:&quot;FR&quot;},{&quot;display&quot;:&quot;French Guiana&quot;,&quot;value&quot;:&quot;FG&quot;},{&quot;display&quot;:&quot;French Polynesia (Tahiti)&quot;,&quot;value&quot;:&quot;FP&quot;},{&quot;display&quot;:&quot;French Southern and Antarctic&quot;,&quot;value&quot;:&quot;FS&quot;},{&quot;display&quot;:&quot;Gabon&quot;,&quot;value&quot;:&quot;GB&quot;},{&quot;display&quot;:&quot;Gambia, The&quot;,&quot;value&quot;:&quot;GA&quot;},{&quot;display&quot;:&quot;Gaza Strip&quot;,&quot;value&quot;:&quot;GZ&quot;},{&quot;display&quot;:&quot;Georgia&quot;,&quot;value&quot;:&quot;GG&quot;},{&quot;display&quot;:&quot;Germany&quot;,&quot;value&quot;:&quot;DE&quot;},{&quot;display&quot;:&quot;Ghana&quot;,&quot;value&quot;:&quot;GH&quot;},{&quot;display&quot;:&quot;Gibraltar&quot;,&quot;value&quot;:&quot;GI&quot;},{&quot;display&quot;:&quot;Glorioso Islands&quot;,&quot;value&quot;:&quot;GO&quot;},{&quot;display&quot;:&quot;Greece&quot;,&quot;value&quot;:&quot;GT&quot;},{&quot;display&quot;:&quot;Greenland&quot;,&quot;value&quot;:&quot;GL&quot;},{&quot;display&quot;:&quot;Grenada (Southern Grenadines)&quot;,&quot;value&quot;:&quot;GJ&quot;},{&quot;display&quot;:&quot;Guadeloupe&quot;,&quot;value&quot;:&quot;GP&quot;},{&quot;display&quot;:&quot;Guatemala&quot;,&quot;value&quot;:&quot;GR&quot;},{&quot;display&quot;:&quot;Guernsey&quot;,&quot;value&quot;:&quot;GK&quot;},{&quot;display&quot;:&quot;Guinea - Bissau&quot;,&quot;value&quot;:&quot;PU&quot;},{&quot;display&quot;:&quot;Guinea&quot;,&quot;value&quot;:&quot;GV&quot;},{&quot;display&quot;:&quot;Guyana&quot;,&quot;value&quot;:&quot;GY&quot;},{&quot;display&quot;:&quot;Haiti&quot;,&quot;value&quot;:&quot;HA&quot;},{&quot;display&quot;:&quot;Heard and McDonald Islands&quot;,&quot;value&quot;:&quot;HM&quot;},{&quot;display&quot;:&quot;Honduras&quot;,&quot;value&quot;:&quot;HO&quot;},{&quot;display&quot;:&quot;Hong Kong&quot;,&quot;value&quot;:&quot;HK&quot;},{&quot;display&quot;:&quot;Howland Island&quot;,&quot;value&quot;:&quot;HQ&quot;},{&quot;display&quot;:&quot;Hungary&quot;,&quot;value&quot;:&quot;HU&quot;},{&quot;display&quot;:&quot;Iceland&quot;,&quot;value&quot;:&quot;IC&quot;},{&quot;display&quot;:&quot;India&quot;,&quot;value&quot;:&quot;IN&quot;},{&quot;display&quot;:&quot;Indonesia (Bali, Belitung, Flores, Java, etc.)&quot;,&quot;value&quot;:&quot;ID&quot;},{&quot;display&quot;:&quot;Ireland, Republic of (Eire)&quot;,&quot;value&quot;:&quot;EI&quot;},{&quot;display&quot;:&quot;Isle of Man&quot;,&quot;value&quot;:&quot;IM&quot;},{&quot;display&quot;:&quot;Iran&quot;,&quot;value&quot;:&quot;IR&quot;},{&quot;display&quot;:&quot;Iraq&quot;,&quot;value&quot;:&quot;IQ&quot;},{&quot;display&quot;:&quot;Israel&quot;,&quot;value&quot;:&quot;IS&quot;},{&quot;display&quot;:&quot;Italy&quot;,&quot;value&quot;:&quot;IT&quot;},{&quot;display&quot;:&quot;Jamaica&quot;,&quot;value&quot;:&quot;JM&quot;},{&quot;display&quot;:&quot;Jan Mayen&quot;,&quot;value&quot;:&quot;JN&quot;},{&quot;display&quot;:&quot;Japan&quot;,&quot;value&quot;:&quot;JP&quot;},{&quot;display&quot;:&quot;Jersey&quot;,&quot;value&quot;:&quot;JE&quot;},{&quot;display&quot;:&quot;Johnston Atoll&quot;,&quot;value&quot;:&quot;JQ&quot;},{&quot;display&quot;:&quot;Jordan&quot;,&quot;value&quot;:&quot;JO&quot;},{&quot;display&quot;:&quot;Juan De Nova Island&quot;,&quot;value&quot;:&quot;JU&quot;},{&quot;display&quot;:&quot;Kazakhstan&quot;,&quot;value&quot;:&quot;KZ&quot;},{&quot;display&quot;:&quot;Kenya&quot;,&quot;value&quot;:&quot;KE&quot;},{&quot;display&quot;:&quot;Kingman Reef&quot;,&quot;value&quot;:&quot;KQ&quot;},{&quot;display&quot;:&quot;Kiribati (Gilbert Islands)&quot;,&quot;value&quot;:&quot;KI&quot;},{&quot;display&quot;:&quot;Korea, Republic of&quot;,&quot;value&quot;:&quot;KR&quot;},{&quot;display&quot;:&quot;Kuwait&quot;,&quot;value&quot;:&quot;KU&quot;},{&quot;display&quot;:&quot;Kyrgyzstan&quot;,&quot;value&quot;:&quot;KG&quot;},{&quot;display&quot;:&quot;Laos&quot;,&quot;value&quot;:&quot;LA&quot;},{&quot;display&quot;:&quot;Latvia&quot;,&quot;value&quot;:&quot;LG&quot;},{&quot;display&quot;:&quot;Lebanon&quot;,&quot;value&quot;:&quot;LE&quot;},{&quot;display&quot;:&quot;Lesotho&quot;,&quot;value&quot;:&quot;LT&quot;},{&quot;display&quot;:&quot;Liberia&quot;,&quot;value&quot;:&quot;LR&quot;},{&quot;display&quot;:&quot;Libya&quot;,&quot;value&quot;:&quot;LY&quot;},{&quot;display&quot;:&quot;Liechtenstein&quot;,&quot;value&quot;:&quot;LS&quot;},{&quot;display&quot;:&quot;Lithuania&quot;,&quot;value&quot;:&quot;LH&quot;},{&quot;display&quot;:&quot;Luxembourg&quot;,&quot;value&quot;:&quot;LU&quot;},{&quot;display&quot;:&quot;Macau&quot;,&quot;value&quot;:&quot;MC&quot;},{&quot;display&quot;:&quot;Macedonia&quot;,&quot;value&quot;:&quot;MK&quot;},{&quot;display&quot;:&quot;Madagascar (Malagasy Republic)&quot;,&quot;value&quot;:&quot;MA&quotquot;},{&quot;display&quot;:&quot;Malawi&quot;,&quot;value&quot;:&quot;MI&quot;},{&quot;display&quot;:&quot;Malaysia&quot;,&quot;value&quot;:&quot;MY&quot;},{&quot;display&quot;:&quot;Maldives&quot;,&quot;value&quot;:&quot;MV&quot;},{&quot;display&quot;:&quot;Mali&quot;,&quot;value&quot;:&quot;ML&quot;},{&quot;display&quot;:&quot;Malta&quot;,&quot;value&quot;:&quot;MT&quot;},{&quot;display&quot;:&quot;Marshall Islands&quot;,&quot;value&quot;:&quot;RM&quot;},{&quot;display&quot;:&quot;Martinique&quot;,&quot;value&quot;:&quot;MB&quot;},{&quot;display&quot;:&quot;Mauritania&quot;,&quot;value&quot;:&quot;MR&quot;},{&quot;display&quot;:&quot;Mauritius&quot;,&quot;value&quot;:&quot;MP&quot;},{&quot;display&quot;:&quot;Mayotte&quot;,&quot;value&quot;:&quot;MF&quot;},{&quot;display&quot;:&quot;Mexico&quot;,&quot;value&quot;:&quot;MX&quot;},{&quot;display&quot;:&quot;Midway Islands&quot;,&quot;value&quot;:&quot;MQ&quot;},{&quot;display&quot;:&quot;Moldova&quot;,&quot;value&quot;:&quot;MD&quot;},{&quot;display&quot;:&quot;Monaco&quot;,&quot;value&quot;:&quot;MN&quot;},{&quot;display&quot;:&quot;Mongolia&quot;,&quot;value&quot;:&quot;MG&quot;},{&quot;display&quot;:&quot;Monserrat&quot;,&quot;value&quot;:&quot;MH&quot;},{&quot;display&quot;:&quot;Montenegro&quot;,&quot;value&quot;:&quot;MW&quot;},{&quot;display&quot;:&quot;Morocco&quot;,&quot;value&quot;:&quot;MO&quot;},{&quot;display&quot;:&quot;Mozambique&quot;,&quot;value&quot;:&quot;MZ&quot;},{&quot;display&quot;:&quot;Myanmar&quot;,&quot;value&quot;:&quot;MM&quot;},{&quot;display&quot;:&quot;Nambia&quot;,&quot;value&quot;:&quot;WA&quot;},{&quot;display&quot;:&quot;Nauru&quot;,&quot;value&quot;:&quot;NR&quot;},{&quot;display&quot;:&quot;Navassa Island&quot;,&quot;value&quot;:&quot;BQ&quot;},{&quot;display&quot;:&quot;Nepal&quot;,&quot;value&quot;:&quot;NP&quot;},{&quot;display&quot;:&quot;Netherlands&quot;,&quot;value&quot;:&quot;NL&quot;},{&quot;display&quot;:&quot;Netherlands Antilles / Bonaire / Curacao&quot;,&quot;value&quot;:&quot;NT&quot;},{&quot;display&quot;:&quot;New Caledonia&quot;,&quot;value&quot;:&quot;NC&quot;},{&quot;display&quot;:&quot;New Zealand&quot;,&quot;value&quot;:&quot;NZ&quot;},{&quot;display&quot;:&quot;Nicaragua&quot;,&quot;value&quot;:&quot;NU&quot;},{&quot;display&quot;:&quot;Niger&quot;,&quot;value&quot;:&quot;NG&quot;},{&quot;display&quot;:&quot;Nigeria&quot;,&quot;value&quot;:&quot;NG&quot;},{&quot;display&quot;:&quot;Niue&quot;,&quot;value&quot;:&quot;NE&quot;},{&quot;display&quot;:&quot;Norfolk Island&quot;,&quot;value&quot;:&quot;NF&quot;},{&quot;display&quot;:&quot;North Korea&quot;,&quot;value&quot;:&quot;NK&quot;},{&quot;display&quot;:&quot;Northern Marina Islands&quot;,&quot;value&quot;:&quot;CQ&quot;},{&quot;display&quot;:&quot;Norway&quot;,&quot;value&quot;:&quot;NO&quot;},{&quot;display&quot;:&quot;Oman&quot;,&quot;value&quot;:&quot;MU&quot;},{&quot;display&quot;:&quot;Other Countries&quot;,&quot;value&quot;:&quot;OC&quot;},{&quot;display&quot;:&quot;Pakistan&quot;,&quot;value&quot;:&quot;PK&quot;},{&quot;display&quot;:&quot;Palau&quot;,&quot;value&quot;:&quot;PW&quot;},{&quot;display&quot;:&quot;Palmyra Atoll&quot;,&quot;value&quot;:&quot;LQ&quot;},{&quot;display&quot;:&quot;Panama&quot;,&quot;value&quot;:&quot;PM&quot;},{&quot;display&quot;:&quot;Papua New Guinea&quot;,&quot;value&quot;:&quot;PP&quot;},{&quot;display&quot;:&quot;Paracel Islands&quot;,&quot;value&quot;:&quot;PF&quot;},{&quot;display&quot;:&quot;Paraguay&quot;,&quot;value&quot;:&quot;PA&quot;},{&quot;display&quot;:&quot;Peru&quot;,&quot;value&quot;:&quot;PE&quot;},{&quot;display&quot;:&quot;Philippines&quot;,&quot;value&quot;:&quot;RP&quot;},{&quot;display&quot;:&quot;Pitcairn Islands&quot;,&quot;value&quot;:&quot;PC&quot;},{&quot;display&quot;:&quot;Poland&quot;,&quot;value&quot;:&quot;PL&quot;},{&quot;display&quot;:&quot;Portugal - Azores&quot;,&quot;value&quot;:&quot;PO&quot;},{&quot;display&quot;:&quot;Qatar (Katar)&quot;,&quot;value&quot;:&quot;QA&quot;},{&quot;display&quot;:&quot;Republic of Palau&quot;,&quot;value&quot;:&quot;PS&quot;},{&quot;display&quot;:&quot;Reunion&quot;,&quot;value&quot;:&quot;RE&quot;},{&quot;display&quot;:&quot;Romania&quot;,&quot;value&quot;:&quot;RO&quot;},{&quot;display&quot;:&quot;Russia&quot;,&quot;value&quot;:&quot;RS&quot;},{&quot;display&quot;:&quot;Rwanda&quot;,&quot;value&quot;:&quot;RW&quot;},{&quot;display&quot;:&quot;San Marino&quot;,&quot;value&quot;:&quot;SM&quot;},{&quot;display&quot;:&quot;Sao Tome and Principe&quot;,&quot;value&quot;:&quot;TP&quot;},{&quot;display&quot;:&quot;Saudi Arabia&quot;,&quot;value&quot;:&quot;SA&quot;},{&quot;display&quot;:&quot;Senegal&quot;,&quot;value&quot;:&quot;SN&quot;},{&quot;display&quot;:&quot;Serbia&quot;,&quot;value&quot;:&quot;SR&quot;},{&quot;display&quot;:&quot;Seychelles&quot;,&quot;value&quot;:&quot;SE&quot;},{&quot;display&quot;:&quot;Sierra Leone&quot;,&quot;value&quot;:&quot;SL&quot;},{&quot;display&quot;:&quot;Singapore&quot;,&quot;value&quot;:&quot;SG&quot;},{&quot;display&quot;:&quot;Slovakia&quot;,&quot;value&quot;:&quot;LO&quot;},{&quot;display&quot;:&quot;Slovenia&quot;,&quot;value&quot;:&quot;SI&quot;},{&quot;display&quot;:&quot;Solomon Islands&quot;,&quot;value&quot;:&quot;BP&quot;},{&quot;display&quot;:&quot;Somalia&quot;,&quot;value&quot;:&quot;SO&quot;},{&quot;display&quot;:&quot;South Africa&quot;,&quot;value&quot;:&quot;SF&quot;},{&quot;display&quot;:&quot;South Georgia and South Sandwich Islands&quot;,&quot;value&quot;:&quot;SX&quot;},{&quot;display&quot;:&quot;Spain / Balearic Islands (Mallorca, etc.)&quot;,&quot;value&quot;:&quot;SP&quot;},{&quot;display&quot;:&quot;Spratly Islands&quot;,&quot;value&quot;:&quot;PG&quot;},{&quot;display&quot;:&quot;Sri Lanka&quot;,&quot;value&quot;:&quot;CE&quot;},{&quot;display&quot;:&quot;St Helena (Ascension Island &amp; Tristan De Cuhna)&quot;,&quot;value&quot;:&quot;SH&quot;},{&quot;display&quot;:&quot;St Kitts (St Christopher and Nevis)&quot;,&quot;value&quot;:&quot;SC&quot;},{&quot;display&quot;:&quot;St Lucia&quot;,&quot;value&quot;:&quot;ST&quot;},{&quot;display&quot;:&quot;St Pierre and Miquelon&quot;,&quot;value&quot;:&quot;SB&quot;},{&quot;display&quot;:&quot;St Vincent / N Grenadines / Winward Island&quot;,&quot;value&quot;:&quot;VC&quot;},{&quot;display&quot;:&quot;Sudan&quot;,&quot;value&quot;:&quot;SD&quot;},{&quot;display&quot;:&quot;Suriname&quot;,&quot;value&quot;:&quot;NS&quot;},{&quot;display&quot;:&quot;Svalbard (Spitsbergen)&quot;,&quot;value&quot;:&quot;SV&quot;},{&quot;display&quot;:&quot;Swaziland&quot;,&quot;value&quot;:&quot;WZ&quot;},{&quot;display&quot;:&quot;Sweden&quot;,&quot;value&quot;:&quot;SW&quot;},{&quot;display&quot;:&quot;Switzerland&quot;,&quot;value&quot;:&quot;SZ&quot;},{&quot;display&quot;:&quot;Syria&quot;,&quot;value&quot;:&quot;SY&quot;},{&quot;display&quot;:&quot;Taiwan&quot;,&quot;value&quot;:&quot;TW&quot;},{&quot;display&quot;:&quot;Tajikistan&quot;,&quot;value&quot;:&quot;TI&quot;},{&quot;display&quot;:&quot;Tanzania, United Republic of&quot;,&quot;value&quot;:&quot;TZ&quot;},{&quot;display&quot;:&quot;Thailand&quot;,&quot;value&quot;:&quot;TH&quot;},{&quot;display&quot;:&quot;Togo&quot;,&quot;value&quot;:&quot;TO&quot;},{&quot;display&quot;:&quot;Tokelau&quot;,&quot;value&quot;:&quot;TL&quot;},{&quot;display&quot;:&quot;Tonga&quot;,&quot;value&quot;:&quot;TN&quot;},{&quot;display&quot;:&quot;Trinidad &amp; Tobago&quot;,&quot;value&quot;:&quot;TD&quot;},{&quot;display&quot;:&quot;Tromelin Island&quot;,&quot;value&quot;:&quot;TE&quot;},{&quot;display&quot;:&quot;Tunisia&quot;,&quot;value&quot;:&quot;TS&quot;},{&quot;display&quot;:&quot;Turkey&quot;,&quot;value&quot;:&quot;TU&quot;},{&quot;display&quot;:&quot;Turkmenistan&quot;,&quot;value&quot;:&quot;TX&quot;},{&quot;display&quot;:&quot;Turks and Caicos Islands&quot;,&quot;value&quot;:&quot;TK&quot;},{&quot;display&quot;:&quot;Tuvalu&quot;,&quot;value&quot;:&quot;TV&quot;},{&quot;display&quot;:&quot;UAE / Abu Dhabi / Dubai&quot;,&quot;value&quot;:&quot;TC&quot;},{&quot;display&quot;:&quot;Uganda&quot;,&quot;value&quot;:&quot;UG&quot;},{&quot;display&quot;:&quot;Ukraine&quot;,&quot;value&quot;:&quot;UR&quot;},{&quot;display&quot;:&quot;United Kingdom&quot;,&quot;value&quot;:&quot;UK&quot;},{&quot;display&quot;:&quot;Uruguay&quot;,&quot;value&quot;:&quot;UY&quot;},{&quot;display&quot;:&quot;Uzbekistan&quot;,&quot;value&quot;:&quot;UZ&quot;},{&quot;display&quot;:&quot;Vanuatu&quot;,&quot;value&quot;:&quot;NH&quot;},{&quot;display&quot;:&quot;Vatican City&quot;,&quot;value&quot;:&quot;VT&quot;},{&quot;display&quot;:&quot;Venezuela&quot;,&quot;value&quot;:&quot;VE&quot;},{&quot;display&quot;:&quot;Vietnam&quot;,&quot;value&quot;:&quot;VM&quot;},{&quot;display&quot;:&quot;Virgin Islands Br. / Redonda / Tortola&quot;,&quot;value&quot;:&quot;VI&quot;},{&quot;display&quot;:&quot;Wake Island&quot;,&quot;value&quot;:&quot;WQ&quot;},{&quot;display&quot;:&quot;Wallis and Futuna&quot;,&quot;value&quot;:&quot;WF&quot;},{&quot;display&quot;:&quot;West Bank&quot;,&quot;value&quot;:&quot;WE&quot;},{&quot;display&quot;:&quot;Western Sahara&quot;,&quot;value&quot;:&quot;WI&quot;},{&quot;display&quot;:&quot;Western Samoa&quot;,&quot;value&quot;:&quot;WS&quot;},{&quot;display&quot;:&quot;Yemen (Aden)&quot;,&quot;value&quot;:&quot;YS&quot;},{&quot;display&quot;:&quot;Yemen (Sanaa)&quot;,&quot;value&quot;:&quot;YM&quot;},{&quot;display&quot;:&quot;Yugoslavia / Kosovo / Montenegro / Serbia&quot;,&quot;value&quot;:&quot;YO&quot;},{&quot;display&quot;:&quot;Zaire / Congo&quot;,&quot;value&quot;:&quot;CG&quot;},{&quot;display&quot;:&quot;Zambia&quot;,&quot;value&quot;:&quot;ZA&quot;},{&quot;display&quot;:&quot;Zimbabwe&quot;,&quot;value&quot;:&quot;ZW&quot;}]"),svi.ng.defaultString($scope,$attrs,"stateMenu","[{&quot;display&quot;:&quot;select one&quot;,&quot;value&quot;:&quot;&quot;},{&quot;display&quot;:&quot;Alabama&quot;,&quot;value&quot;:&quot;AL&quot;},{&quot;display&quot;:&quot;Alaska&quot;,&quot;value&quot;:&quot;AK&quot;},{&quot;display&quot;:&quot;Arizona&quot;,&quot;value&quot;:&quot;AZ&quot;},{&quot;display&quot;:&quot;Arkansas&quot;,&quot;value&quot;:&quot;AR&quot;},{&quot;display&quot;:&quot;American Samoa&quot;,&quot;value&quot;:&quot;AS&quot;},{&quot;display&quot;:&quot;Armed Forces Americas&quot;,&quot;value&quot;:&quot;AA&quot;},{&quot;display&quot;:&quot;Armed Forces Africa \\/ Canada \\/ Europe \\/ Middle East&quot;,&quot;value&quot;:&quot;AE&quot;},{&quot;display&quot;:&quot;Armed Forces Pacific&quot;,&quot;value&quot;:&quot;AP&quot;},{&quot;display&quot;:&quot;California&quot;,&quot;value&quot;:&quot;CA&quot;},{&quot;display&quot;:&quot;Colorado&quot;,&quot;value&quot;:&quot;CO&quot;},{&quot;display&quot;:&quot;Connecticut&quot;,&quot;value&quot;:&quot;CT&quot;},{&quot;display&quot;:&quot;Delaware&quot;,&quot;value&quot;:&quot;DE&quot;},{&quot;display&quot;:&quot;District of Columbia&quot;,&quot;value&quot;:&quot;DC&quot;},{&quot;display&quot;:&quot;Florida&quot;,&quot;value&quot;:&quot;FL&quot;},{&quot;display&quot;:&quot;Georgia&quot;,&quot;value&quot;:&quot;GA&quot;},{&quot;display&quot;:&quot;Guam&quot;,&quot;value&quot;:&quot;GU&quot;},{&quot;display&quot;:&quot;Hawaii&quot;,&quot;value&quot;:&quot;HI&quot;},{&quot;display&quot;:&quot;Idaho&quot;,&quot;value&quot;:&quot;ID&quot;},{&quot;display&quot;:&quot;Illinois&quot;,&quot;value&quot;:&quot;IL&quot;},{&quot;display&quot;:&quot;Indiana&quot;,&quot;value&quot;:&quot;IN&quot;},{&quot;display&quot;:&quot;Iowa&quot;,&quot;value&quot;:&quot;IA&quot;},{&quot;display&quot;:&quot;Kansas&quot;,&quot;value&quot;:&quot;KS&quot;},{&quot;display&quot;:&quot;Kentucky&quot;,&quot;value&quot;:&quot;KY&quot;},{&quot;display&quot;:&quot;Louisiana&quot;,&quot;value&quot;:&quot;LA&quot;},{&quot;display&quot;:&quot;Maine&quot;,&quot;value&quot;:&quot;ME&quot;},{&quot;display&quot;:&quot;Maryland&quot;,&quot;value&quot;:&quot;MD&quot;},{&quot;display&quot;:&quot;Massachusetts&quot;,&quot;value&quot;:&quot;MA&quot;},{&quot;display&quot;:&quot;Michigan&quot;,&quot;value&quot;:&quot;MI&quot;},{&quot;display&quot;:&quot;Minnesota&quot;,&quot;value&quot;:&quot;MN&quot;},{&quot;display&quot;:&quot;Mississippi&quot;,&quot;value&quot;:&quot;MS&quot;},{&quot;display&quot;:&quot;Missouri&quot;,&quot;value&quot;:&quot;MO&quot;},{&quot;display&quot;:&quot;Montana&quot;,&quot;value&quot;:&quot;MT&quot;},{&quot;display&quot;:&quot;Nebraska&quot;,&quot;value&quot;:&quot;NE&quot;},{&quot;display&quot;:&quot;Nevada&quot;,&quot;value&quot;:&quot;NV&quot;},{&quot;display&quot;:&quot;New Hampshire&quot;,&quot;value&quot;:&quot;NH&quot;},{&quot;display&quot;:&quot;New Jersey&quot;,&quot;value&quot;:&quot;NJ&quot;},{&quot;display&quot;:&quot;New Mexico&quot;,&quot;value&quot;:&quot;NM&quot;},{&quot;display&quot;:&quot;New York&quot;,&quot;value&quot;:&quot;NY&quot;},{&quot;display&quot;:&quot;North Carolina&quot;,&quot;value&quot;:&quot;NC&quot;},{&quot;display&quot;:&quot;North Dakota&quot;,&quot;value&quot;:&quot;ND&quot;},{&quot;display&quot;:&quot;Ohio&quot;,&quot;value&quot;:&quot;OH&quot;},{&quot;display&quot;:&quot;Oklahoma&quot;,&quot;value&quot;:&quot;OK&quot;},{&quot;display&quot;:&quot;Oregon&quot;,&quot;value&quot;:&quot;OR&quot;},{&quot;display&quot;:&quot;Pennsylvania&quot;,&quot;value&quot;:&quot;PA&quot;},{&quot;display&quot;:&quot;Puerto Rico&quot;,&quot;value&quot;:&quot;PR&quot;},{&quot;display&quot;:&quot;Rhode Island&quot;,&quot;value&quot;:&quot;RI&quot;},{&quot;display&quot;:&quot;South Carolina&quot;,&quot;value&quot;:&quot;SC&quot;},{&quot;display&quot;:&quot;South Dakota&quot;,&quot;value&quot;:&quot;SD&quot;},{&quot;display&quot;:&quot;Tennessee&quot;,&quot;value&quot;:&quot;TN&quot;},{&quot;display&quot;:&quot;Texas&quot;,&quot;value&quot;:&quot;TX&quot;},{&quot;display&quot;:&quot;Virgin Islands (U.S.)&quot;,&quot;value&quot;:&quot;VQ&quot;},{&quot;display&quot;:&quot;Utah&quot;,&quot;value&quot;:&quot;UT&quot;},{&quot;display&quot;:&quot;Vermont&quot;,&quot;value&quot;:&quot;VT&quot;},{&quot;display&quot;:&quot;Virginia&quot;,&quot;value&quot;:&quot;VA&quot;},{&quot;display&quot;:&quot;Washington&quot;,&quot;value&quot;:&quot;WA&quot;},{&quot;display&quot;:&quot;West Virginia&quot;,&quot;value&quot;:&quot;WV&quot;},{&quot;display&quot;:&quot;Wisconsin&quot;,&quot;value&quot;:&quot;WI&quot;},{&quot;display&quot;:&quot;Wyoming&quot;,&quot;value&quot;:&quot;WY&quot;}]"),svi.ng.defaultString($scope,$attrs,"occupationMenu","[{&quot;display&quot;:&quot;select one&quot;,&quot;value&quot;:&quot;&quot;},{&quot;display&quot;:&quot;Employed&quot;,&quot;value&quot;:&quot;employed&quot;},{&quot;display&quot;:&quot;Student&quot;,&quot;value&quot;:&quot;student&quot;},{&quot;display&quot;:&quot;Retired&quot;,&quot;value&quot;:&quot;retired&quot;},{&quot;display&quot;:&quot;Unemployed&quot;,&quot;value&quot;:&quot;unemployed&quot;},{&quot;display&quot;:&quot;Other&quot;,&quot;value&quot;:&quot;other&quot;}]"),svi.ng.defaultString($scope,$attrs,"validation","{&quot;firstnameRegex&quot;:&quot;\\/(?:)\\/&quot;,&quot;lastnameRegex&quot;:&quot;\\/(?:)\\/&quot;,&quot;addressRegex&quot;:&quot;\\/(?:)\\/&quot;,&quot;address2Regex&quot;:&quot;\\/(?:)\\/&quot;,&quot;cityRegex&quot;:&quot;\\/(?:)\\/&quot;,&quot;zipRegex&quot;:&quot;\\/^\\\\d{5}([ \\\\-]\\\\d{4})?$\\/&quot;,&quot;provinceRegex&quot;:&quot;\\/(?:)\\/&quot;,&quot;postalRegex&quot;:&quot;\\/(?:)\\/&quot;,&quot;employerRegex&quot;:&quot;\\/(?:)\\/&quot;,&quot;jobTitleRegex&quot;:&quot;\\/(?:)\\/&quot;,&quot;jobDescRegex&quot;:&quot;\\/(?:)\\/&quot;}")}catch(e){throw"sviCombinedAgreements: "+e}$scope.showUser=$scope.showUser&&"rtq"!==$scope.mode,$scope.showRtq=$scope.showRtq&&"user"!==$scope.mode,$scope.showBoth=$scope.showUser&&$scope.showRtq,$scope.redirecting=!1,$scope.showSubmit=!$scope.showRtq,$scope.id=php.uniqid("combinedAgreements"),$scope.initUser=function(){},$scope.initRtq=function(){},$scope.getUserSubmitData=function(){return{}},$scope.getRtqSubmitData=function(){return{}},$scope.setInitUser=function(callback){$scope.initUser=callback},$scope.setInitRtq=function(callback){$scope.initRtq=callback},$scope.setGetUserSubmitData=function(callback){$scope.getUserSubmitData=callback},$scope.setGetRtqSubmitData=function(callback){$scope.getRtqSubmitData=callback},$scope.handleRtqChangeShowSubmit=function(show){$scope.showSubmit=show},labels.setupLabels($scope,["general","combinedAgreements"]),$scope.submit=function(){$scope.load()};var loadCallback=function(){var data={user:$scope.getUserSubmitData(),rtq:$scope.getRtqSubmitData()};return agreements.signAgreements($scope.mode,data)},onSuccess=function(response){$scope.loaded=!0,"close"===$scope.destination&&"Modal"===$scope.template?$scope.close():$scope.destination?($scope.redirecting=!0,sviUrl.href($scope.destination)):response.destination&&($scope.redirecting=!0,sviUrl.href(response.destination))},onError=function(response){$scope.loader.setError($scope.labels.dataRenderError)};$scope.setLoader=function(loader){$scope.loader=loader},$scope.load=function(){if(!$scope.loader)return $timeout($scope.load,200);$scope.loader.setLoadHandler(loadCallback).load().then(onSuccess,onError)};var modalInit=!($scope.close=function(){$($element.find(".svi-combined-agreements-modal")).modal("hide")});"Modal"==$scope.template&&eventDispatcher.on("AGREEMENTS.SHOW",function(e,data){$scope.$apply(function(){$scope.initUser(data),$scope.initRtq(data),$scope.combinedAgreementsForm.$setPristine(),$scope.combinedAgreementsForm.$setUntouched()}),modalInit?$element.find(".svi-combined-agreements-modal").modal("show"):(modalInit=!0,$element.find(".svi-combined-agreements-modal").modal({backdrop:!0,show:!0}).draggable({handle:".modal-header"}))},!0)}],link:function($scope,$element,$attrs){var template=$templateCache.get("combinedAgreements/combinedAgreements"+$scope.template+".tpl.html"),formTmpl=$templateCache.get("combinedAgreements/combinedAgreementsForm.tpl.html");$element.html(template.replace("%AGREEMENTS_FORM%",formTmpl)).show(),$compile($element.contents())($scope)}}}]),angular.module("directives").directive("sviOccupation",function(){return{restrict:"A",require:"ngModel",scope:{proOrNot:"="},link:function(scope,elm,attrs,ctrl){scope.$watch("proOrNot",function(newValue,oldValue){newValue!==oldValue&&ctrl.$validate()}),ctrl.$validators.profSubscriberOccupation=function(modelValue,viewValue){return"N"===scope.proOrNot||"employed"===modelValue}}}}),angular.module("directives").directive("sviRtqAgreement",["$templateCache","$timeout","labels",function($templateCache,$timeout,labels){return{replace:!1,scope:{allowSkipRtq:"@",firstName:"@",lastName:"@",countryUsOnly:"@",countryUsMenu:"@",countryMenu:"@",stateMenu:"@",occupationMenu:"@",validation:"@",combinedAgreementsForm:"=",setInit:"=",setGetSubmitData:"=",onChangeShowSubmit:"="},template:$templateCache.get("rtqAgreement/rtqAgreement.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){try{svi.ng.defaultFalse($scope,$attrs,"allowSkipRtq"),svi.ng.defaultString($scope,$attrs,"firstName",""),svi.ng.defaultString($scope,$attrs,"lastName",""),svi.ng.defaultFalse($scope,$attrs,"countryUsOnly"),svi.ng.defaultString($scope,$attrs,"countryUsMenu","[]"),svi.ng.defaultString($scope,$attrs,"countryMenu","[]"),svi.ng.defaultString($scope,$attrs,"stateMenu","[]"),svi.ng.defaultString($scope,$attrs,"occupationMenu","[]"),svi.ng.defaultString($scope,$attrs,"validation","{}")}catch(e){throw"sviRtqAgreement: "+e}try{svi.ng.parseJSON($scope,$attrs,"countryUsMenu")}catch(e){$log.warn("sviRtqAgreement: Error parsing countryUsMenu: ",e,$attrs.countryUsMenu),$scope.countryUsMenu=$attrs.countryUsMenu=[]}try{svi.ng.parseJSON($scope,$attrs,"countryMenu")}catch(e){$log.warn("sviRtqAgreement: Error parsing countryMenu: ",e,$attrs.countryMenu),$scope.countryMenu=$attrs.countryMenu=[]}try{svi.ng.parseJSON($scope,$attrs,"stateMenu")}catch(e){$log.warn("sviRtqAgreement: Error parsing stateMenu: ",e,$attrs.stateMenu),$scope.stateMenu=$attrs.stateMenu=[]}try{svi.ng.parseJSON($scope,$attrs,"occupationMenu")}catch(e){$log.warn("sviRtqAgreement: Error parsing occupationMenu: ",e,$attrs.occupationMenu),$scope.occupationMenu=$attrs.occupationMenu=[]}try{svi.ng.parseJSON($scope,$attrs,"validation")}catch(e){$log.warn("sviRtqAgreement: Error parsing validation: ",e,$attrs.validation),$scope.validation=$attrs.validation={}}for(var val in $scope.id=php.uniqid("rtqAgreement"),$scope.showEmployerInfo=!1,$scope.refreshShowSubmit=function(){var show;show=$scope.allowSkipRtq&&"Y"!==$scope.form.enableRtq||"Y"===$scope.form.marketAgreements,$scope.onChangeShowSubmit(show)},$scope.init=function(data){data&&(data.hasOwnProperty("firstName")&&($scope.firstName=data.firstName),data.hasOwnProperty("lastName")&&($scope.lastName=data.lastName)),$scope.form={enableRtq:"",enableRtqTemp:"",proOrNot:"",proOrNotTemp:"",marketAgreements:"",firstname:$scope.firstName,lastname:$scope.lastName,address:"",address2:"",city:"",country:"US",state:"",zip:"",province:"",postal:"",occupation:"",employer:"",employerAddress:"",employerAddress2:"",employerCity:"",employerCountry:"US",employerState:"",employerZip:"",employerProvince:"",employerPostal:"",jobTitle:"",jobDesc:""},$scope.refreshShowSubmit()},$scope.setInit(function(data){$scope.init(data)}),$scope.init(),$scope.setGetSubmitData(function(){var data=$.extend({},$scope.form);return delete data.enableRtqTemp,delete data.proOrNotTemp,data}),labels.setupLabels($scope,["general","rtqAgreement"]),$scope.validation)$scope.validation.hasOwnProperty(val)&&($scope.validation[val]=svi.util.parseRegExp($scope.validation[val]));$scope.updateEnableRtq=function(){$scope.form.enableRtq=$scope.form.enableRtqTemp,$scope.combinedAgreementsForm.enableRtq.$setDirty()},$scope.updateProOrNot=function(){$scope.form.proOrNot=$scope.form.proOrNotTemp,$scope.combinedAgreementsForm.proOrNot.$setDirty()},$scope.acceptMarketAgreements=function(){$scope.form.marketAgreements="Y",$timeout(function(){var section=document.getElementsByClassName("section-personal-info");section&&section[0].scrollIntoView()},1)},$scope.$watch("form.marketAgreements",function(newValue,oldValue){newValue!==oldValue&&$scope.refreshShowSubmit()},!0),$scope.$watch("form.enableRtq",function(newValue,oldValue){newValue!==oldValue&&$scope.refreshShowSubmit()},!0),$scope.$watch("form.occupation",function(newValue,oldValue){newValue!==oldValue&&($scope.showEmployerInfo=newValue&&"student"!==newValue&&"unemployed"!==newValue&&"retired"!==newValue)},!0)}]}}]),angular.module("directives").directive("sviRtqAgreementText",["$templateCache",function($templateCache){return{replace:!1,scope:{},template:$templateCache.get("rtqAgreementText/rtqAgreementText.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){}]}}]),angular.module("directives").directive("sviUserAgreement",["$templateCache","labels",function($templateCache,labels){return{replace:!1,scope:{combinedAgreementsForm:"=",setInit:"=",setGetSubmitData:"="},template:$templateCache.get("userAgreement/userAgreement.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){$scope.id=php.uniqid("userAgreement"),$scope.init=function(data){$scope.form={userAgreement:!1}},$scope.setInit(function(data){$scope.init(data)}),$scope.init(),$scope.setGetSubmitData(function(){return $.extend({},$scope.form)}),labels.setupLabels($scope,["general","userAgreement"])}]}}]),angular.module("directives").directive("sviUserAgreementText",["$templateCache",function($templateCache){return{replace:!1,scope:{},template:$templateCache.get("userAgreementText/userAgreementText.tpl.html"),controller:["$scope","$element","$attrs",function($scope,$element,$attrs){}]}}]),angular.module("filters").filter("sviAccount",["$filter","accountList",function($filter,accountList){return function(input){return angular.isObject(input)||(input=accountList.getAccountObjectByIndex(input)),accountList.displayAccount(input)}}]),angular.module("filters").filter("assetTypeColor",["APP_CONFIG",function(APP_CONFIG){return function(assetType){if(!angular.isString(assetType))return APP_CONFIG.chartColors.assetTypes.unknown;var color="";switch(assetType.toLowerCase()){case"equity":case"stock":case"cs":color=APP_CONFIG.chartColors.assetTypes.equity;break;case"option":case"options":color=APP_CONFIG.chartColors.assetTypes.option;break;case"mutualfund":case"mf":color=APP_CONFIG.chartColors.assetTypes.fund;break;case"fixedincome":case"bond":color=APP_CONFIG.chartColors.assetTypes.fixedIncome;break;case"cash":case"moneymarketfund":color=APP_CONFIG.chartColors.assetTypes.cash;break;case"realestate":color=APP_CONFIG.chartColors.assetTypes.realEstate;break;case"commodities":color=APP_CONFIG.chartColors.assetTypes.commodities;break;case"preferredstock":color=APP_CONFIG.chartColors.assetTypes.preferredStock;break;case"stockfund":case"etf":color=APP_CONFIG.chartColors.assetTypes.stockFund;break;case"taxablebondfund":color=APP_CONFIG.chartColors.assetTypes.taxableBondFund;break;case"taxexemptbondfund":color=APP_CONFIG.chartColors.assetTypes.taxExemptBondFund;break;case"closeendmutualfund":color=APP_CONFIG.chartColors.assetTypes.closeEndMutualFund;break;case"listedoption":color=APP_CONFIG.chartColors.assetTypes.listedOption;break;case"indexoption":color=APP_CONFIG.chartColors.assetTypes.indexOption;break;case"currencyoption":color=APP_CONFIG.chartColors.assetTypes.currencyOption;break;case"otcoption":color=APP_CONFIG.chartColors.assetTypes.otcOption;break;case"escrowreceipt":color=APP_CONFIG.chartColors.assetTypes.escrowReceipt;break;case"future":color=APP_CONFIG.chartColors.assetTypes.future;break;case"right":color=APP_CONFIG.chartColors.assetTypes.right;break;case"warrant":color=APP_CONFIG.chartColors.assetTypes.warrant;break;case"commercialpaper":color=APP_CONFIG.chartColors.assetTypes.commercialPaper;break;case"cd":color=APP_CONFIG.chartColors.assetTypes.cd;break;case"banknote":color=APP_CONFIG.chartColors.assetTypes.bankNote;break;case"taxexemptbond":color=APP_CONFIG.chartColors.assetTypes.taxExemptBond;break;case"taxablebond":color=APP_CONFIG.chartColors.assetTypes.taxableBond;break;case"unitinvestmenttrust":color=APP_CONFIG.chartColors.assetTypes.unitInvestmentTrust;break;case"insuredbankdeposit":color=APP_CONFIG.chartColors.assetTypes.insuredBankDeposit;break;case"insurance":color=APP_CONFIG.chartColors.assetTypes.insurance;break;case"corporatebond":color=APP_CONFIG.chartColors.assetTypes.corporateBond;break;case"municipalbond":color=APP_CONFIG.chartColors.assetTypes.municipalBond;break;case"governmentbond":color=APP_CONFIG.chartColors.assetTypes.governmentBond;break;case"limitedpartnership":color=APP_CONFIG.chartColors.assetTypes.limitedPartnership;break;case"mortgagebackedsecurity":color=APP_CONFIG.chartColors.assetTypes.mortgageBackedSecurity;break;case"other":color=APP_CONFIG.chartColors.assetTypes.other;break;case"balancedfund":color=APP_CONFIG.chartColors.assetTypes.balancedFund;break;case"bairdprivateequity":color=APP_CONFIG.chartColors.assetTypes.bairdPrivateEquity;break;case"alternativeinvestment":color=APP_CONFIG.chartColors.assetTypes.alternativeInvestment;break;case"heldawayassets":color=APP_CONFIG.chartColors.assetTypes.heldAwayAssets;break;default:case"unknown":color=APP_CONFIG.chartColors.assetTypes.unknown;break;case"realassets":color=APP_CONFIG.chartColors.assetTypes.realAssets}return color}}]),angular.module("filters").filter("sviBoolean",["$filter","APP_CONFIG",function($filter,APP_CONFIG){return function(input,labels){var myLabels=$.extend({},{true:"Yes",false:"No",multiple:"Multiple",na:APP_CONFIG.naValue},labels);switch(input){case"true":case"TRUE":case"True":case!0:return myLabels.true;case"false":case"FALSE":case"False":case!1:return myLabels.false;case"multiple":case"Multiple":case"MULTIPLE":return myLabels.multiple;default:return myLabels.na}}}]),angular.module("filters").filter("sviCamelCase",["$filter",function($filter){return function(input,from){if(angular.isString(from)||(from="normal"),angular.isString(input))switch(from){case"snake":input=input.replace(/([\-_]\w)/g,function(m){return m[1].toUpperCase()});break;default:input=input.replace(/(\s\w)/g,function(m){return m[1].toUpperCase()})}return input}}]),angular.module("filters").filter("convertSpaces",["$filter",function($filter){return function(input,replace){return"string"!=typeof replace&&(replace=""),input.replace(/ /g,replace)}}]),angular.module("filters").filter("sviCurrency",["$filter","APP_CONFIG",function($filter,APP_CONFIG){return function(input,useMinusSign,symbol,precision,minPrecision,showDashOnZero){angular.isUndefined(input)&&(input=null),(angular.isUndefined(symbol)||null===symbol)&&(symbol="$"),(angular.isUndefined(precision)||null===precision)&&(precision=2),(angular.isUndefined(showDashOnZero)||null===showDashOnZero)&&(showDashOnZero=!1),useMinusSign=svi.ng.strToBoolean(useMinusSign,!0);var number=parseFloat(input);if(isNaN(number))return!APP_CONFIG.naValueNullOnly||null===input||"number"==typeof input&&isNaN(input)?APP_CONFIG.naValue:input;if(angular.isObject(precision)){var temp=2,digits=0;if(0!==number&&(digits=Math.floor(Math.log10(Math.abs(number)))+1),precision.hasOwnProperty(digits))temp=precision[digits];else{var minX=-1;for(var x in precision)precision.hasOwnProperty(x)&&x<digits&&minX<x&&(temp=precision[x],minX=x)}precision=temp}if((angular.isUndefined(minPrecision)||null===minPrecision)&&(minPrecision=precision),precision!=minPrecision&&0<precision){var fractionLen=((number+"").split(".")[1]||"").length;1==(fractionLen=Math.max(fractionLen,minPrecision))&&1!=minPrecision&&(fractionLen=2),precision=Math.min(fractionLen,precision)}var value=$filter("currency")(input,symbol,precision);return number<0&&!useMinusSign&&(value=value.replace("-","(")+")"),showDashOnZero&&0===input&&(value="-"),value}}]),angular.module("filters").filter("currencyChange",["$filter","$sce","APP_CONFIG",function($filter,$sce,APP_CONFIG){return function(input,useMinusSign,symbol,precision,forcePrecision){angular.isUndefined(input)&&(input=null),angular.isString(input)&&(input=input.replace(new RegExp("[$"+(symbol||"")+",]","g"),""));var output,num=parseFloat(input),value=$filter("sviCurrency")(input,useMinusSign,symbol,precision,forcePrecision);return output=isNaN(num)?value:0<num?'<span class="positive">'+value+"</span>":num<0?'<span class="negative">'+value+"</span>":'<span class="neutral">'+value+"</span>",$sce.trustAsHtml(output),output}}]),angular.module("filters").filter("currencyIndicator",["$filter","$sce","APP_CONFIG",function($filter,$sce,APP_CONFIG){return function(input,useMinusSign,symbol,fractionSize){angular.isUndefined(input)&&(input=null),angular.isString(input)&&(input=input.replace(new RegExp("[$"+(symbol||"")+",]","g"),""));var output,num=parseFloat(input),value=$filter("currencyChange")(input,useMinusSign,symbol,fractionSize);return output=isNaN(num)?value:0<num?value+'<span class="positive glyphicon glyphicon-arrow-up"></span><span class="svi-visually-hidden">up</span>':num<0?value+'<span class="negative glyphicon glyphicon-arrow-down"></span><span class="svi-visually-hidden">down</span>':value,$sce.trustAsHtml(output),output}}]),angular.module("filters").filter("currencyPctIndicator",["$filter","$sce","APP_CONFIG",function($filter,$sce,APP_CONFIG){return function(currencyInput,pctInput,useMinusSign,symbol,fractionSize){angular.isUndefined(currencyInput)&&(currencyInput=null),angular.isString(currencyInput)&&(currencyInput=currencyInput.replace(new RegExp("[$"+(symbol||"")+",]","g"),""));var currencyNum=parseFloat(currencyInput);angular.isUndefined(pctInput)&&(pctInput=null);var pctNum=parseFloat(pctInput),output=$filter("currencyChange")(currencyInput,useMinusSign,symbol,fractionSize);pctNum&&(output+=" ("+$filter("percentChange")(pctInput,fractionSize,useMinusSign)+")");return 0<currencyNum?output+='<span class="positive glyphicon glyphicon-arrow-up"></span><span class="svi-visually-hidden">up</span>':currencyNum<0&&(output+='<span class="negative glyphicon glyphicon-arrow-down"></span><span class="svi-visually-hidden">down</span>'),$sce.trustAsHtml(output),output}}]),angular.module("filters").filter("sviDate",["$filter","APP_CONFIG",function($filter,APP_CONFIG){var formatTime=function(input,format,ignoreTimezone){if(!ignoreTimezone)return $filter("date")(input,format);switch(format){case"medium":return $filter("date")(input,format,"UTC")+" ET";default:return $filter("date")(input,format,"UTC")}};return function(input,format,ignoreTimezone){return input?(ignoreTimezone=svi.ng.strToBoolean(ignoreTimezone,!0),("number"==typeof input||input instanceof Date?formatTime:function(input,format,ignoreTimezone){var hasTime=!1;ignoreTimezone&&(19<input.length&&(input=input.substring(0,19)),12<input.length&&(input+="+00:00",hasTime=!0));var d=new Date(input);return!angular.isDate(d)||isNaN(d.valueOf())?APP_CONFIG.naValueNullOnly&&null!==input?input:APP_CONFIG.naValue:formatTime(input,format,hasTime)})(input,format,ignoreTimezone)):APP_CONFIG.naValue}}]),angular.module("filters").filter("ellipsis",["$filter","$sce","bsBreakpoint",function($filter,$sce,bsBreakpoint){return function(input,len,tooltip,mobileTooltip){if(angular.isObject(len)){var breakpoint=bsBreakpoint.getBreakpoint();len=breakpoint>=bsBreakpoint.LG&&len.hasOwnProperty("lg")?len.lg:breakpoint>=bsBreakpoint.MD&&len.hasOwnProperty("md")?len.md:breakpoint>=bsBreakpoint.SM&&len.hasOwnProperty("sm")?len.sm:len.hasOwnProperty("xs")?len.xs:len.hasOwnProperty("default")?len.default:255}if(!input||"string"!=typeof input||!len||input.length<=len)return input;var output=input.trim();return output.length<=len+1||(output=output.substr(0,len).trim()+"&hellip;",output=!bsBreakpoint.isMobile()&&angular.isDefined(tooltip)&&tooltip||bsBreakpoint.isMobile()&&angular.isDefined(mobileTooltip)&&mobileTooltip?'<span title="'+input+'" aria-label="'+input+'">'+output+"</span>":'<span aria-label="'+input+'">'+output+"</span>",$sce.trustAsHtml(output)),output}}]),angular.module("filters").filter("fancyDate",["$filter","$sce","APP_CONFIG",function($filter,$sce,APP_CONFIG){return function(input){if(!input)return APP_CONFIG.naValue;10<input.length&&(input=input.substring(0,10));var d=new Date(input);if(!angular.isDate(d)||isNaN(d.valueOf()))return APP_CONFIG.naValueNullOnly&&null!==input?input:APP_CONFIG.naValue;var output=$filter("date")(input,"'<strong>'MMM d '</strong><br/>'yyyy");return $sce.trustAsHtml(output),output}}]),angular.module("filters").filter("fileSize",["$filter",function($filter){return function(bytes){if(isNaN(parseFloat(bytes))||!isFinite(bytes)||0===bytes)return"0";var measure,floor,precision;return 0xffffffffff<bytes?measure=4:1048575999<bytes&&bytes<=0xffffffffff?measure=3:1024e3<bytes&&bytes<=1048575999?measure=2:bytes<=1024e3&&(measure=1),precision=3<(floor=Math.floor(bytes/Math.pow(1024,measure)).toString().length)?0:3-floor,(bytes/Math.pow(1024,measure)).toFixed(precision)+{1:"KB",2:"MB",3:"GB",4:"TB"}[measure]}}]),angular.module("filters").filter("interestFrequency",["$filter",function($filter){return function(interestFrequency){var string="";switch(interestFrequency.toLowerCase()){case"atmaturity":string="At Maturity";break;case"daily":string="Daily";break;case"weekly":string="Weekly";break;case"monthly":string="Monthly";break;case"quarterly":string="Quarterly";break;case"semiannual":string="Semi Annual";break;case"yearly":string="Yearly"}return string}}]),angular.module("filters").filter("json",function(){return function(input,htmlencode){var output=JSON.stringify(input);return angular.isDefined(htmlencode)&&htmlencode&&"N"!=htmlencode&&"false"!=htmlencode&&(output=php.htmlspecialchars(output)),output}}),angular.module("filters").filter("labels",["APP_CONFIG",function(APP_CONFIG){return function(input,labels){return angular.isUndefined(input)||null===input?APP_CONFIG.naValue:labels&&labels.hasOwnProperty(input)?labels[input]:input}}]),angular.module("filters").filter("maturityDate",["$filter","$sce","APP_CONFIG",function($filter,$sce,APP_CONFIG){return function(input){if(!input)return APP_CONFIG.naValue;10<input.length&&(input=input.substring(0,10));var d=new Date(input);if(!angular.isDate(d)||isNaN(d.valueOf()))return APP_CONFIG.naValueNullOnly&&null!==input?input:APP_CONFIG.naValue;var output=$filter("date")(input,"MMM dd yyyy");return $sce.trustAsHtml(output),output}}]),angular.module("filters").filter("month",["$filter","$sce","APP_CONFIG",function($filter,$sce,APP_CONFIG){return function(input,bold){if(input=parseInt(input),isNaN(input)||input<1||12<input)return APP_CONFIG.naValue;bold=svi.ng.strToBoolean(bold,!0);var output=["January","February","March","April","May","June","July","August","September","October","November","December"][input-1];return bold&&(output="<strong>"+output+"</strong>",$sce.trustAsHtml(output)),output}}]),angular.module("filters").filter("newline",["$sce",function($sce){return function(input){if("string"!=typeof input)return input;var output=input.replace(/\n/g,"<br/>");return $sce.trustAsHtml(output),output}}]),angular.module("filters").filter("sviNumber",["APP_CONFIG","$filter",function(APP_CONFIG,$filter){var SUFFIXIES=["K","M","B","T"];return function(input,precision,forcePrecision,suffix){angular.isUndefined(input)&&(input=null);var number=parseFloat(input);if(isNaN(number))return!APP_CONFIG.naValueNullOnly||null===input||"number"==typeof input&&isNaN(input)?APP_CONFIG.naValue:input;if((angular.isUndefined(precision)||null===precision)&&(precision=2),angular.isObject(precision)){var temp=2,digits=0;if(0!==number&&(digits=Math.floor(Math.log10(Math.abs(number)))+1),precision.hasOwnProperty(digits))temp=precision[digits];else{var minX=-1;for(var x in precision)precision.hasOwnProperty(x)&&x<digits&&minX<x&&(temp=precision[x],minX=x)}precision=temp}if(forcePrecision=svi.ng.strToBoolean(forcePrecision,!1),suffix=svi.ng.strToBoolean(suffix,!1),!forcePrecision&&0<precision){var fractionLen=((number+"").split(".")[1]||"").length;precision=Math.min(fractionLen,precision)}if(suffix&&1e3<=Math.abs(input)){precision=2;var inputAbs=Math.abs(input),exp=Math.floor(Math.log(inputAbs)/Math.log(1e3));inputAbs/=Math.pow(1e3,exp);var res=$filter("number")(inputAbs,precision)+""+SUFFIXIES[exp-1];return 0<input?res:"-"+res}return $filter("number")(input,precision)}}]),angular.module("filters").filter("objectToHTML",["$filter","$sce",function($filter,$sce){return function(input){if(!angular.isObject(input)||!input.hasOwnProperty("tag"))return"";var output="<";if(output+=input.tag+" ",input.hasOwnProperty("attributes"))for(var x in input.attributes)input.attributes.hasOwnProperty(x)&&(output+=x,null===input.attributes[x]?output+=" ":"object"==typeof input.attributes[x]?output+='="'+JSON.stringify(input.attributes[x]).replace(/"/g,"&quot;")+'" ':"string"==typeof input.attributes[x]?output+='="'+input.attributes[x].replace(/"/g,"&quot;")+'" ':output+='="'+input.attributes[x]+'" ');return output+=">",input.hasOwnProperty("content")&&("object"==typeof input.content?output+=$filter("objectToHTML")(input.content):output+=input.content),output+="</"+input.tag+">",$sce.trustAsHtml(output)}}]),angular.module("filters").filter("optionLevel",["$filter",function($filter){return function(optionLevel,labels){var myLabels=angular.extend({},{optionLevel0:"None",optionLevel1:"Covered Calls",optionLevel2:"Buying Long Calls & Puts",optionLevel3:"Spreads and Long Straddles",optionLevel4:"Naked Equity Put Writing",optionLevel5:"Naked Equity Call & Put Writing, Short Straddles",optionLevel6:"Naked Index Call & Put Writing",optionLevelUnknown:"Not Available"},labels);return optionLevel="optionLevel"+optionLevel.toString(),myLabels.hasOwnProperty(optionLevel)?myLabels[optionLevel]:myLabels.optionLevelUnknown}}]),angular.module("filters").filter("percent",["APP_CONFIG",function(APP_CONFIG){return function(input,precision,useMinusSign,usePlusSign){angular.isUndefined(input)&&(input=null),isNaN(precision)&&(precision=2),useMinusSign=!!(angular.isUndefined(useMinusSign)||"string"==typeof useMinusSign&&"false"!=useMinusSign.toLowerCase()||"boolean"==typeof useMinusSign&&useMinusSign),usePlusSign=!(angular.isUndefined(usePlusSign)||"string"==typeof usePlusSign&&"true"!=usePlusSign.toLowerCase()||"boolean"==typeof usePlusSign&&!usePlusSign);var number=parseFloat(input).toFixed(precision);return isNaN(number)?!APP_CONFIG.naValueNullOnly||null===input||"number"==typeof input&&isNaN(input)?APP_CONFIG.naValue:input:(number+="%",input<0&&!useMinusSign&&(number="("+number.replace("-","")+")"),0<input&&usePlusSign&&(number="+"+number),number)}}]),angular.module("filters").filter("percentChange",["$filter","$sce",function($filter,$sce){return function(input,precision,useMinusSign,usePlusSign){angular.isUndefined(input)&&(input=null);var output,num=parseFloat(input),value=$filter("percent")(input,precision,useMinusSign),plusSign=(usePlusSign=svi.ng.strToBoolean(usePlusSign,!1))?"+":"";return output=isNaN(num)?value:0<num?'<span class="positive">'+plusSign+value+"</span>":num<0?'<span class="negative">'+value+"</span>":'<span class="neutral">'+value+"</span>",$sce.trustAsHtml(output),output}}]),angular.module("filters").filter("percentIndicator",["$filter","$sce","APP_CONFIG",function($filter,$sce,APP_CONFIG){return function(input,useMinusSign,symbol){angular.isUndefined(input)&&(input=null);var output,num=parseFloat(input),value=$filter("percentChange")(input,useMinusSign,symbol);return output=isNaN(num)?value:0<num?value+'<span class="positive glyphicon glyphicon-arrow-up"></span><span class="svi-visually-hidden">up</span>':num<0?value+'<span class="negative glyphicon glyphicon-arrow-down"></span><span class="svi-visually-hidden">down</span>':value,$sce.trustAsHtml(output),output}}]),angular.module("filters").filter("riskValue",["$filter",function($filter){var numberFilter=$filter("number");return function(value,riskMeasure){var result;if(angular.isUndefined(value))result="N/A";else{var decimals=2;"RISKGRADE"===riskMeasure&&(decimals=0),result=numberFilter(value,decimals)}return result}}]),angular.module("filters").filter("selectDisplay",["$filter",function($filter){return function(input,options){var i,l;if(options&&angular.isArray(options)){for(i=0,l=options.length;i<l;i++)if(angular.isObject(options[i])&&options[i].hasOwnProperty("value")&&options[i].hasOwnProperty("label")&&options[i].value==input)return options[i].label}else if(options&&angular.isObject(options))for(i in options)if(options.hasOwnProperty(i)&&angular.isObject(options[i])&&options[i].hasOwnProperty("value")&&options[i].hasOwnProperty("label")&&options[i].value==input)return options[i].label;return input}}]),angular.module("filters").filter("sviSnakeCase",["$filter",function($filter){return function(input,from,snake){if(angular.isString(from)||(from="normal"),angular.isString(snake)||(snake="-"),angular.isString(input))switch(from){case"camel":input=input.replace(/(\w[A-Z])/g,function(m){return m[0]+snake+m[1]}).toLowerCase();break;default:input=input.replace(/(\s\w)/g,function(m){return snake+m[1]}).toLowerCase()}return input}}]),angular.module("filters").filter("stripTimeFromDate",function(){return function(stringDate){return stringDate.split(" ")[0]}}),angular.module("filters").filter("substitute",["$filter",function($filter){return function(input,subs){if(angular.isString(input)&&angular.isObject(subs))for(var x in subs)subs.hasOwnProperty(x)&&(input=input.replace(x,subs[x]));return input}}]),angular.module("filters").filter("term",["$filter","$sce","APP_CONFIG",function($filter,$sce,APP_CONFIG){return function(input){return input?(1===input?input="1 Month":input+=" Months",input):APP_CONFIG.naValue}}]),angular.module("filters").filter("textColor",function(){var DARK="#000000",cutHex=function(h){return"#"==h.charAt(0)?h.substring(1,7):h},hexToI=function(h){if(!/^[0-9a-fA-F]{2}$/.test(h))return null;var i=parseInt(h,16);return isNaN(i)?null:i},colorCache={};return function(background){if(!angular.isString(background))return DARK;if(colorCache.hasOwnProperty(background))return colorCache[background];var h,r=3==(h=cutHex(h=background)).length?(h=h.substring(0,1),hexToI(h+=h)):6==h.length?hexToI(h.substring(0,2)):null,g=function(h){return 3==(h=cutHex(h)).length?(h=h.substring(1,2),hexToI(h+=h)):6==h.length?hexToI(h.substring(2,4)):null}(background),b=function(h){return 3==(h=cutHex(h)).length?(h=h.substring(2,3),hexToI(h+=h)):6==h.length?hexToI(h.substring(4,6)):null}(background);if(null===r||null===g||null===b)return colorCache[background]=DARK;var c=[r/255,g/255,b/255].map(function(c){return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)}),fg=.179<.2126*c[0]+.7152*c[1]+.0722*c[2]?DARK:"#ffffff";return colorCache[background]=fg}}),angular.module("filters").filter("sviTitleCase",["$filter",function($filter){return function(input){return angular.isString(input)&&(input=input.replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()})),input}}]),angular.module("filters").filter("transactionType",["$filter",function($filter){return function(transactionType){var string="";switch(transactionType.toLowerCase()){case"buy":string="Buy";break;case"sell":string="Sell";break;case"buytoopen":string="Buy To Open";break;case"buytoclose":string="Buy To Close";break;case"selltoopen":string="Sell To Open";break;case"selltoclose":string="Sell To Close";break;case"sellshort":string="Sell Short";break;case"buytocover":string="Buy To Cover"}return string}}]),angular.module("filters").filter("trustedHtml",["$sce",function($sce){return function(input){if("string"!=typeof input)return input;var div=document.createElement("div");return div.innerHTML=input,$sce.trustAsHtml(div.textContent)}}]),angular.module("filters").filter("urldecode",function(){return function(input){return decodeURIComponent(input)}}),angular.module("filters").filter("urlencode",function(){return function(input){return encodeURIComponent(input)}}),angular.module("filters").filter("sviWords",["$filter",function($filter){return function(input,from){if(angular.isString(from)||(from="camel"),angular.isString(input))switch(from){case"snake":input=input.replace(/[\-_]/g," ");break;default:input=input.replace(/([A-Z])/g,function(m){return" "+m.toLowerCase()})}return input}}]),angular.module("services").service("accountGroup",["$http",function($http){this.group={nickname:null,id:null,accounts:[]},this.accountInfo={account:null},this.urlBase="/Web/user/accountGroup",this.list=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase,config)},this.get=function(id,invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase+"/"+id,config)},this.create=function(nickname,accounts){if(!nickname||!angular.isArray(accounts))return!1;var group=this.setGroup(nickname,accounts);return $http.post(this.urlBase,group)},this.update=function(id,nickname,accounts){if(!id||!nickname||!angular.isArray(accounts))return!1;var group=this.setGroup(nickname,accounts,id);return $http.put(this.urlBase+"/"+id,group)},this.remove=function(id){return!!id&&$http.delete(this.urlBase+"/"+id)},this.getAccountInfo=function(accounts){for(var _accounts=[],i=0;i<accounts.length;i++){var accountInfo=jQuery.extend(!0,{},this.accountInfo);accountInfo.account=accounts[i],_accounts.push(accountInfo)}return _accounts},this.setGroup=function(nickname,accounts,id){var group=jQuery.extend(!0,{},this.group);return group.nickname=nickname,!1===angular.isUndefined(id)&&(group.id=id),group.accounts=this.getAccountInfo(accounts),group}}]),angular.module("services").service("accountList",["APP_CONFIG",function(APP_CONFIG){var self=this;if(svi.hasOwnProperty("accountList")){var x;for(x in svi.accountList)svi.accountList.hasOwnProperty(x)&&(self[x]=svi.accountList[x])}else{var groupList=null;self.getNicknameSeparator=function(){return" - "},self.splitAccountFromNickname=function(str){var sep=self.getNicknameSeparator(),components=String(str).split(sep);return 2<components.length?[components.shift().trim(),components.join(sep).trim()]:[components[0].trim(),1<components.length?components[1].trim():""]},self.getAccountsWithNicknames=function(){if(0===APP_CONFIG.accountList.length)throw new Error("account list is empty");return APP_CONFIG.accountList},self.getAccountObjects=function(){for(var _accounts=self.getAccountsWithNicknames(),accounts=[],i=0;i<_accounts.length;i++){var a=self.splitAccountFromNickname(_accounts[i]),account=a[0],nickname=a[1],productTypes=self.getProductTypesByIndex(i),productId=null,productName=null;productTypes&&1==productTypes.length&&(productId=productTypes[0].code,productName=productTypes[0].name),accounts.push({index:i,account:account,nickname:nickname,boid:self.getBoidByIndex(i),productId:productId,productName:productName,productTypes:productTypes})}return accounts},self.getAccounts=function(){if(0===APP_CONFIG.accountList.length)throw{name:"Error",message:"account list is empty"};for(var accounts=[],accountList=APP_CONFIG.accountList,i=0;i<accountList.length;i++){var _a=self.splitAccountFromNickname(accountList[i]);accounts.push(_a[0])}return accounts},self.getAccountIndex=function(account){if(account=String(account),0===APP_CONFIG.accountList.length)throw{name:"Error",message:"account list is empty"};for(var accountList=APP_CONFIG.accountList,i=0;i<accountList.length;i++){if(self.splitAccountFromNickname(accountList[i])[0].replace(/[^a-z0-9]/gi,"")===account.replace(/[^a-z0-9]/gi,""))return i}return!1},self.getAccountByIndex=function(index){if(index=parseInt(index),!isNaN(index)){var accounts=self.getAccounts();if(accounts.length>index)return accounts[index]}return null},self.getAccountObjectByIndex=function(index){var accounts=self.getAccountObjects();return accounts&&accounts.hasOwnProperty(index)?accounts[index]:null},self.getProductTypesByIndex=function(index){return APP_CONFIG.accountProductTypes&&APP_CONFIG.accountProductTypes.length>index?APP_CONFIG.accountProductTypes[index]:null},self.getBoidByIndex=function(index){return APP_CONFIG.accountBoids&&APP_CONFIG.accountBoids.length>index?APP_CONFIG.accountBoids[index]:null},self.getCurrentAccount=function(){return APP_CONFIG.currentAccount},self.setCurrentAccountIndex=function(accountIndex){var account=self.getAccountByIndex(accountIndex);return null!==account&&(APP_CONFIG.currentAccount!=account&&(APP_CONFIG.currentAccount=account),self)},self.getCurrentAccountIndex=function(){return self.getAccountIndex(self.getCurrentAccount())},self.getCurrentAccountDisplay=function(){return self.getAccountsWithNicknames()[self.getCurrentAccountIndex()]},self.displayAccount=function(account){return angular.isObject(account)?account.nickname?account.account+self.getNicknameSeparator()+account.nickname:account.account:angular.isString(account)?account:""},self.getIndexesFromObjects=function(list){var indexes=[];if(angular.isArray(list))for(var i=0,l=list.length;i<l;i++)indexes.push(list[i].index);return indexes},self.getCurrentAccountIndexList=function(){return APP_CONFIG.currentAccountList},self.setCurrentAccountIndexList=function(list){angular.isArray(list)&&(APP_CONFIG.currentAccountList=list)},self.getCurrentGroup=function(){return angular.isString(APP_CONFIG.currentGroup)&&(APP_CONFIG.currentGroup=JSON.parse(APP_CONFIG.currentGroup)),APP_CONFIG.currentGroup},self.setCurrentGroup=function(group){return!(null!==group&&!self.isValidGroup(group))&&(APP_CONFIG.currentGroup=group,!0)},self.getGroupByAccountIndex=function(accountIndex){var group=[];return groupList&&Object.keys(groupList).forEach(function(key){groupList[key].accounts&&groupList[key].accounts.length&&(groupList[key].accounts.find(function(item){return item.index===accountIndex})&&group.push(groupList[key]))}),group},self.getGroupByGroupId=function(groupId){if(groupList)return groupList[groupId]},self.isValidGroup=function(group){return angular.isObject(group)&&group.hasOwnProperty("id")&&(null===groupList||groupList.hasOwnProperty(group.id))&&group.hasOwnProperty("nickname")&&group.hasOwnProperty("accounts")&&angular.isArray(group.accounts)},self.setGroupList=function(groups){angular.isObject(groups)&&(groupList=groups)},self.getCurrentGroupIndexes=function(){return self.getCurrentGroup().accounts.map(function(account){return account.index})},svi.accountList=self}}]),angular.module("services").service("actionMenu",["eventDispatcher","$timeout",function(eventDispatcher,$timeout){this.startFastFind=function(){eventDispatcher.trigger("FASTFIND.SHOW",{})},this.startHoldingZoom=function(data){var symbol=data.SYMBOL;if(symbol){var underlying=data.UL_SYMBOL?data.UL_SYMBOL:"",investmentType=data.INVESTMENT_TYPE?data.INVESTMENT_TYPE:"",subType=data.SUB_TYPE?data.SUB_TYPE:"",securityType=data.SECURITY_TYPE?data.SECURITY_TYPE:"";data.hasOwnProperty("ACCOUNT_INDEX")&&""!==data.ACCOUNT_INDEX&&null!==data.ACCOUNT_INDEX&&angular.element(".svi-holding-zoom").controller().setAccounts([data.ACCOUNT_INDEX]),eventDispatcher.trigger("HOLDINGZOOM.SYMBOL.CHANGED",{symbol:symbol,underlying:underlying,investmentType:investmentType,useParentData:!1,subType:subType,securityType:securityType}),$timeout(function(){var modal=$("#svi-holding-zoom-modal");modal.modal("show"),modal.find(".nav-tabs .default-tab").tab("show")})}},this.startTradeWidget=function(data){var symbol=data.SYMBOL;symbol||(data.UL_SYMBOL?(symbol=data.UL_SYMBOL,data.investmentType="Stock"):data.allowSymbolEdit=!0),eventDispatcher.trigger("TRADEWIDGET.SYMBOL.CHANGED",{symbol:symbol});var tradeWidget={};tradeWidget.symbol=symbol,tradeWidget.allowSymbolEdit=data.allowSymbolEdit,tradeWidget.side=data.side,tradeWidget.limit=data.limit,tradeWidget.investmentType=data.investmentType,tradeWidget.price=data.price,data.sellAll?tradeWidget.qty=data.QTY:tradeWidget.qty=0,tradeWidget.clear=data.clear,data.hasOwnProperty("ACCOUNT_INDEX")&&(tradeWidget.account=data.ACCOUNT_INDEX),$timeout(function(){eventDispatcher.trigger("TRADEWIDGET.SHOW",tradeWidget)})},svi.hasOwnProperty("launcher")||(svi.launcher=this)}]),angular.module("services").service("agreements",["$http",function($http){this.signAgreements=function(mode,data){var url="/Web/user/agreements/"+mode+"/submit";return $http.post(url,data)}}]),angular.module("services").service("assetallocation",["$http",function($http){this.getAssetAllocationByAccounts=function(accounts,data,invalidateCache){if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N";var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get("/Web/multiAccount/"+accounts.join(",")+"/portfolioSummary/assetAllocation/byAccount?"+$.param(svi.util.sortByKeys(data)),config)},this.getAssetAllocations=function(accounts,data,invalidateCache){if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N";var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get("/Web/multiAccount/"+accounts.join(",")+"/portfolioSummary/assetAllocation/byAssetType?"+$.param(svi.util.sortByKeys(data)),config)},this.getAssetAllocationsByClassification=function(accounts,data){if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");var url="/Web/multiAccount/"+accounts.join(",")+"/portfolioSummary/assetAllocation/byAssetClassification";if(void 0!==data&&data){var query=$.param(svi.util.sortByKeys(data));return $http.get(url+"?"+query)}return $http.get(url)}}]),angular.module("services").service("assetOverview",["$http",function($http){var isValidAccount=function(account){return!angular.isUndefined(account)&&($.isNumeric(account)||angular.isArray(account)||"all"===account)};this.getAssetOverview=function(account,data,invalidateCache){if(!isValidAccount(account))return!1;var base="/Web/account/";angular.isArray(account)?(1<account.length&&(base="/Web/multiAccount/"),account=account.join(",")):"all"===account&&(base="/Web/multiAccount/");var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get(base+account+"/assetOverview?"+$.param(svi.util.sortByKeys(data)),config)},this.getIncomeMargin=function(account,data,invalidateCache){if(!isValidAccount(account))return!1;var base="/Web/account/";angular.isArray(account)?(1<account.length&&(base="/Web/multiAccount/"),account=account.join(",")):"all"===account&&(base="/Web/multiAccount/");var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get(base+account+"/assetOverview/incomeMargin?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("balances",["$http",function($http){this.getBalances=function(account,data,invalidateCache){if(angular.isUndefined(account)||!$.isNumeric(account)&&!angular.isArray(account)&&"all"!=account)return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var base="/Web/account/";angular.isArray(account)?(1<account.length&&(base="/Web/multiAccount/"),account=account.join(",")):"all"==account&&(base="/Web/multiAccount/"),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N";var url=base+account+"/balances?"+$.param(svi.util.sortByKeys(data));return $http.get(url,config)},this.getTradingBalances=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N";var url="/Web/account/"+account+"/balances/trading?"+$.param(svi.util.sortByKeys(data));return $http.get(url,config)},this.getIncomeExpense=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N";var url="/Web/account/"+account+"/balances/incomeExpense?"+$.param(svi.util.sortByKeys(data));return $http.get(url,config)}}]),angular.module("services").service("bloodhound",function(){this.create=function(options){if(!angular.isObject(options))return!1;options.hasOwnProperty("datumTokenizer")||(options.datumTokenizer=Bloodhound.tokenizers.whitespace),options.hasOwnProperty("queryTokenizer")||(options.queryTokenizer=Bloodhound.tokenizers.whitespace);var engine=new Bloodhound(options);return engine.initialize(),engine}}),angular.module("services").service("bonusTrades",["$http",function($http){this.getBonusTrades=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/bonusTrades?"+$.param(svi.util.sortByKeys(data)),config)},this.getBonusTradesAccount=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/bonusTrades/account?"+$.param(svi.util.sortByKeys(data)),config)},this.getBonusTradesProcessedAccount=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/bonusTrades/processedAccount?"+$.param(svi.util.sortByKeys(data)),config)},this.getBonusTradesActivity=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/bonusTrades/activity?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("cache",["state","$http","$q","$timeout",function(state,$http,$q,$timeout){var self=this;self.getCacheKeys=function(){var cacheKeys=state.get("cacheKeys");return angular.isObject(cacheKeys)||(cacheKeys={}),cacheKeys},self.get=function(id){if(angular.isUndefined(id))return null;id=self.normalizeId(id);var value=state.get(id),ct=(new Date).getTime();return angular.isObject(value)?value.ttl&&value.ts+value.ttl<ct?(self.remove(id),null):value.value:null},self.set=function(id,value,ttl){if(!id||angular.isUndefined(value)||!angular.isNumber(ttl))return!1;id=self.normalizeId(id);var ct=(new Date).getTime();state.set(id,{value:value,ttl:ttl,ts:ct});var cacheKeys=self.getCacheKeys();return cacheKeys.hasOwnProperty(id)||(cacheKeys[id]=!0,state.set("cacheKeys",cacheKeys)),self},self.remove=function(id){if(!id)return self;id=self.normalizeId(id),state.remove(id);var cacheKeys=self.getCacheKeys();return cacheKeys.hasOwnProperty(id)&&(delete cacheKeys[id],state.set("cacheKeys",cacheKeys)),self},self.empty=function(){var cacheKeys=self.getCacheKeys();for(var id in cacheKeys)cacheKeys.hasOwnProperty(id)&&(state.remove(id),delete cacheKeys[id]);return state.set("cacheKeys",cacheKeys),self},self.normalizeId=function(id){return angular.isNumber(id)?id.toString():angular.isString(id)&&id.length<100?id:(angular.isString(id)||(id=JSON.stringify(id)),Sha1.hash(id))},self.getCachedUrl=function(url,ttl){var that=self,value=that.get(url);if(null===value)return $http.get(url).then(function(response){return 200==response.status&&response.data.success&&that.set(url,response,ttl),response});var deferred=$q.defer();return $timeout(function(){deferred.resolve(value)}),deferred.promise}}]),angular.module("services").service("calendar",["$http","cache","APP_CONFIG","$filter",function($http,cache,APP_CONFIG,$filter){var self=this,nyseHolidays=APP_CONFIG.nyseHolidays,nyseMarketHolidays=APP_CONFIG.nyseMarketHolidays,nyseShortDays=APP_CONFIG.nyseShortDays,prevYears=1,currentYear=APP_CONFIG.currentYear;$filter("date");moment.tz.setDefault("America/New_York");var parseDate=function(date){return!angular.isDate(date)&&(date=new Date(date),isNaN(date.getUTCTime()))?null:date};self.getHolidays=function(previousYears){var url="/Web/util/util/calendar";angular.isDefined(previousYears)&&angular.isNumber(previousYears)||(previousYears=1);var params={};return params.previousYears=previousYears,url+="?"+$.param(params),cache.getCachedUrl(url,864e5).then(function(response){return angular.isObject(response)&&response.hasOwnProperty("data")&&angular.isObject(response.data)&&response.data.hasOwnProperty("nyseHolidays")&&response.data.hasOwnProperty("previousYears")&&response.data.previousYears>prevYears&&(prevYears=response.data.previousYears,nyseHolidays=response.data.nyseHolidays,nyseShortDays=response.data.nyseShortDays,nyseMarketHolidays=response.data.nyseMarketHolidays),response})},self.isHoliday=function(date,isMarket){var dateInNyseHolidaysFormat=moment(date).format("MM/DD/YYYY");if("Invalid date"===dateInNyseHolidaysFormat)return null;var year=+moment(date).format("YYYY");return!year||year<currentYear-prevYears?null:!0===isMarket?-1!==nyseMarketHolidays.indexOf(dateInNyseHolidaysFormat):-1!==nyseHolidays.indexOf(dateInNyseHolidaysFormat)},self.isBusinessDay=function(date){var h=self.isHoliday(date);return null===h?null:!h&&!self.isWeekend(date)},self.isWeekend=function(date){if(null!==(date=parseDate(date))){var dow=date.getUTCDay();if(0==dow||6==dow)return!0}return!1},self.isWeekday=function(date){return null!==(date=parseDate(date))&&!self.isWeekend(date)},self.isPreMarketHours=function(preMarketEndTime){angular.isUndefined(preMarketEndTime)&&(preMarketEndTime="09:30");var currentTime=moment().format("HH:mm"),preMarketStart=moment("00:01","HH:mm"),perMarketEnd=moment(preMarketEndTime,"HH:mm");return!(!moment(currentTime,"HH:mm").isAfter(preMarketStart)||!moment(currentTime,"HH:mm").isBefore(perMarketEnd))},self.isMarketHours=function(){var currentTime=moment().format("HH:mm"),marketHoursStart=moment("09:45","HH:mm"),marketHoursEnd=moment("18:00","HH:mm");return!(!moment(currentTime,"HH:mm").isAfter(marketHoursStart)||!moment(currentTime,"HH:mm").isBefore(marketHoursEnd)||1===moment().day()&&7===moment().day())},self.isMarketOpen=function(openTime,closeTime){var marketHoursStart=moment(openTime,"HH:mm"),marketHoursEnd=moment(closeTime,"HH:mm"),time=moment().format("HH:mm");return moment(time,"HH:mm").isBetween(marketHoursStart,marketHoursEnd,null,"[)")},self.isShortenDay=function(date){return"Invalid date"===(date=moment(date).format("MM/DD/YYYY"))?null:-1!==nyseShortDays.indexOf(date)},self.getShortenMarketCloseTime=function(){return"13:00"},self.getMarketEventsSummaryInfo=function(date,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),angular.isDefined(date)||(date=$filter("date")(new Date,"yyyy-MM-dd"));var url="/Web/research/research/marketEventsSummary?date="+date;return $http.get(url,config)},svi.hasOwnProperty("calendar")||(svi.calendar=self)}]),angular.module("services").service("cashFlow",["$http",function($http){this.getCashFlow=function(account,data,invalidateCache){if(angular.isUndefined(account)||!$.isNumeric(account)&&!angular.isArray(account)&&"all"!=account)return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var base="/Web/account/";angular.isArray(account)?(1<account.length&&(base="/Web/multiAccount/"),account=account.join(",")):"all"==account&&(base="/Web/multiAccount/"),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N";var url=base+account+"/cashFlow?"+$.param(svi.util.sortByKeys(data));return $http.get(url,config)}}]),angular.module("services").service("cd",["$http",function($http){this.getCd=function(data,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url=getUrl(data);return!1!==url&&$http.get(url,config)};var getUrl=function(data){var url;(url="/Web/application/certificateOfDeposit",void 0!==data&&data)&&(url=url+"?"+$.param(data));return url}}]),angular.module("services").service("collections",function(){var self=this,iterateeToFunction=function(iteratee){if(!angular.isFunction(iteratee)){var property=iteratee;iteratee=function(p){return p[property]}}return iteratee};self.sortBy=function(collection,iteratees){return collection.sort(function(a,b){for(var result=0,i=0;i<iteratees.length;i++){var aValue,bValue,iteratee=iteratees[i];if(result=(bValue=angular.isFunction(iteratee)?(aValue=iteratee(a),iteratee(b)):(aValue=a[iteratee],b[iteratee]))<aValue?1:aValue<bValue?-1:0)break}return result})},self.values=function(obj){var result=[];for(var prop in obj)obj.hasOwnProperty(prop)&&result.push(obj[prop]);return result},self.map=function(collection,iteratee){var result;if(iteratee=iterateeToFunction(iteratee),Array.isArray(collection))result=collection.map(iteratee);else for(var key in result=[],collection)collection.hasOwnProperty(key)&&result.push(iteratee(collection[key],key,collection));return result},self.findLastIndex=function(collection,iteratee){return collection.lastIndexOf(iteratee)},self.reduce=function(collection,iteratee,accumulator){return Array.isArray(collection)||(collection=self.values(collection)),collection.reduce(iteratee,accumulator)};var compare=function(a,b,order){var result=b<a?1:a<b?-1:0;return"desc"===order&&(result=-result),result};self.orderBy=function(collection,iteratee,orders){return collection.sort(function(a,b){for(var result=0,i=0;i<iteratee.length;i++){var prop=iteratee[i];if(result=compare(a[prop],b[prop],orders[i]))break}return result})};var collect=function(arrays,i){var item=[];return arrays.forEach(function(a){item.push(a[i])}),item};self.zip=function(){for(var result=[],arrays=Array.from(arguments),len=arrays.reduce(function(max,y){return Math.max(max,y.length)},0),i=0;i<len;i++)result.push(collect(arrays,i));return result},self.groupBy=function(collection,iteratee){var iterateeFn=iterateeToFunction(iteratee),result={};return collection.forEach(function(item){var key=iterateeFn(item);result.hasOwnProperty(key)||(result[key]=[]),result[key].push(item)}),result},self.keys=function(object){var result=[];for(var property in object)object.hasOwnProperty(property)&&result.push(property);return result},self.mapKeys=function(object,iteratee){var result={};for(var property in object)object.hasOwnProperty(property)&&(result[iteratee(object[property],property)]=object[property]);return result}}),angular.module("services").factory("ColorMapper",["Colors","collections","$filter",function(Colors,collections,$filter){var assetTypeColorFilter=$filter("assetTypeColor"),sqopeToInvestorAssetTypeMap={Stock:"stock",Option:"option",ETF:"mutualfund","Fixed Income":"fixedincome",Fund:"mutualfund"},mapper={};return mapper.mapRisk=function(risk,riskRange){var color,adjustedRisk,sectionMagnitude,colors;0<(risk=Math.min(Math.max(Math.abs(risk),riskRange.min),riskRange.max))?(sectionMagnitude=risk<riskRange.minLow?(colors=Colors.riskColors.low,adjustedRisk=0,1):risk<riskRange.maxLow?(colors=Colors.riskColors.low,adjustedRisk=risk-riskRange.minLow,riskRange.maxLow-riskRange.minLow):risk<=riskRange.minHigh?(colors=Colors.riskColors.avg,adjustedRisk=risk-riskRange.maxLow,riskRange.minHigh-riskRange.maxLow):(colors=Colors.riskColors.high,adjustedRisk=risk-riskRange.minHigh,riskRange.maxHigh-riskRange.minHigh),color=colors[Math.min(colors.length-1,Math.round(adjustedRisk/sectionMagnitude*colors.length))]):color=Colors.riskColors.na;return color},mapper.mapPerformance=function(performance){var c,value,low,high,colors=Colors.perfColors,mid=~~(colors.length/2);if(isFinite(100*performance)){var performanceIndex=(value=50*performance,low=1-mid,high=mid-1,Math.min(Math.max(value,low),high));c=(c=mid+(performance?performanceIndex+(performanceIndex<=0?-1:1):0))<mid?Math.ceil(c):Math.floor(c)}else c=mid;return colors[c]},mapper.mapType=function(type){var investorAssetType=sqopeToInvestorAssetTypeMap.hasOwnProperty(type)?sqopeToInvestorAssetTypeMap[type]:"other";return assetTypeColorFilter(investorAssetType)},mapper.createSectorMapper=function(positions){var sectorMap=collections.groupBy(positions,"sector"),sectors=collections.map(sectorMap,function(positions,sector){return{sector:sector,marketValue:positions.reduce(function(sum,position){return sum+position.marketValue},0)}});return sectors.sort(function(a,b){return b.marketValue===a.marketValue?b.sector>a.sector?1:b.sector<a.sector?-1:0:b.marketValue>a.marketValue?1:-1}),sectors.forEach(function(sector,i){sector.color=Colors.sectorColors[i%Colors.sectorColors.length]}),sectorMap=collections.mapKeys(sectors,function(sector){return sector.sector}),function(sectorName){var sector=sectorMap[sectorName];return sector&&sector.color}},mapper}]),angular.module("services").service("Colors",function(){return{colorMap:{"pr-dark-grey-2":"#4d4d4d","pr-middle-grey":"#CCCCCC","pr-dark-grey":"#808080","pr-middle-green":"#39B54A","pr-red":"#ff0000","pr-dark-green":"#007632","pr-dark-teal-2":"#093a39","pr-light-grey-8":"#edeeef","pr-light-blue":"#29abe2","pr-yellow":"#ffff00","pr-light-teal":"#6c8b90","pr-light-green-2":"#d8eeca","pr-middle-green-4":"#3bba4c","pr-dark-teal":"#2c5c63","pr-light-grey":"#ededed"},riskColors:{low:["#006E2E","#318239","#359945","#3BBA4C"],avg:["#8DCF36","#A9E334","#FFDB00","#FFBF00"],high:["#FFA324","#FF8500","#FF5900","#FF0000"],na:"#BDBDBD"},perfColors:["#FF0000","#FF1111","#FF2222","#FF3333","#FF4444","#FF5555","#FF6666","#BDBDBD","#6FCA7C","#5DC36B","#4ABB5A","#38B449","#25AD39","#13A528","#009E17"],sectorColors:["#0d47a1","#0091ea","#6200ea","#9f1058","#00bfa5","#cddc39","#7b1fa2","#304ffe","#ffab00","#4a148c","#536dfe","#4caf50","#d81b60","#ffd600","#607d8b","#4527a0","#00b8d4","#8bc34a","#9c27b0"],otherChartColor:"#37474f",chartErrorColors:["#263238","#90a4ae","#455a64","#78909c","#b0bec5","#607d8b"],scoreRatingColors:[{score:199,color:"#BE1E2D",name:"poor"},{score:449,color:"#FF9499",name:"fair"},{score:499,color:"#69C369",name:"average"},{score:649,color:"#39B54A",name:"good"},{score:799,color:"#408C40",name:"very good"},{score:1e3,color:"#006838",name:"excellent"}]}}),angular.module("services").service("config",["$http","$q","cache","$timeout","$log",function($http,$q,cache,$timeout,$log){var self=this,logUnauthorized=function(response){return angular.isObject(response)&&response.hasOwnProperty("data")&&angular.isObject(response.data)&&response.data.hasOwnProperty("config")&&"***UNAUTHORIZED***"==response.data.config&&$log.error("Unauthorized Config Access: "+angular.toJson(response.data.keys)),response};self.getConfig=function(config,accountIndex){var url="/Web/util/config/";angular.isDefined(accountIndex)&&!1!==accountIndex&&(url+=accountIndex);var params={};return params.config=config,url+="?"+$.param(params),cache.getCachedUrl(url,36e5).then(logUnauthorized)},self.getConfigWithSubs=function(config,searchReplace,accountIndex){var deferred=$q.defer();return self.getConfig(config,accountIndex).then(function(response){if(angular.isObject(response)&&response.hasOwnProperty("data")&&(!response.hasOwnProperty("status")||200==response.status)){var data=response.data;if(data&&data.success){if(angular.isObject(searchReplace)&&0!==data.config.length)for(var dataKey in data.config)if(data.config.hasOwnProperty(dataKey))for(var searchKey in searchReplace)if(searchReplace.hasOwnProperty(searchKey)){var regex=new RegExp("\\*"+searchKey+"\\*","g");data.config[dataKey].url=data.config[dataKey].url.replace(regex,searchReplace[searchKey]).replace(/&/g,"&amp;")}return deferred.resolve(response),response}}return deferred.reject(response),response},deferred.reject),deferred.promise},self.getLegacyConfig=function(config,accountIndex){var url="/Web/util/config/legacy/";angular.isDefined(accountIndex)&&!1!==accountIndex&&(url+=accountIndex);var params={};return params.config=config,url+="?"+$.param(params),cache.getCachedUrl(url,36e5).then(logUnauthorized)},self.getTradeMenu=function(accountIndex){var url="/Web/util/config/tradeMenu/";return angular.isDefined(accountIndex)&&!1!==accountIndex&&(url+=accountIndex),$http.get(url)},self.getHeldAway=function(){return cache.getCachedUrl("/Web/util/config/heldAway/",36e5)},self.getAssetClassification=function(){return cache.getCachedUrl("/Web/util/config/assetClassification/",36e5)},self.getChartConfig=function(config){var url="/Web/util/config/chart/",params={};return params.config=config,url+="?"+$.param(params),cache.getCachedUrl(url,36e5).then(logUnauthorized)},svi.hasOwnProperty("config")||(svi.config=self)}]),angular.module("services").service("costbasis",["$http","$window","sviUrl","bsBreakpoint",function($http,$window,sviUrl,bsBreakpoint){var AVAILABLE_VIEW={UGL:"UGL",RGL:"RGL"};this.getUGL=function(account,data,isAdvanced,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var base="/Web/account/";angular.isArray(account)?((1<account.length||data.groupBy&&""!==data.groupBy)&&(base="/Web/multiAccount/"),account=account.join(",")):"all"===account&&(base="/Web/multiAccount/"),data.isAdvanced=isAdvanced,void 0!==data&&data&&angular.isObject(data)||(data={});var url=base+account+"/unrealizedGainLoss?"+$.param(svi.util.sortByKeys(data));return $http.get(url,config)},this.getRGL=function(account,data,invalidateCache){if(!angular.isUndefined(account)&&data&&void 0!==data){var config={},baseUrl="/Web/account/";angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),angular.isArray(account)?((1<account.length||data.groupBy&&""!==data.groupBy)&&(baseUrl="/Web/multiAccount/"),account=account.join(",")):"all"===account&&(baseUrl="/Web/multiAccount/");var url=baseUrl+account+"/realizedGainLoss?"+$.param(svi.util.sortByKeys(data));return $http.get(url,config)}},this.getGainLossOverview=function(account,data,invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),angular.isArray(account)&&1===account.length&&(account=account[0]),!(angular.isUndefined(account)||!$.isNumeric(account))&&(void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/unrealizedGainLoss/overview?"+$.param(svi.util.sortByKeys(data)),config))},this.exportUGL=function(account,data,newWindow){if(!angular.isUndefined(account)&&!angular.isUndefined(data)){var url,accountUrlPrefix=angular.isArray(account)&&1<account.length?"multiAccount":"account";if(void 0!==data&&data)data.pageSize=0,data.pageNum=0,url="/Web/"+accountUrlPrefix+"/"+account+"/unrealizedGainLoss/export?"+$.param(svi.util.sortByKeys(data));else url="/Web/"+accountUrlPrefix+"/"+account+"/unrealizedGainLoss/export";return angular.isDefined(newWindow)&&newWindow?$window.open(url):sviUrl.href(url),!0}},this.exportRGL=function(account,data,newWindow){if(!angular.isUndefined(account)&&!angular.isUndefined(data)){var url,accountUrlPrefix=angular.isArray(account)&&1<account.length?"multiAccount":"account";if(void 0!==data&&data)data.pageSize=0,data.pageNum=0,url="/Web/"+accountUrlPrefix+"/"+account+"/realizedGainLoss/export?"+$.param(svi.util.sortByKeys(data));else url="/Web/"+accountUrlPrefix+"/"+account+"/realizedGainLoss/export";return angular.isDefined(newWindow)&&newWindow?$window.open(url):sviUrl.href(url),!0}},this.getGainLossTotal=function(gainLoss,view){if(gainLoss&&(!view||Object.values(AVAILABLE_VIEW).includes(view)))return gainLoss.reduce(function(acc,curr){return acc+(view===AVAILABLE_VIEW.UGL&&curr.isChild?0:curr.gainLoss)},0)},this.getSortParam=function(param,scope){if(!scope.isAdvanced||scope.isSingleAccountSelected)return scope.isAdvanced&&scope.isSingleAccountSelected?scope.sortingOptions.default[param]:scope[param];var groupBy=scope.filters.groupBy||scope.groupBy;return""===groupBy&&(groupBy="all"),groupBy&&scope.sortingOptions?scope.sortingOptions[groupBy][param]:scope[param]},this.getGroupByColumnPriority=function(groupBy,priorityConfig,defaultPriorityConfig,isSingleAccount,isCustomView){if(priorityConfig&&defaultPriorityConfig){var priority=defaultPriorityConfig,configName="";if(configName=groupBy||(isCustomView?isSingleAccount?"customViewSingleAccount":"customViewMultiAccount":isSingleAccount?"singleAccountAll":"multiAccountAll"),bsBreakpoint){var breakpoint=bsBreakpoint.getBreakpoint(),config=priorityConfig[configName];config&&config.length&&(priority=config[breakpoint])}return priority||defaultPriorityConfig}}}]),angular.module("services").service("customView",["$http",function($http){this.urlBase="/Web/util/customView",this.getTypes=function(){return $http.get(this.urlBase)},this.getIds=function(type){return!!type&&$http.get(this.urlBase+"/"+type)},this.get=function(type,id){return!(!type||!id)&&$http.get(this.urlBase+"/"+type+"/"+id)},this.create=function(type,value){return!(!type||!value)&&$http.post(this.urlBase+"/"+type,value)},this.update=function(type,id,value){return!!(type&&id&&value)&&$http.put(this.urlBase+"/"+type+"/"+id,value)},this.remove=function(type,id){return!(!type||!id)&&$http.delete(this.urlBase+"/"+type+"/"+id)}}]),angular.module("services").service("dashboard",["$http",function($http){this.urlBase="/Web/user/dashboard",this.getTypes=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase,config)},this.getIds=function(type,invalidateCache){if(!type)return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase+"/"+type,config)},this.get=function(type,id,invalidateCache){if(!type||!id)return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase+"/"+type+"/"+id,config)},this.create=function(type,value){return!(!type||!value)&&$http.post(this.urlBase+"/"+type,value)},this.update=function(type,id,value){return!!(type&&id&&value)&&$http.put(this.urlBase+"/"+type+"/"+id,value)},this.remove=function(type,id){return!(!type||!id)&&$http.delete(this.urlBase+"/"+type+"/"+id)}}]),angular.module("services").factory("dateRange",["frequency","dateUtils",function(frequency,dateUtils){var ranges=[{shortDisplayName:"1D",displayName:"1 Day",propertyName:"oneDay",periodName:"OneDay",frequency:frequency.DAILY},{shortDisplayName:"1W",displayName:"1 Week",propertyName:"oneWeek",periodName:"OneWeek",frequency:frequency.DAILY},{shortDisplayName:"1M",displayName:"1 Month",propertyName:"oneMonth",periodName:"OneMonth",frequency:frequency.DAILY},{shortDisplayName:"3M",displayName:"3 Month",propertyName:"threeMonths",periodName:"ThreeMonths",frequency:frequency.DAILY},{shortDisplayName:"1Y",displayName:"1 Year",propertyName:"oneYear",periodName:"OneYear",frequency:frequency.MONTHLY},{shortDisplayName:"AT",displayName:"All Time",propertyName:"all",periodName:"AllTime",frequency:frequency.MONTHLY},{shortDisplayName:"YTD",displayName:"YTD",propertyName:"ytd",periodName:"YTD",frequency:frequency.MONTHLY},{shortDisplayName:"PY",displayName:"Prev. Year",propertyName:"prevYear",periodName:"PreviousYear",frequency:frequency.MONTHLY},{shortDisplayName:"LT",displayName:"Since Last Trade",propertyName:"sinceLastTrade",periodName:"SinceLastTrade",frequency:frequency.MONTHLY},{shortDisplayName:"Cu",displayName:"Custom",propertyName:"customRange",periodName:"Custom",frequency:frequency.MONTHLY}],dateEquals=function(date1,date2){var equals=date1===date2;return equals||(equals=date1&&date2&&date1 instanceof Date&&date2 instanceof Date&&date1.toDateString()===date2.toDateString()),equals},isCustom=function(range){return angular.isObject(range)&&range.hasOwnProperty("periodName")&&"Custom"===range.periodName};return{isCustom:isCustom,equals:function(a,b){var equal=angular.isObject(a)&&angular.isObject(b)&&a.hasOwnProperty("periodName")&&b.hasOwnProperty("periodName")&&a.periodName===b.periodName;return equal&&isCustom(a)&&(equal=dateEquals(a.fromDate,b.fromDate)&&dateEquals(a.toDate,b.toDate)),equal},getFullRange:function(range,nav,period){var fullRange=$.extend({},range),dates=nav[range.propertyName].period;return dates&&("customRange"===range.propertyName&&range.fromDate&&range.toDate||function(range,fromDate,toDate){if(range.fromDate=fromDate,range.toDate=toDate,range.fromDate&&range.toDate){if(range.fromDate>range.toDate){var temp=range.fromDate;range.fromDate=range.toDate,range.toDate=temp}if("sinceLastTrade"===range.propertyName||"ytd"===range.propertyName||"all"===range.propertyName||"customRange"===range.propertyName){var intervalDate=12*(range.toDate.getFullYear()-range.fromDate.getFullYear())+(range.toDate.getMonth()-range.fromDate.getMonth());range.frequency=Math.abs(intervalDate)<=3?frequency.DAILY:frequency.MONTHLY}}}(fullRange,dateUtils.parseYYYYMMDD(dates.startDate),dateUtils.parseYYYYMMDD(dates.endDate))),fullRange.twr=period[range.propertyName].twrr,fullRange.mwr=period[range.propertyName].mwr,fullRange.nav=nav[range.propertyName].twrr,fullRange},getAllRanges:function(){return ranges},getRange:function(periodName){return ranges.find(function(r){return r.periodName===periodName})}}}]),angular.module("services").factory("dateUtils",["$filter",function($filter){var dateUtil={},dateFilter=$filter("date"),INVALID_DATE=new Date("Invalid Date");dateUtil.isLeapYear=function(year){return 1===new Date(year,1,29).getMonth()},dateUtil.isValidYear=function(year){return 1900<=year},dateUtil.isValidMonth=function(month){return 0<=month&&month<=11},dateUtil.isValidDay=function(year,month,day){var validDays,mm=month+1;return validDays=1===month?28+(this.isLeapYear(year)?1:0):30+(1&mm^mm>>3),0<day&&day<=validDays},dateUtil.makeDate=function(year,month,day,strict){var result=new Date(year,month,day);return!strict||result.getFullYear()===year&&result.getMonth()===month&&result.getDate()===day||(result=INVALID_DATE),result},dateUtil.parseYYYYMMDD=function(yyyymmdd,strict){var result;if("string"!=typeof yyyymmdd)result=INVALID_DATE;else{var parts=yyyymmdd.split("-");if(3===parts.length){var year=parseInt(parts[0],10),month=parseInt(parts[1],10)-1,day=parseInt(parts[2],10);result=dateUtil.makeDate(year,month,day,strict)}else result=INVALID_DATE}return result},dateUtil.parseMMDDYYYY=function(mmddyyyy,strict){var result;if(mmddyyyy instanceof Date)return mmddyyyy;if("string"!=typeof mmddyyyy)result=INVALID_DATE;else{var parts=mmddyyyy.split("/");if(3!==parts.length&&(parts=mmddyyyy.split("-")),3===parts.length){var year=parseInt(parts[2]),month=parseInt(parts[0])-1,day=parseInt(parts[1]);result=dateUtil.makeDate(year,month,day,strict)}else result=INVALID_DATE}return result};var padToTwoDigits=function(value){return(value<10?"0":"")+value};return dateUtil.formatYYYYMMDD=function(date){if(!(date instanceof Date))return"Invalid Date";var year=date.getFullYear(),month=padToTwoDigits(date.getMonth()+1),day=padToTwoDigits(date.getDate());return isNaN(year)?"Invalid Date":year+"-"+month+"-"+day},dateUtil.formatShort=function(date){var year=date.getFullYear(),month=padToTwoDigits(date.getMonth()+1),day=padToTwoDigits(date.getDate());return isNaN(year)?"Invalid Date":month+"-"+day+"-"+year},dateUtil.normalizeDate=function(dateString,format){if(!dateString)return"";var date;if(angular.isDate(dateString)||angular.isNumber(dateString))date=dateString;else{if(!angular.isString(dateString))return"";if(!1===(date=php.strtotime(dateString.replace(/-/g,"/"))))return"";date*=1e3}return dateFilter(date,format)},dateUtil.getDate=function(){return new Date},dateUtil.getYear=function(){return dateUtil.getDate().getFullYear()},dateUtil}]),angular.module("services").service("docShare",["$http",function($http){this.getDocShareFilesList=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/docShare?"+$.param(svi.util.sortByKeys(data)),config)},this.uploadFile=function(account,data){return angular.isArray(account)&&1==account.length&&(account=account[0]),!(angular.isUndefined(account)||!$.isNumeric(account))&&(!!data&&$http.post("/Web/account/"+account+"/docShare/",data,{transformRequest:angular.identity,headers:{"Content-Type":undefined}}))},this.downloadFile=function(account,id){return angular.isArray(account)&&1==account.length&&(account=account[0]),!(angular.isUndefined(account)||!$.isNumeric(account))&&(!!id&&$http.get("/Web/account/"+account+"/docShare",id))},this.deleteFile=function(account,id){return angular.isArray(account)&&1==account.length&&(account=account[0]),!(angular.isUndefined(account)||!$.isNumeric(account))&&(!!id&&$http.delete("/Web/account/"+account+"/docShare/"+id.documentId))}}]),angular.module("services").service("eventDispatcher",["$rootScope","$log","$timeout",function($rootScope,$log,$timeout){var self=this,cache={},loadStack={},loadCount=0,loadExpected=0;self.trigger=function(evt,data){var i,l,p,pl;if(cache[evt]=data,svi.debug.enabled){var caller;try{caller=self.trigger.caller}catch(e){caller="Unknown"}$log.trace("Event: "+evt,"Triggered by: "+caller,data)}switch(evt){case"LOADER.IN_PROGRESS":loadStack.hasOwnProperty(data.id)||(loadStack[data.id]=data,loadCount++,0<loadExpected&&loadExpected--);break;case"LOADER.DONE":case"LOADER.CANCELED":loadStack.hasOwnProperty(data.id)&&(delete loadStack[data.id],0<loadCount&&loadCount--,data.retrying&&loadExpected++),self.isLoadingDone()&&!data.retrying&&$timeout(function(){self.isLoadingDone()&&(self.trigger("LOADER.ALL_DONE",{}),$log.debug("Event: LOADER.ALL_DONE"))})}for(i=0,l=svi.eventDispatcher.scopes.length;i<l;i++)svi.eventDispatcher.scopes[i].$emit(evt,data);var parts=evt.split(".");for(evt="*",p=0,pl=parts.length;p<pl-1;p++)for(evt=evt.replace("*",parts[p]+".*"),svi.debug.enabled&&$log.trace("Trigger Wildcard Event: "+evt),i=0,l=svi.eventDispatcher.scopes.length;i<l;i++)svi.eventDispatcher.scopes[i].$emit(evt,data)},self.on=function(evt,callback,cacheData,element){var cb=function(callback){return function(evt,data){if(angular.isObject(data)){var clonedData=angular.fromJson(angular.toJson(data));return callback(evt,clonedData)}return callback(evt,data)}}(callback),unRegister=$rootScope.$on(evt,cb);return(cacheData=svi.ng.strToBoolean(cacheData,!0))&&cache.hasOwnProperty(evt)&&cb(null,cache[evt]),element&&angular.isFunction(element.on)&&element.on("$destroy",function(){unRegister()}),unRegister},self.addSingleAccountListener=function(scope,element,fieldMap){var config=$.extend({listener:"listener",index:"eventAccount",target:"account"},fieldMap);scope[config.listener]&&self.on(scope[config.listener],function(e,data){if(angular.isObject(data)&&data.hasOwnProperty(scope[config.index])){var value=data[scope[config.index]];angular.isArray(value)&&0<value.length&&(value=value[0]),$.isNumeric(value)&&(scope[config.target]=value)}},!0,element)},self.isLoadingDone=function(){return loadCount+loadExpected==0},self.$trigger=self.trigger,self.broadcast=self.trigger,self.$on=self.on,self.attachSymbolListener=function($scope,$element,symbolKey,allowMultiple){angular.isString(symbolKey)&&""!==symbolKey&&null!==symbolKey||(symbolKey="symbol"),(angular.isUndefined(allowMultiple)||allowMultiple)&&(allowMultiple=!0),eventDispatcher.on("SYMBOL.CONTEXT.CHANGED",function(e,data){angular.isArray(data.symbolList)&&0<data.symbolList.length?$scope[symbolKey]=allowMultiple?data.symbolList:data.symbolList[0]:angular.isDefined(data.symbol)&&""!==data.symbol&&$scope[symbolKey]!=data.symbol&&($scope[symbolKey]=allowMultiple?[data.symbol]:data.symbol)},null,$element)};svi.hasOwnProperty("eventDispatcher")||(svi.eventDispatcher=self),function($scope){if(svi.eventDispatcher.hasOwnProperty("scopes")||(svi.eventDispatcher.scopes=[]),-1===svi.eventDispatcher.scopes.indexOf($scope)){var pos=svi.eventDispatcher.scopes.length;svi.eventDispatcher.scopes.push($scope),$scope.$on("$destroy",function(){svi.eventDispatcher.scopes.splice(pos,1)})}}($rootScope)}]),angular.module("services").service("exchange",["$http",function($http){this.getIndexes=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get("/Web/exchange",config)},this.getMovers=function(exchange,type,pageSize,pageNum,sortField,sortDir,invalidateCache){if(angular.isUndefined(exchange)||""===exchange)return!1;if(angular.isUndefined(type)||""===type)return!1;var params={pageSize:10,pageNum:1};angular.isDefined(pageSize)&&angular.isNumber(pageSize)&&(params.pageSize=pageSize),angular.isDefined(pageNum)&&angular.isNumber(pageNum)&&(params.pageNum=pageNum),angular.isDefined(sortField)&&angular.isString(sortField)&&(params.sortField=sortField),angular.isDefined(sortDir)&&angular.isString(sortDir)&&(params.sortDir=sortDir);var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get("/Web/exchange/"+exchange+"/movers/"+type+"?"+$.param(params),config)},this.getNews=function(pageSize,pageNum,topic,invalidateCache){var params={};angular.isDefined(pageSize)&&angular.isNumber(pageSize)&&(params.pageSize=pageSize),angular.isDefined(pageNum)&&angular.isNumber(pageNum)&&(params.pageNum=pageNum),angular.isDefined(topic)&&(params.topic=topic);var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),angular.equals(params,{})?$http.get("/Web/exchange/news",config):$http.get("/Web/exchange/news?"+$.param(params),config)},this.getNewsStory=function(storyId){return!angular.isUndefined(storyId)&&""!==storyId&&$http.get("/Web/exchange/news/"+storyId)},this.getSectors=function(params,invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),angular.isDefined(params)&&angular.isObject(params)?$http.get("/Web/exchange/sectors?"+$.param(params),config):$http.get("/Web/exchange/sectors",config)},this.filterMoversByTestData=function(quotes){return quotes?quotes.filter(function(quote){if(quote.instrument&&quote.instrument.ric&&!quote.instrument.ric.toLowerCase().includes("test"))return quote}):[]},this.getSectorsIndustries=function(params,invalidateCache){return angular.isDefined(invalidateCache),new Promise(function(resolve){setTimeout(resolve([{name:"S&P 500",week:1e3,month:1200,year:1500,y3:2500,y5:3e3,industries:[{name:"Communication Services",week:1500,month:1200,year:1500,y3:2500,y5:3e3},{name:"Consumer Discretionary",week:1600,month:1200,year:1500,y3:2500,y5:3e3}]},{name:"Health Care",week:1010,month:1200,year:1500,y3:2500,y5:3e3,industries:[{name:"Biotechnology",week:1510,month:1200,year:1500,y3:2500,y5:3e3},{name:"Health Care Equipment & Supplies",week:161,month:120,year:150,y3:250,y5:300}]},{name:"Energy",week:103,month:120,year:150,y3:250,y5:300,industries:[{name:"Uranium",week:153,month:120,year:150,y3:250,y5:300},{name:"Renewable Energy",week:163,month:120,year:150,y3:250,y5:300},{name:"Oil & Gas Related Equipment and Services",week:173,month:120,year:150,y3:250,y5:300},{name:"Coal",week:183,month:120,year:150,y3:250,y5:300}]},{name:"Real Estate",week:1e3,month:1200,year:1500,y3:2500,y5:3e3,industries:[]},{name:"Materials",week:104,month:120,year:150,y3:250,y5:300,industries:[{name:"Chemicals",week:154,month:120,year:150,y3:250,y5:300},{name:"Containers & Packaging",week:164,month:120,year:150,y3:250,y5:300}]}]),300)})}}]),angular.module("services").factory("frequency",function(){return{DAILY:"DAILY",WEEKLY:"WEEKLY",MONTHLY:"MONTHLY",QUARTERLY:"QUARTERLY",YEARLY:"YEARLY"}}),angular.module("services").service("fundInfo",["APP_CONFIG","$timeout","$http","piwik","$filter",function(APP_CONFIG,$timeout,$http,piwik,$filter){this.getInfo=function(symbol,invalidateCache,params){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundInfo";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getTopHoldings=function(symbol,params,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundHoldings";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getSectorAllocation=function(symbol,invalidateCache,params){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundSectorAllocation";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getPerformance=function(symbol,params,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundPerformance";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getFundInfo=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundInfo";return $http.get(url,config)},this.getLipperRating=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundLeaders";return $http.get(url,config)},this.getFundRiskAnalysis=function(symbol,params,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundRiskAnalysis";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getFundGrowth=function(symbol,params,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundGrowth";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getLipperFundESGSummary=function(symbol,invalidateCache,params){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/lipperFundESGSummary";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getEventsTable=function(category,startDate,endDate,sortDir,sortField,pageSize,currentPage,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/eventsTable?category="+category+"&startDate="+startDate+"&endDate="+endDate+"&sortDir="+sortDir+"&sortField="+sortField+"&pageSize="+pageSize+"&pageNum="+currentPage;return $http.get(url,config)},this.getFundAssetAllocation=function(symbol,invalidateCache,params){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundAssetAllocation";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getFundGeographicExposure=function(symbol,invalidateCache,params){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundGeographicExposure";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getFundDistributions=function(symbol,params,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundDistributions";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.getFundLoadSchedule=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundLoadSchedule";return $http.get(url,config)},this.getFundExpenses=function(symbol,params,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/fundExpenses";return angular.isDefined(params)&&angular.isObject(params)?$http.get(url+"?"+$.param(params),config):$http.get(url,config)},this.cleanFundName=function(fundName){return fundName.replace(";"," - ")}}]),angular.module("services").service("highcharts",["APP_CONFIG","$timeout","$http","$log",function(APP_CONFIG,$timeout,$http,$log){var maps={},self=this;self.getChart=function(options,isStockChart,isMap){if(APP_CONFIG.chartColors.general&&Highcharts.setOptions({colors:APP_CONFIG.chartColors.general}),NodeList.prototype.forEach||(NodeList.prototype.forEach=Array.prototype.forEach),options){if(options.hasOwnProperty("exporting")||(options.exporting={}),options.hasOwnProperty("stockTools")||(options.stockTools={gui:{enabled:!1}}),options.exporting.hasOwnProperty("buttons")||(options.exporting.buttons={}),options.exporting.buttons.hasOwnProperty("contextButton")||(options.exporting.buttons.contextButton={}),options.exporting.buttons.contextButton.hasOwnProperty("menuItems")||(options.exporting.buttons.contextButton.menuItems=["downloadCSV","downloadXLS","downloadPNG","downloadSVG","separator","printChart"]),options.hasOwnProperty("chart")||(options.chart={}),options.chart.hasOwnProperty("spacingBottom")||(options.chart.spacingBottom=25),options.hasOwnProperty("navigation")||(options.navigation={}),options.navigation.hasOwnProperty("buttonOptions")||(options.navigation.buttonOptions={align:"right",verticalAlign:"bottom",y:25,x:0}),options.hasOwnProperty("tooltip")||(options.tooltip={}),options.tooltip.hasOwnProperty("split")||(options.tooltip.split=!1),!(options.accessibility&&options.accessibility.keyboardNavigation&&options.accessibility.keyboardNavigation.focusBorder&&options.accessibility.keyboardNavigation.focusBorder.hasOwnProperty("style"))){options.accessibility.keyboardNavigation=angular.merge({},options.accessibility.keyboardNavigation,{focusBorder:{style:{lineWidth:2,color:"#000"}}})}if(options.hasOwnProperty("legend")||(options.legend={}),options.legend.symbolRadius=0,options.hasOwnProperty("plotOptions")&&options.plotOptions.hasOwnProperty("pie")){var pie=options.plotOptions.pie;pie.hasOwnProperty("dataLabels")||(pie.dataLabels={}),pie.dataLabels.hasOwnProperty("style")||(pie.dataLabels.style={}),pie.dataLabels.style.textOutline=!1}}return svi.debug.enabled&&$log.debug("Highchart created",options),$timeout(function(){$("svg.highcharts-root > title").remove()},1e3),isStockChart?new Highcharts.StockChart(options):isMap?new Highcharts.Map(options):new Highcharts.Chart(options)},self.getStockChart=function(options){return self.getChart(options,!0)},self.getMapChart=function(options){return self.getChart(options,!1,!0)},this.replaceSeries=function(chart,seriesData,redraw){var i,l,options=[];for((angular.isUndefined(redraw)||!1!==redraw)&&(redraw=!0),i=0,l=chart.series.length;i<l;i++)options[i]=chart.series[i].options,seriesData.length>i&&!1!==seriesData[i]?options[i].data=seriesData[i]:options[i].data=chart.series[i].data;for(i=chart.series.length;0<=i;--i)chart.series[i]&&chart.series[i].remove(redraw&&i+1==l);for(i=0,l=options.length;i<l;i++)chart.addSeries(options[i],redraw&&i+1==l);return chart},self.setDefaultOptions=function(options){return Highcharts.setOptions(options)},self.loadMap=function(type){if(!type)return!1;if(!maps.hasOwnProperty(type)){var url="/Web/app/assets/maps/highcharts-maps/"+type+".geo.json";maps[type]=$http.get(url).then(function(response){200===response.status&&response.hasOwnProperty("data")&&response.data&&(Highcharts.maps[type]=response.data)})}return maps[type]},self.getRangeSelectorButtonsStyle=function(){return{width:36,r:5,style:{fontSize:"12px"},states:{hover:{style:{color:"#333"}},select:{fill:"#777",style:{color:"#fff"}}}}},self.getSelectedTimespanIndex=function(buttons,timespan){var index=0;return buttons.forEach(function(button,i){button.filter===timespan&&(index=i)}),index},svi.hasOwnProperty("highcharts")||(svi.highcharts=self)}]),angular.module("services").service("historicalValue",["$http",function($http){this.getHistoricalValue=function(account,data,invalidateCache){if(angular.isUndefined(account)||!$.isNumeric(account)&&!angular.isArray(account)&&"all"!=account)return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var base="/Web/account/";angular.isArray(account)?(1<account.length&&(base="/Web/multiAccount/"),account=account.join(",")):"all"==account&&(base="/Web/multiAccount/"),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N";var url=base+account+"/historicalValue?"+$.param(svi.util.sortByKeys(data));return $http.get(url,config)}}]),angular.module("services").service("history",["$http","$window","sviUrl",function($http,$window,sviUrl){this.getHistory=function(account,data,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url=getUrl(account,data);return!1!==url&&$http.get(url,config)},this.exportHistory=function(account,data,newWindow){var url=getUrl(account,data,!0);return angular.isDefined(newWindow)&&newWindow?$window.open(url):sviUrl.href(url),!0};var getUrl=function(account,data,exportData){if(angular.isUndefined(account)||!$.isNumeric(account)&&!angular.isArray(account)&&"all"!=account)return!1;var url,base="/Web/account/";(angular.isArray(account)?(1<account.length&&(base="/Web/multiAccount/"),account=account.join(",")):"all"==account&&(base="/Web/multiAccount/"),url=base+account+"/history",exportData?(url+="/export",void 0!==data&&data&&(data.pageSize=0,data.pageNum=0)):(void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N"),void 0!==data&&data)&&(url=url+"?"+$.param(svi.util.sortByKeys(data)));return url}}]),angular.module("services").service("historyCategories",["$http",function($http){this.getHistoryCategories=function(accounts,startDate,endDate,categoryIds){if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");if(!1===angular.isArray(categoryIds))throw new Error("categories is expected to be an array");if(!startDate)throw new Error("startDate is required");if(!endDate)throw new Error("endDate is required");var data={switchAccounts:"N"};return data.startDate=startDate,data.endDate=endDate,data.categoryIds=categoryIds.join(","),$http.get("/Web/multiAccount/"+accounts.join(",")+"/historyCategories?"+$.param(svi.util.sortByKeys(data)))}}]),angular.module("services").service("holdings",["$http","$window","sviUrl",function($http,$window,sviUrl){this.getHoldings=function(account,data,invalidateCache){if(angular.isUndefined(account)||!$.isNumeric(account)&&!angular.isArray(account)&&"all"!=account)return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var base="/Web/account/";angular.isArray(account)?(1<account.length&&(base="/Web/multiAccount/"),account=account.join(",")):"all"==account&&(base="/Web/multiAccount/"),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N";var url=base+account+"/holdings?"+$.param(svi.util.sortByKeys(data));return $http.get(url,config)},this.exportHoldings=function(account,data,newWindow){if(angular.isUndefined(account)||!$.isNumeric(account)&&!angular.isArray(account)&&"all"!=account)return!1;var url,base="/Web/account/";(angular.isArray(account)?(1<account.length&&(base="/Web/multiAccount/"),account=account.join(",")):"all"==account&&(base="/Web/multiAccount/"),void 0!==data&&data)?(data.pageSize=0,data.pageNum=0,url=base+account+"/holdings/export?"+$.param(svi.util.sortByKeys(data))):url=base+account+"/holdings/export";return angular.isDefined(newWindow)&&newWindow?$window.open(url):sviUrl.href(url),!0},this.filterBySymbol=function(symbol,holdings){var records=[],i=0;if(angular.isArray(symbol))for(i=0;i<holdings.length;i++)php.in_array(holdings[i].instrument.symbol,symbol)&&records.push(holdings[i]);else for(i=0;i<holdings.length;i++){if(!symbol){if("default"==holdings[i].accountType.toLowerCase())continue;symbol=holdings[i].instrument.symbol}holdings[i].instrument.symbol==symbol&&records.push(holdings[i])}return records},this.filterPositions=function(positions,config){if(!angular.isArray(positions))return positions;for(var settings=$.extend({},{excludeUnknownInvestmentType:!0,excludeInvalidQuote:!1,excludeStock:!1,excludeOption:!1,excludeFund:!1,excludeFixedIncome:!1,excludeCash:!1,excludeCusip:!1,excludeOther:!1},config),records=[],i=0,l=positions.length;i<l;i++)!1===excludePosition(positions[i],settings)&&records.push(positions[i]);return records};var excludePosition=function(position,config){if(position.instrument.investmentType){var it=position.instrument.investmentType.toLowerCase();if(config.excludeStock&&"stock"===it)return!0;if(config.excludeOption&&"option"===it)return!0;if(config.excludeFund&&"mutualfund"===it)return!0;if(config.excludeFixedIncome&&"fixedincome"===it)return!0;if(config.excludeCash&&"cash"===it)return!0;if(config.excludeOther&&"other"===it)return!0}else if(config.excludeUnknownInvestmentType)return!0;return!(!config.excludeCusip||position.instrument.cusip!==position.instrument.symbol&&!svi.ng.symbol.isCUSIP(position.instrument.symbol))}}]),angular.module("services").service("iraSummary",["$http",function($http){this.getIraSummary=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/iraSummary?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("labels",["$http","$q","$timeout","$log",function($http,$q,$timeout,$log){var labels=this;if(svi.hasOwnProperty("labels")){var x;for(x in svi.labels)svi.labels.hasOwnProperty(x)&&(labels[x]=svi.labels[x])}else{labels.cache={},labels.promises=[];var defaultOverrideCb=function(sets,labelData){return labelData};labels.setupLabels=function(scope,sets,defaults){return angular.isUndefined(defaults)&&(defaults={}),scope.labels=defaults,angular.isUndefined(scope.labelsRetryCount)&&(scope.labelsRetryCount=0),labels.get(sets).then(function(data){angular.isObject(scope.labels)?scope.labels=php.array_merge(scope.labels,data):scope.labels=data,scope.$applyAsync()},function(reason){$log.warn("Error: "+reason),++scope.labelsRetryCount<3&&labels.setupLabels(scope,sets,defaults)})};var rejectPromisesWithSet=function(set,message){for(var promise,len=labels.promises.length,i=0;i<len;i++)promise=labels.promises.shift(),php.in_array(set,promise.sets)?promise.reject(message):labels.promises.push(promise)},rejectPromisesWithSets=function(sets,message){for(var i=0;i<sets.length;i++)rejectPromisesWithSet(sets[i],message)},resolveCompletedPromises=function(){var i,j,promise,set,setLen,len=labels.promises.length;for(i=0;i<len;i++){for(setLen=(promise=labels.promises.shift()).sets.length,j=0;j<setLen;j++)set=promise.sets.shift(),labels.cache.hasOwnProperty(set)&&!1!==labels.cache[set]?(promise.mergedResponse=php.array_merge(promise.mergedResponse,labels.cache[set]),promise.mergedSets.push(set),promise.notify("merged in set: "+set)):promise.sets.push(set);0===promise.sets.length?(promise.mergedResponse=labels.overrideCb(promise.mergedSets,promise.mergedResponse),promise.resolve(promise.mergedResponse)):labels.promises.push(promise)}};labels.get=function(sets){var defer=$q.defer();defer.sets=[],defer.mergedSets=[],defer.mergedResponse={},labels.promises.push(defer);var set,request={};if(angular.isArray(sets))for(request.sets=[];set=sets.shift();)labels.cache.hasOwnProperty(set)&&!1!==labels.cache[set]?(defer.mergedResponse=php.array_merge(defer.mergedResponse,labels.cache[set]),defer.mergedSets.push(set),defer.notify("merged in set: "+set)):(labels.cache.hasOwnProperty(set)||($log.debug('Labels: making request to get "'+set+'"'),labels.cache[set]=!1,request.sets.push(set)),defer.sets.push(set));return request.hasOwnProperty("sets")&&0<request.sets.length?$timeout(function(){var url="/Web/util/labels?labels="+encodeURIComponent(JSON.stringify(request));$http.get(url).success(function(data,status,headers,config){var response=data.data||data;if(angular.isObject(response)&&!response.error){for(var x in response)response.hasOwnProperty(x)&&"labels"!=x&&(labels.cache[x]=response[x]);resolveCompletedPromises()}else rejectPromisesWithSets(request.sets,"Error retrieving labels.")}).error(function(data,status,headers,config){rejectPromisesWithSets(request.sets,"Error retrieving labels.")}),resolveCompletedPromises()}):resolveCompletedPromises(),defer.promise},labels.getCachedSet=function(setId){return!!labels.cache.hasOwnProperty(setId)&&labels.cache[setId]},labels.setCachedSet=function(setId,setData){return labels.cache[setId]=setData,labels},labels.setOverrideCb=function(callback){return callback?angular.isFunction(callback)&&(labels.overrideCb=callback):labels.overrideCb=defaultOverrideCb,labels},labels.overrideCb=defaultOverrideCb,labels.getScreenText=function(template,identifier){if(!template||!identifier)return!1;var url="/Web/util/screenText/text/"+template+"/"+identifier;return $http.get(url)},labels.loadScreenText=function($scope,field,template,identifier){return!!(angular.isObject($scope)&&field&&template&&identifier)&&($scope[field]="",labels.getScreenText(template,identifier).then(function(response){angular.isObject(response.data)&&response.data.success&&response.data.hasOwnProperty("screenText")&&($scope[field]=response.data.screenText,$scope.$applyAsync())}))},svi.labels=labels}}]),angular.module("services").service("loader",["APP_CONFIG","$timeout","$http","piwik",function(APP_CONFIG,$timeout,$http,piwik){this.attach=function($scope,$element,loadCallback,onSuccess,onError,load){if(!angular.isObject($scope)||!$scope.hasOwnProperty("api")||!angular.isObject($scope.api))throw"$scope object must be defined and have $scope.api = this";if(!angular.isObject($element))throw"$element is required";if(!angular.isFunction(loadCallback))throw"loadCallback function must be defined";angular.isFunction(onSuccess)||(onSuccess=function(data){piwik.trackDataLoad($scope,data),$scope.data=data}),angular.isFunction(onError)||(onError=function(reason){var name=$scope.api.name||"unknown",friendlyName=$scope.api.friendlyName||name;piwik.trackPage(name+"/error","Error: "+friendlyName,!1)}),$scope.api.hasOwnProperty("setLoader")&&angular.isFunction($scope.api.setLoader)||($scope.api.setLoader=function(loader){$scope.loader=loader}),$scope.api.hasOwnProperty("getLoader")&&angular.isFunction($scope.api.getLoader)||($scope.api.getLoader=svi.ng.getLoaderFactory($element,$scope)),angular.isFunction(load)?$scope.api.load=load:$scope.api.hasOwnProperty("load")&&angular.isFunction($scope.api.load)||($scope.api.load=function(invalidateCache){if(angular.isFunction($scope.api.isReadyToLoad)&&!$scope.api.isReadyToLoad())return!1;angular.isUndefined(invalidateCache)&&(invalidateCache=!1);var loader=$scope.api.getLoader();loader?loader.setLoadHandler(loadCallback).load(invalidateCache).then(onSuccess,onError):$timeout($scope.api.load,APP_CONFIG.autoLoadDelay)})},this.getDummyData=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get("/Web/util/util/test",config)},this.getDummyChartData=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get("/Web/util/util/testChart",config)}}]),angular.module("services").service("sviMorningstar",["$http","$q","$log","$timeout","cache","APP_CONFIG",function($http,$q,$log,$timeout,cache,APP_CONFIG){var registerPromise=!1,authData=null,defers={},components={},container=null,registrationDone=!1,self=this;this.DJIA="30.10.!DJI",this.getAuth=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get("/Web/morningstar/auth",config)},this.symbol=function(symbol,type,exchange){if(angular.isUndefined(symbol)||!angular.isString(symbol)||""===symbol)return"";symbol=symbol.replace(" ",".").replace("'",".").replace("/",".");var data=cache.get("morningstarSymbol-"+symbol);return null!==data?data.morningstarSymbol:(!angular.isUndefined(type)&&type||(type=5==symbol.length&&"X"==symbol.charAt(4)?"MutualFund":"Stock"),angular.isUndefined(exchange)&&(exchange=126),exchange+"."+self.securityTypeToMorningstar(type)+"."+symbol)},this.getSymbolData=function(symbol){var defer=$q.defer();if(angular.isUndefined(symbol)||!angular.isString(symbol)||""===symbol)return defer.reject("Invalid Symbol"),defer.promise;symbol=symbol.replace(/[^a-z0-9]/gi,".");var data=cache.get("morningstarSymbol-"+symbol);return null!==data?defer.resolve(data):$http.get("/Web/morningstar/symbol/"+symbol).then(function(response){response.data.success?(cache.set("morningstarSymbol-"+symbol,response.data,864e5),defer.resolve(response.data)):defer.reject(response)},function(response){defer.reject(response)}),defer.promise},this.securityTypeToMorningstar=function(type){switch(type){case"Stock":return 1;case"Future":return 3;case"Option":return 2;case"CorporateBond":return 7;case"MutualFund":return 8;case"GovernmentBond":return 9;case"MunicipalBond":return 11;case"MoneyMarketFund":return 19;case"Bond":return 16;case"Warrant":return 18;default:return 0}},this.securityTypeFromMorningstar=function(type){switch(type){case 1:return"Stock";case 3:return"Future";case 2:case 4:return"Option";case 5:case 10:case 13:case 14:case 20:return"Other";case 7:return"CorporateBond";case 8:case 17:return"MutualFund";case 9:return"GovernmentBond";case 11:return"MunicipalBond";case 15:case 19:return"MoneyMarketFund";case 16:return"Bond";case 18:return"Warrant";default:case 0:return"Unknown"}};var internalRegister=function(){registrationDone||(null===authData?$timeout(internalRegister,200):(registrationDone=!0,defers.morningstar.promise.then(function(){window.appConfig={settings:{languageId:"en-US",showPremium:"true"},components:components,labels:{}},window.hasOwnProperty("mstarConfigs")&&angular.forEach(components,function(v,k){window.mstarConfigs.hasOwnProperty(APP_CONFIG.client)&&window.mstarConfigs[APP_CONFIG.client].hasOwnProperty(k)?window.appConfig=$.extend(!0,{},window.mstarConfigs[APP_CONFIG.client][k],window.appConfig):window.mstarConfigs.hasOwnProperty(k)&&(window.appConfig=$.extend(!0,{},window.mstarConfigs[k],window.appConfig))});var mStarConfig={instid:authData.instid,appConfig:window.appConfig,apiTokens:{marketsApiToken:authData.morningstar,accessToken:authData.salToken,realTimeToken:"eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ.QSuSwXpec_6yaBo_uA2EE0TeJQihLL6ePLVuYzA-sol_zG4RDYtOA2oOOVGpuZD3enV5RMDtCZsAHcPaat7q-G9mx24y9zFk4fsVjmdIz5Sde6Ki37CBVRVQ60XqxchpEljDTu8DvtEsJOcKrGiaStbpdgQJjIwCni2yqiuxX1M.VzXivlEn2GpDFfN-.r95AjRb-fyXRAjEDmxZwxkVoS0HwIxR2KPSsCE0OK3LUk5Jr37PmpdDhQJ3RkIWurVMLhTcOvSwJYHpJb9NsnndqUfky3hGhqDWQhceOGN79Va5odxIU9cRCqeaZVDEtpcldnU2-BV4OTHoh32TW0P3AW7ycEgFZRp-H9GsTdqZMGUyN3KhqXVkDTvAymBuWibwnVykjMiDBpbJs2eBLLsubR1suHmK6VZUPuRw.oQEwMvcsyuNtCHaXotIzzA"},angularOptions:{bootstrap:!1},environment:authData.environment};$log.debug(JSON.stringify(appConfig)),$log.debug(JSON.stringify(mStarConfig)),morningstar.loader.load(mStarConfig,function(appConfig){defers.registration.resolve(appConfig)})})))},debouncedRegister=$.debounce(1e3,internalRegister);this.register=function(componentName,componentConfig){if(!registerPromise){var headTag,scriptTag;!window.hasOwnProperty("angular")&&svi.hasOwnProperty("angular")&&(window.angular=svi.angular),defers.jQuery=$q.defer(),void 0===window.jQuery||-1==window.jQuery.fn.jquery.search(/^2\.1\./)?angular.isDefined(jQuery)&&-1!=jQuery.fn.jquery.search(/^2\.1\./)?(window.jQuery=jQuery,window.$=$,defers.jQuery.resolve(window.jQuery.fn.jquery)):(headTag=document.getElementsByTagName("head")[0],(scriptTag=document.createElement("script")).type="text/javascript",scriptTag.src=svi.url.addHost("/Web/JS/jquery/jquery-2.1.4.min.js"),scriptTag.onload=function(){defers.jQuery.resolve(window.jQuery.fn.jquery)},headTag.appendChild(scriptTag)):defers.jQuery.resolve(window.jQuery.fn.jquery),defers.handlebars=$q.defer(),void 0===window.Handlebars||-1==window.Handlebars.VERSION.search(/^4\.0\./)?(headTag=document.getElementsByTagName("head")[0],(scriptTag=document.createElement("script")).type="text/javascript",scriptTag.src=svi.url.addHost("/Web/JS/handlebars.min.js"),scriptTag.onload=function(){defers.handlebars.resolve(window.Handlebars.VERSION)},headTag.appendChild(scriptTag)):defers.handlebars.resolve(window.Handlebars.VERSION),defers.mstarConfigs=$q.defer(),window.hasOwnProperty("mstarConfigs")?defers.mstarConfigs.resolve(window.mstarConfigs):(headTag=document.getElementsByTagName("head")[0],(scriptTag=document.createElement("script")).type="text/javascript",scriptTag.src=svi.url.addHost("/Web/app/src/mstar_deps.min.js?v="+encodeURIComponent(svi.versionNumber)),scriptTag.onload=function(){defers.mstarConfigs.resolve(window.mstarConfigs)},headTag.appendChild(scriptTag)),defers.container=$q.defer(),0<(container=$("#svi-morningstar-container")).length||(container=$('<div id="svi-morningstar-container" class="svi-bs"></div>').appendTo("body")),defers.container.resolve(container),defers.morningstar=$q.defer(),defers.auth=$q.defer(),this.getAuth().success(function(data,status,headers,config){var response=data.data||data;data.hasOwnProperty("success")&&!1===data.success?($log.warn({message:"Morningstar Auth: success parameter is false",status:status,data:data,headers:headers,config:config}),defers.auth.reject({message:"Morningstar Authentication Failed",status:status,data:data})):($log.debug({message:"Morningstar Auth: successful",status:status,headers:headers,config:config}),authData=response,defers.auth.resolve(authData),void 0!==window.morningstar&&angular.isObject(window.morningstar)&&window.morningstar.hasOwnProperty("loader")?defers.morningstar.resolve("morningstar"):(headTag=document.getElementsByTagName("head")[0],(scriptTag=document.createElement("script")).type="text/javascript",scriptTag.src=authData.loaderUri,scriptTag.onload=function(){defers.morningstar.resolve("morningstar")},headTag.appendChild(scriptTag)))}).error(function(data,status,headers,config){404==status?$log.error({message:"Morningstar Auth: 404 error returned",status:status,data:data,headers:headers,config:config}):$log.error({message:"Morningstar Auth: Error retrieving data",status:status,data:data,headers:headers,config:config}),defers.auth.reject({status:status,data:data})}),defers.registration=$q.defer();var promises={};angular.forEach(defers,function(val,key){promises[key]=val.promise}),registerPromise=$q.all(promises)}return components[componentName]=componentConfig,debouncedRegister(),registerPromise}}]),angular.module("services").service("myFinancialAdvisor",["$http",function($http){this.getAdvisorInfo=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/myFinancialAdvisor?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("nameAddress",["$http",function($http){this.getNameAddress=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/nameAddress?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("navigation",["$http","$location",function($http,$location){this.getConfig=function(accountIndex,data){var url="/Web/util/navigation/";angular.isDefined(accountIndex)&&!1!==accountIndex&&(url+=accountIndex);var currentLocation=$location.absUrl().split("#")[0];return void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",data.currentLocation=currentLocation,url+="?"+$.param(svi.util.sortByKeys(data)),$http.get(url)},this.getLaminasUrl=function(params,accountIndex,data){var url="/Web/util/navigation/laminasUrl/";return angular.isDefined(accountIndex)&&(url+=accountIndex),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",data.params=params,url+="?"+$.param(svi.util.sortByKeys(data)),$http.get(url)}}]),angular.module("services").service("orders",["$http",function($http){this.getAccountOrders=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/orders?"+$.param(svi.util.sortByKeys(data)),config)},this.filterBySymbol=function(symbol,orders){var records=[],i=0;if(angular.isArray(symbol))for(i=0;i<orders.length;i++)php.in_array(orders[i].order.instrument.symbol,symbol)&&records.push(orders[i]);else for(i=0;i<orders.length;i++)orders[i].order.instrument.symbol===symbol&&records.push(orders[i]);return records},this.urlBase="/Web/trading/orders",this.get=function(id){return id||(id=""),$http.get(this.urlBase+"/"+id)},this.create=function(data){return!!data&&$http.post(this.urlBase+"/",data)},this.edit=function(id,data){return!(!id||!data)&&$http.put(this.urlBase+"/"+id,data)},this.cancel=function(id,params){if(!id)return!1;var url=this.urlBase+"/"+id;return params&&(url+="?"+$.param(params)),$http.delete(url)}}]),angular.module("services").service("overview",["$http",function($http){this.getOverview=function(accountList,data,invalidateCache){if(angular.isUndefined(accountList)||""===accountList||!1===accountList)return!1;angular.isArray(accountList)&&(accountList=accountList.join(","));var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/multiAccount/"+accountList+"/overview?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("paLoans",["$http",function($http){this.getPaLoans=function(account,data,invalidateCache){if(angular.isArray(account)&&1==account.length&&(account=account[0]),angular.isUndefined(account)||!$.isNumeric(account))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/paLoan?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("paLoanSummary",["$http",function($http){this.getPaLoanSummary=function(accounts,data,invalidateCache){if(angular.isUndefined(accounts))return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/multiAccount/"+accounts+"/paLoanSummary?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("performance",["$http","queryTypes","dateRange",function($http,queryTypes,dateRange){var base="/Web/multiAccount/",createConfig=function(parameters,invalidateCache){var config={};return angular.isDefined(parameters)&&(config.params=parameters),angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),config};this.getPerformanceSummary=function(accounts,customRange,queryType,assets,includeCash,excludeFees,annualize,invalidateCache){if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");if(angular.isUndefined(accounts))throw new Error("accounts parameter is required");var params={queryType:queryType,includeCash:includeCash?"true":"false",excludeFees:excludeFees?"true":"false",annualize:annualize?"true":"false",switchAccounts:"N"};assets&&(params.assets=assets.map(function(a){return a.symbol}).join(",")),customRange&&(params.startDate=customRange.fromDate,params.endDate=customRange.toDate);var url=base+accounts.join(",")+"/performance/performanceSummary";return $http.get(url,createConfig(params,invalidateCache))},this.getHistoricalSummary=function(accounts,range,queryType,benchmark,afterTax,includeCash,includeMargin,assets,excludeFees,annualize,invalidateCache){if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");if(!range)throw new Error("Range parameter is required");var params={frequency:range.frequency,queryType:queryType,afterTax:afterTax?"true":"false",benchmark:function(benchmark){return angular.isString(benchmark)?benchmark:angular.isObject(benchmark)&&benchmark.hasOwnProperty("code")&&"NB"!==benchmark.code?benchmark.code:null}(benchmark),includeCash:includeCash?"true":"false",includeMargin:includeMargin?"true":"false",excludeFees:excludeFees?"true":"false",annualize:annualize?"true":"false",switchAccounts:"N"};!function(range){for(var i=1;i<arguments.length;i++){var parameters=arguments[i];parameters.period=range.periodName,dateRange.isCustom(range)&&(parameters.fromDate=range.fromDate,parameters.toDate=range.toDate)}}(range,params),assets&&(params.assets=assets.map(function(a){return a.symbol}).join(","));var url=base+accounts.join(",")+"/performance/historicalSummary";return $http.get(url,createConfig(params,invalidateCache))},this.getPeriodReport=function(accounts,range,invalidateCache){return this.getHistoricalSummary(accounts,range,queryTypes.NAV,null,null,null,null,null,null,invalidateCache)}}]),angular.module("services").service("permissions",["$http","$timeout","$q","cache",function($http,$timeout,$q,cache){this.urlBase="/Web/util/permissions",this.get=function(set,invalidateCache){if(!set)return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url=this.urlBase,params={};params.set=set,url+="?"+$.param(params);var value=null;if(invalidateCache?cache.remove(url):value=cache.get(url),null===value)return $http.get(url,config).then(function(response){return 200==response.status&&response.data.success&&cache.set(url,response,36e5),response});var deferred=$q.defer();return $timeout(function(){deferred.resolve(value)}),deferred.promise},this.getProductType=function(type,invalidateCache){if(!type)return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url=this.urlBase+"/productType/"+encodeURIComponent(type),params={};params.version=svi.versionNumber,url+="?"+$.param(params);var value=null;if(invalidateCache?cache.remove(url):value=cache.get(url),null===value)return $http.get(url,config).then(function(response){return 200==response.status&&response.data.success&&cache.set(url,response,36e5),response});var deferred=$q.defer();return $timeout(function(){deferred.resolve(value)}),deferred.promise}}]),angular.module("services").factory("pieDataParser",["sqopeHoldingSorter","$filter","Colors","ColorMapper","collections",function(sqopeHoldingSorter,$filter,Colors,ColorMapper,collections){function format(valueFunction,value){return"<small>"+value.key+'</small>: <span style="color: '+value.point.color+'">'+valueFunction(value)+"</span>"}var filterPositions=function(positions){return positions.filter(function(p){return 0<p.marketValue})};function createToolTip(valueFunction){return{formatter:function(){var tooltip="";if(Array.isArray(this.point.x)){var items=this.point.x,tooMany=4<items.length,i=0;items.forEach(function(value){3===i&&tooMany?tooltip+="Plus "+(items.length-4)+" more":i<4&&(tooltip+=format(valueFunction,value)+"<br/>"),i++})}else tooltip=format(valueFunction,this);return tooltip}}}function createErrorChart(pieData){pieData.text="N/A",pieData.data=collections.map(Colors.chartErrorColors,function(color){return{name:"",y:1,x:1,color:color}}),pieData.settings={tooltip:{formatter:function(){return"N/A"}}}}var reduceSlices=function(pieData){var otherSlice,minimumMarketValue=.01*collections.reduce(pieData,function(sum,slice){return sum+slice.y},0);pieData=collections.sortBy(pieData,"y");var splitPoint=collections.findLastIndex(pieData,function(slice){return slice.y<minimumMarketValue});if(2<splitPoint){otherSlice={name:"Other",y:0,color:Colors.otherChartColor,x:[]};for(var i=0;i<=splitPoint;i++){var slice=pieData[i];otherSlice.x.push({key:slice.name,point:{y:slice.y,x:slice.x,color:slice.color}}),otherSlice.y+=slice.y}}var newPieData=pieData.slice(splitPoint+1);return otherSlice&&newPieData.push(otherSlice),newPieData},parser={parseType:function(positions){var pieData={name:"Asset Class"};return(positions=sqopeHoldingSorter.sortByTypeAndSector(filterPositions(positions))).length?(pieData.data=collections.map(collections.groupBy(positions,"type"),function(group,type){return{name:type,y:collections.reduce(group,function(sum,asset){return sum+asset.marketValue},0),color:ColorMapper.mapType(type)}}),pieData.data=reduceSlices(pieData.data),pieData.text=$filter("sviCurrency")(collections.reduce(positions,function(sum,asset){return sum+asset.marketValue},0)),pieData.settings={tooltip:createToolTip(function(formatter){return $filter("sviCurrency")(formatter.point.y)})}):createErrorChart(pieData),pieData},parseSector:function(positions,sectorColorMapper){var pieData={name:"Asset Sector"};return(positions=filterPositions(positions)).length?(positions=sqopeHoldingSorter.sortByTypeAndSector(positions),pieData.data=collections.map(collections.groupBy(positions,"sector"),function(group,sector){return{name:sector,y:collections.reduce(group,function(sum,asset){return sum+asset.marketValue},0),color:sectorColorMapper(sector)}}),pieData.data=reduceSlices(pieData.data),pieData.text=$filter("sviCurrency")(collections.reduce(positions,function(sum,asset){return sum+asset.marketValue},0)),pieData.settings={tooltip:createToolTip(function(formatter){return $filter("sviCurrency")(formatter.point.y)})}):createErrorChart(pieData),pieData},parseRisk:function(positions,riskRange,aggregateRisk){var pieData={name:"Risk"};return(positions=filterPositions(positions)).length?(positions=sqopeHoldingSorter.sortByRisk(positions),pieData.data=positions.map(function(asset){var riskDescription;return riskDescription=asset.riskValue&&asset.riskLevel?asset.riskLevel+" ("+asset.riskValue+")":"N/A",{name:asset.symbol,y:asset.marketValue,x:riskDescription,desc:asset.desc,color:ColorMapper.mapRisk(asset.riskValue,riskRange)}}),pieData.data=reduceSlices(pieData.data),angular.isUndefined(aggregateRisk)?1===positions.length?pieData.text=$filter("riskValue")(positions[0].riskValue,riskRange.riskMeasure):pieData.text="N/A":pieData.text=$filter("riskValue")(aggregateRisk,riskRange.riskMeasure),pieData.settings={tooltip:createToolTip(function(formatter){return formatter.point.x})}):createErrorChart(pieData),pieData},parsePerformance:function(positions){var pieData={name:"Performance"};return(positions=filterPositions(positions)).length?(positions=sqopeHoldingSorter.sortByPerformance(positions),pieData.data=positions.map(function(asset){return{name:asset.symbol,y:asset.marketValue,x:angular.isUndefined(asset.performance)||!isFinite(asset.performance)?"N/A":asset.performance,color:ColorMapper.mapPerformance(asset.performance)}}),pieData.data=reduceSlices(pieData.data),pieData.settings={tooltip:createToolTip(function(formatter){return $filter("percent")(100*formatter.point.x)})}):createErrorChart(pieData),pieData}};return parser}]),angular.module("services").service("portfolioValue",["$http",function($http){this.getPortfolioValue=function(accounts,startDate,endDate,combineChartData,categoryIds,svc){var _svc=svc||"chart";if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");if(!1===angular.isArray(categoryIds))throw new Error("categories is expected to be an array");var data={switchAccounts:"N"};return data.startDate=startDate,endDate&&(data.endDate=endDate),data.combineChartData=combineChartData,data.categoryIds=categoryIds.join(","),$http.get("/Web/multiAccount/"+accounts.join(",")+"/portfolioSummary/performance/"+_svc+"?"+$.param(svi.util.sortByKeys(data)))},this.getPorfolioValueData=function(accounts,startDate,endDate){return this.getPortfolioValue(accounts,startDate,endDate,!1,[],"data")}}]),angular.module("services").service("preferences",["$http","$timeout","$q","cache",function($http,$timeout,$q,cache){var self=this;self.urlBase="/Web/user/preferences",self.get=function(keys,invalidateCache){if(!keys||!angular.isArray(keys))return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url=self.urlBase,params={};params.keys=keys,url+="?"+$.param(params);var value=null;if(invalidateCache?cache.remove(url):value=cache.get(url),null===value)return $http.get(url,config).then(function(response){return 200==response.status&&response.data.success&&cache.set(url,response,36e5),response});var deferred=$q.defer();return $timeout(function(){deferred.resolve(value)}),deferred.promise},self.set=function(keys,value){if(!keys||!angular.isArray(keys)||angular.isUndefined(value))return!1;var url=self.urlBase,params={};return params.keys=keys,url+="?"+$.param(params),cache.remove(url),$http.put(url,JSON.stringify(value))},self.remove=function(keys){if(!keys||!angular.isArray(keys))return!1;var url=self.urlBase,params={};return params.keys=keys,url+="?"+$.param(params),cache.remove(url),$http.delete(url)},self.changePassword=function(data){return!(!data||!angular.isObject(data))&&$http.post(self.urlBase+"/changePassword",data)},self.changeTxnPassword=function(data){return!(!data||!angular.isObject(data))&&$http.post(self.urlBase+"/changeTxnPassword",data)},self.changeEmail=function(data){return!(!data||!angular.isObject(data))&&$http.post(self.urlBase+"/changeEmail",data)},self.skip=function(){return $http.get(self.urlBase+"/skip",{invalidateCache:!0})},svi.hasOwnProperty("preferences")||(svi.preferences=self)}]),angular.module("services").service("projectedIncome",["$http",function($http){this.getProjectedIncome=function(account,data,invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),angular.isArray(account)&&1==account.length&&(account=account[0]),!(angular.isUndefined(account)||!$.isNumeric(account))&&(void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/account/"+account+"/projectedIncome?"+$.param(svi.util.sortByKeys(data)),config))}}]),angular.module("services").constant("queryTypes",{PERIOD:"PERIOD",CUMULATIVE:"CUMULATIVE",NAV:"NAV"}),angular.module("services").service("risk",["$http","$q","collections",function($http,$q,collections){this.getAggregateRisk=function(riskMeasure,sqopeHoldings,invalidateCache){var promise,openHoldings=collections.sortBy(sqopeHoldings.filter(function(p){return 0!==p.quantity}),"securityId");if(openHoldings.length){var securityIDs=collections.map(openHoldings,"securityId"),params={riskMeasure:riskMeasure,quantities:collections.map(openHoldings,"quantity").join(",")},url="/Web/aggregaterisk/"+securityIDs.join(",");promise=$http.get(url,{params:params,invalidateCache:invalidateCache})}else{var deferred=$q.defer();promise=deferred.promise,deferred.resolve({aggregateRisk:0})}return promise}}]),angular.module("services").service("screenText",["$http","$rootScope","$templateCache","$compile","$timeout",function($http,$rootScope,$templateCache,$compile,$timeout){var modals={};this.getText=function(template,identifier){return!(!angular.isString(template)||!angular.isString(identifier))&&$http.get("/Web/util/screenText/text/"+template+"/"+identifier)},this.displayModal=function(template,identifier,refId,title){if(modals.hasOwnProperty(template+identifier))modals[template+identifier].showModal();else{var $scope=$rootScope.$new();$scope.template=template,$scope.identifier=identifier,$scope.title=title||"Disclosures",$scope.id=php.uniqid("screenText"),$scope.refId=refId||$scope.id;var $element=$compile($templateCache.get("screenText/screenTextModal.tpl.html"))($scope);$(".modals-section").append($element),$element.scope().$applyAsync(),$timeout(function(){var scope=$element.find(".svi-modal").scope();scope&&scope.hasOwnProperty("api")&&(modals[template+identifier]=scope.api,scope.api.showModal())},100)}}}]),angular.module("services").service("session",["$http","APP_CONFIG","accountList","switchAccount","config","sviUrl","eventDispatcher","$cacheFactory",function($http,APP_CONFIG,accountList,switchAccount,config,sviUrl,eventDispatcher,$cacheFactory){var self=this;if(svi.hasOwnProperty("session")){var x;for(x in svi.session)svi.session.hasOwnProperty(x)&&(self[x]=svi.session[x])}else{self.urlBase="/Web/auth/session",self.logoutRedirect=!0;var updateLogger=function(){svi.log4jsAjaxAppender.getHeaders().length=0,svi.log4jsAjaxAppender.addHeader("Accept","application/json"),svi.log4jsAjaxAppender.addHeader("X-CSRFToken",APP_CONFIG.csrfToken),APP_CONFIG.sessionId&&svi.log4jsAjaxAppender.addHeader("X-SVISessionId",APP_CONFIG.sessionId),svi.log4jsLayout.setCustomField("pageId",APP_CONFIG.pageId)},updateAccounts=function(accountList,index,indexList){$cacheFactory.get("$http").removeAll(),APP_CONFIG.accountList=accountList,switchAccount.multi(indexList),switchAccount.single(index),eventDispatcher.trigger("SESSION.ACCOUNT_LIST.CHANGED",accountList)},onUpdate=function(response){if(response&&200==response.status){var sessionId=!!response.data.hasOwnProperty("sessionId")&&response.data.sessionId,sviUserId=!!response.data.hasOwnProperty("sviUserId")&&response.data.sviUserId,accounts=response.data.hasOwnProperty("accountList")?response.data.accountList.split("|"):[],nicknames=response.data.hasOwnProperty("nicknameList")?response.data.nicknameList.split("|"):[],list=[],numAccts=accounts.length,shouldUpdateLogger=!1;if(!1!==sessionId&&APP_CONFIG.sessionId!=sessionId&&(APP_CONFIG.sessionId=sessionId,shouldUpdateLogger=!0),!1!==sviUserId&&APP_CONFIG.sviUserId!=sviUserId&&(APP_CONFIG.sviUserId=sviUserId,APP_CONFIG.pageId=php.uniqid(window.location.pathname),shouldUpdateLogger=!0),shouldUpdateLogger&&updateLogger(),0<numAccts){if(nicknames.length==numAccts)for(var i=0;i<numAccts;i++)0<nicknames[i].length?list.push(accounts[i]+accountList.getNicknameSeparator()+nicknames[i]):list.push(accounts[i]);else list=accounts;if(JSON.stringify(APP_CONFIG.accountList)!=JSON.stringify(list)){var index=response.data.hasOwnProperty("currentAccount")?response.data.currentAccount:0,indexList=response.data.hasOwnProperty("currentAccountList")&&angular.isString(response.data.currentAccountList)?JSON.parse(response.data.currentAccountList):[];updateAccounts(list,index,indexList)}}}};self.getAll=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(self.urlBase,config)},self.get=function(key,invalidateCache){if(!key)return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(self.urlBase+"/"+key,config)},self.set=function(key,value){if(!key||angular.isUndefined(value))return!1;var promise=$http.put(self.urlBase+"/"+key,angular.toJson(value));return promise.then(onUpdate),promise},self.setAll=function(data){if(!data||angular.isUndefined(data))return!1;var promise=$http.put(self.urlBase+"/",data);return promise.then(onUpdate),promise},self.remove=function(key){return!!key&&$http.delete(self.urlBase+"/"+key)},self.getTimeRemaining=function(keepalive){var params="";return angular.isDefined(keepalive)&&keepalive&&(params="?keepalive=Y"),$http.get(self.urlBase+"/timeRemaining"+params,{invalidateCache:!0})},self.extend=function(){var url,params,promise=self.getTimeRemaining(!0),thirdPartyKeepAlives=$("img.thirdPartyKeepAlive");thirdPartyKeepAlives.length&&thirdPartyKeepAlives.each(function(i,el){url=php.parse_url(el.src),params={},url.hasOwnProperty("query")&&php.parse_str(url.query,params),params._cachePrevent=php.uniqid("",!0),el.src=url.scheme+"://"+url.host+url.path+"?"+$.param(params)});return promise},self.handleSessionExpired=function(redirect){eventDispatcher.trigger("SESSION_REMINDER.STOP"),eventDispatcher.trigger("SESSION.ENDED",{reason:"expired"}),sessionStorage.clear(),self.logoutRedirect&&(redirect?null!=redirect.match(/https?:\/\//)?sviUrl.href(redirect):sviUrl.href(svi.url.getHost()+redirect):svi.hasOwnProperty("redirects")&&svi.redirects.sessionExpired?null!=svi.redirects.sessionExpired.match(/https?:\/\//)?sviUrl.href(svi.redirects.sessionExpired):sviUrl.href(svi.url.getHost()+svi.redirects.sessionExpired):config.getLegacyConfig(["MODULES","LOGOUT_EXPAND"]).then(function(response){response.data.success&&sviUrl.href(svi.url.getHost()+response.data.config)}))},self.logout=function(redirect){if(eventDispatcher.trigger("SESSION_REMINDER.STOP"),sessionStorage.clear(),self.logoutRedirect)eventDispatcher.trigger("SESSION.ENDED",{reason:"logout"}),redirect?null!=redirect.match(/https?:\/\//)?sviUrl.href(redirect):sviUrl.href(svi.url.getHost()+redirect):svi.hasOwnProperty("redirects")&&svi.redirects.manualLogout?null!=svi.redirects.manualLogout.match(/https?:\/\//)?sviUrl.href(svi.redirects.manualLogout):sviUrl.href(svi.url.getHost()+svi.redirects.manualLogout):config.getLegacyConfig(["MODULES","LOGOUT_EXPAND"]).then(function(response){response.data.success&&sviUrl.href(svi.url.getHost()+response.data.config)});else{var url=svi.url.getHost()+"/Modules/Login/logout.php";$http.get(url,{invalidateCache:!0}).then(function(){eventDispatcher.trigger("SESSION.ENDED",{reason:"logout"})})}},self.setLogoutRedirect=function(logoutRedirect){self.logoutRedirect=logoutRedirect},self.login=function(ssoToken){eventDispatcher.trigger("SESSION_REMINDER.STOP");var name,match,sessionId=(name="sviInvToken70",(match=document.cookie.match(new RegExp("(^| )"+name+"=([^;]+)")))?match[2]:null);sessionId&&(APP_CONFIG.sessionId=sessionId);var url="/Web/auth/syndicate/appConfig";return ssoToken&&(url+="?ssoToken="+ssoToken+"&forceSSO=Y"),$http.get(url,{invalidateCache:!0}).then(function(response){if(200==response.status&&response.data.success){var x,appConfig=response.data.appConfig,sviConfig=response.data.svi;for(x in appConfig)appConfig.hasOwnProperty(x)&&(APP_CONFIG[x]=appConfig[x]);for(x in APP_CONFIG.pageId=php.uniqid(window.location.pathname),sviConfig)sviConfig.hasOwnProperty(x)&&(svi[x]=sviConfig[x]);return eventDispatcher.trigger("SESSION_REMINDER.START"),updateLogger(),updateAccounts(appConfig.accountList,accountList.getCurrentAccountIndex(),appConfig.currentAccountList),eventDispatcher.trigger("SESSION.STARTED"),!0}return!1})},self.reloadAppConfig=self.login,self.switchUser=function(loginId,invalidateCache){if(!loginId)return!1;var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var promise=$http.get(self.urlBase+"/switchUser/"+loginId,config);return promise.then(onUpdate),promise},eventDispatcher.on("SESSION.EXPIRED",function(e,data){self.handleSessionExpired(data.redirect)},!1),svi.session=self}}]),angular.module("services").service("siteMessages",["$http",function($http){this.urlBase="/Web/util/siteMessages/",this.getMessages=function(section){return!!section&&$http.get(this.urlBase+"messages/"+section)},this.getMarketingMessages=function(section,productType){if(!section)return!1;var url=this.urlBase+"marketingMessages/TMM:"+section;return productType&&(url+="/"+productType),$http.get(url)}}]),angular.module("services").service("sqopeHoldings",["$http","dateRange",function($http,dateRange){this.getSqopeHoldings=function(accounts,range,riskMeasure,asof,securityID,benchmark,invalidateCache){if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");if(!range)throw new Error("Range parameter is required");var params={riskMeasure:riskMeasure,asOf:asof,benchmark:function(benchmark){return angular.isObject(benchmark)&&benchmark.hasOwnProperty("code")&&"NB"!==benchmark.code?benchmark.code:null}(benchmark),securityID:securityID,switchAccounts:"N"};params.period=range.periodName,dateRange.isCustom(range)&&(params.startDate=range.fromDate,params.endDate=range.toDate);var url="/Web/multiAccount/"+accounts.join(",")+"/sqopeholdings";return $http.get(url,{params:params,invalidateCache:invalidateCache})}}]),angular.module("services").factory("sqopeHoldingSorter",["collections",function(collections){var sorter={};return sorter.sortByTypeAndSector=function(sqopeHoldings){return collections.orderBy(sqopeHoldings,["type","sector","risk","performance"],["asc","asc","asc","desc"])},sorter.sortByRisk=function(positions){return 12<positions.length?collections.sortBy(positions,"riskValue"):sorter.sortByTypeAndSector(positions)},sorter.sortByPerformance=function(sqopeHoldings){return 12<sqopeHoldings.length?collections.sortBy(sqopeHoldings,function(p){return-p.performance}):sorter.sortByTypeAndSector(sqopeHoldings)},sorter}]),angular.module("services").service("state",["APP_CONFIG","$window","$location","sviUrl","$timeout","$cookies",function(APP_CONFIG,$window,$location,sviUrl,$timeout,$cookies){var useStorage=!0,prefix="svi-",self=this;self.setPrefix=function(newPrefix){return prefix=newPrefix,self},self.getPrefix=function(){return prefix},self.get=function(id,defaultVal){var state=null;if(useStorage)if(angular.isDefined(id))(state=$window.localStorage.getItem(prefix+id))&&(state=JSON.parse(state));else{state={};for(var key,len=$window.localStorage.length,i=0;i<len;i++)0===(key=$window.localStorage.key(i)).indexOf(prefix)&&(state[key.replace(prefix,"")]=JSON.parse($window.localStorage.getItem(key)))}else if(state=$location.search(),angular.isDefined(id))if(state.hasOwnProperty(id)){state=state[id];try{state=JSON.parse(state)}catch(e){}}else state=null;return null===state&&angular.isDefined(defaultVal)?defaultVal:state},self.set=function(id,value,persist){if(!id)return!1;if(angular.isUndefined(value)||null===value)return self.remove(id);if(useStorage){if($window.localStorage.setItem(prefix+id,JSON.stringify(value)),angular.isDefined(persist)){var keys=self.get("persistKeys",[]),index=keys.indexOf(id);-1==index||persist?-1==index&&persist&&keys.push(id):keys.splice(index,1),self.set("persistKeys",keys)}}else"string"!=typeof value&&"boolean"!=typeof value&&(value=JSON.stringify(value)),$location.search(id,value),sviUrl.href($location.absUrl());return self},self.remove=function(id){return id&&(useStorage?$window.localStorage.removeItem(prefix+id):($location.search(id,null),sviUrl.href($location.absUrl()))),self},self.save=function(){return self},self.clearStorage=function(clearPersistent,clearCache){if(!useStorage)return self;var i,j,rawKey,key,skip,cacheKeys;angular.isUndefined(clearPersistent)&&(clearPersistent=!1),angular.isUndefined(clearCache)&&(clearCache=!1);var l=$window.localStorage.length,persistKeys=self.get("persistKeys",[]);persistKeys.push.apply(persistKeys,APP_CONFIG.persistStorageKeys);var pl=persistKeys.length,keysToRemove=[];for(clearCache||(cacheKeys=self.get("cacheKeys"),angular.isObject(cacheKeys)||(clearCache=!0)),i=0;i<l;i++)if(0===(rawKey=$window.localStorage.key(i)).indexOf(prefix)){if(skip=!1,"build"!=(key=rawKey.substring(prefix.length))&&"sessionId"!=key&&"lastPageUrl"!=key||(skip=!0),!skip&&!clearPersistent&&0<pl)for(j=0;j<pl;j++)if(key==persistKeys[j]){skip=!0;break}skip||clearCache||"cacheKeys"!=key&&!cacheKeys.hasOwnProperty(key)||(skip=!0),skip||keysToRemove.push(rawKey)}for(l=keysToRemove.length,i=0;i<l;i++)$window.localStorage.removeItem(keysToRemove[i]);return self};var phpsessid=$cookies.get("PHPSESSID");try{var build=$window.localStorage.getItem(prefix+"build"),sessionId=self.get("sessionId");if(build&&build==svi.buildNumber&&(!phpsessid||sessionId&&sessionId==phpsessid)){var url=sviUrl.href().split("#")[0];url!=self.get("lastPageUrl")&&(self.clearStorage(),self.set("lastPageUrl",url))}else self.clearStorage(!0,!0),$window.localStorage.setItem(prefix+"build",svi.buildNumber),self.set("sessionId",phpsessid)}catch(e){useStorage=!1}var initialized=!(self.disableStorage=function(){return useStorage=!1,self});self.init=function(){return initialized||(initialized=!0,self.set("svi",!0).save()),self},useStorage||$timeout(self.init)}]),angular.module("services").service("stockInfo",["APP_CONFIG","$timeout","$http",function(APP_CONFIG,$timeout,$http){this.getInfo=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/stockInfo";return $http.get(url,config)},this.getMetrics=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/stockDetails";return $http.get(url,config)},this.getAnalystConsensus=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/analystConsensus";return $http.get(url,config)},this.getEtf=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/etfInfo";return $http.get(url,config)},this.getStockPeers=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/stockPeers";return $http.get(url,config)},this.getStockESGSummary=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/stockESGSummary";return $http.get(url,config)},this.getStockFinancials=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/stockFinancials";return $http.get(url,config)},this.getEventHeadlines=function(symbol,startDate,endDate,category,invalidateCache,symbolFormat){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/eventHeadlines?category="+category+"&startDate="+startDate+"&endDate="+endDate;return angular.isDefined(symbolFormat)&&(url+="&symbolFormat="+symbolFormat),$http.get(url,config)},this.getStockOwnershipHolders=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/stockOwnershipHolders";return $http.get(url,config)},this.getStockKeyRatios=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/research/research/"+symbol+"/stockKeyRatios";return $http.get(url,config)}}]),angular.module("services").service("switchAccount",["$http","eventDispatcher","accountList",function($http,eventDispatcher,accountList){var triggerEvent=function(data){var status=data.status,response=data.data;if(200==status&&response.hasOwnProperty("success")&&response.success){var eventData={};response.hasOwnProperty("mode")?eventData.mode=response.mode:eventData.mode=null,response.hasOwnProperty("currentAccountData")?eventData.single=response.currentAccountData:eventData.single=null,response.hasOwnProperty("multiAccountData")?eventData.multi=response.multiAccountData:eventData.multi=null,response.hasOwnProperty("combinedAccountData")?eventData.combined=response.combinedAccountData:eventData.combined=null,response.hasOwnProperty("currentAccount")?eventData.currentAccount=response.currentAccount:eventData.currentAccount=null,response.hasOwnProperty("currentAccountIndex")?eventData.currentAccountIndex=response.currentAccountIndex:eventData.currentAccountIndex=null,response.hasOwnProperty("currentAccountList")?eventData.currentAccountList=response.currentAccountList:eventData.currentAccountList=null,response.hasOwnProperty("currentAccountIndexList")?eventData.currentAccountIndexList=response.currentAccountIndexList:eventData.currentAccountIndexList=null,response.hasOwnProperty("currentGroup")?eventData.currentGroup=response.currentGroup:eventData.currentGroup=null,eventDispatcher.trigger("ACCOUNT.DATA.CHANGED",eventData)}},previousBroadcast=null;this.single=function(accountIndex){if(angular.isUndefined(accountIndex)||""===accountIndex||!1===accountIndex)return!1;accountList.setCurrentAccountIndex(accountIndex);try{1==accountList.getCurrentAccountIndexList().length&&accountList.setCurrentAccountIndexList([accountIndex])}catch(e){}var data=accountList.getAccountObjectByIndex(accountIndex);if(data.currentAccount=[accountIndex],previousBroadcast&&"single"===previousBroadcast.mode&&previousBroadcast.index==accountIndex)return!0;previousBroadcast={mode:"single",index:accountIndex},eventDispatcher.trigger("ACCOUNT.CONTEXT.CHANGED",data);var url="/Web/auth/switchAccount/single/"+accountIndex,promise=$http.get(url,{invalidateCache:!0});return promise.then(triggerEvent),promise},this.multi=function(accounts,shouldFilterAccounts){if(angular.isUndefined(accounts)||""===accounts||!1===accounts)return!1;angular.isArray(accounts)||(accounts=[accounts]),accountList.setCurrentGroup(null),accountList.setCurrentAccountIndexList(accounts);var accountString=accounts.join(","),data={};if(-1==accountString.indexOf(",")){if(!1===accountList.setCurrentAccountIndex(accountString))return!1;data=accountList.getAccountObjectByIndex(accountString)}if(data.currentAccount=accounts,previousBroadcast&&"multi"===previousBroadcast.mode&&0===accounts.symDiff(previousBroadcast.accountList).length)return!0;if(previousBroadcast={mode:"multi",accountList:accounts},1<accounts.length){data.accountData=[],data.productId=!1;for(var i=0,l=accounts.length;i<l;i++)if(data.accountData[i]=accountList.getAccountObjectByIndex(accounts[i]),!1===data.productId||data.productId===data.accountData[i].productId)data.productId=data.accountData[i].productId;else if(data.productId=null,shouldFilterAccounts)break;null!==data.productId?data.productName=data.accountData[0].productName:data.productName=null}eventDispatcher.trigger("ACCOUNT.CONTEXT.CHANGED",data),eventDispatcher.trigger("ACCOUNT.GROUP.CONTEXT.CHANGED",{group:null,selectedAccounts:accounts});var url="/Web/auth/switchAccount/multi/"+accountString,promise=$http.get(url,{invalidateCache:!0});return promise.then(triggerEvent),promise},this.group=function(group){if(!accountList.setCurrentGroup(group))return!1;var accounts;accounts=group.hasOwnProperty("accountIndexes")?group.accountIndexes:accountList.getIndexesFromObjects(group.accounts),accountList.setCurrentAccountIndexList(accounts);var data={};if(1==accounts.length&&(accountList.setCurrentAccountIndex(accounts[0]),data=accountList.getAccountObjectByIndex(accounts[0])),data.currentAccount=accounts,previousBroadcast&&"group"===previousBroadcast.mode&&previousBroadcast.group==group.id&&0===accounts.symDiff(previousBroadcast.accountList).length)return!0;previousBroadcast={mode:"group",group:group.id,accountList:accounts},data.group=group,data.group.hasOwnProperty("productId")?(data.productId=data.group.productId,data.group.hasOwnProperty("productName")?data.productName=data.group.productName:data.productName=null):(data.productId=null,data.productId=null),eventDispatcher.trigger("ACCOUNT.CONTEXT.CHANGED",data),eventDispatcher.trigger("ACCOUNT.GROUP.CONTEXT.CHANGED",{group:group,selectedAccounts:accounts});var url="/Web/auth/switchAccount/group/"+group.id,promise=$http.get(url,{invalidateCache:!0});return promise.then(triggerEvent),promise}}]),angular.module("services").service("symbol",["$http","accountList","APP_CONFIG",function($http,accountList,APP_CONFIG){this.getPriceHistory=function(symbol,timespan,symbolFormat,marketHoursOnly,invalidateCache,frequency){if(angular.isUndefined(symbol)||""===symbol)return!1;(angular.isUndefined(symbolFormat)||"ric"!==symbolFormat)&&(symbolFormat="ticker");var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),"ric"!==symbolFormat&&(symbol=symbol.replace(/[^a-z0-9\.]/gi,""));var url="/Web/symbol/"+encodeURIComponent(symbol)+"/history",params={symbolFormat:symbolFormat};return timespan&&(params.timespan=timespan),angular.isDefined(marketHoursOnly)&&marketHoursOnly&&(params.marketHoursOnly="Y"),frequency&&(params.interval=frequency),$http.get(url+"?"+$.param(params),config)},this.getQuote=function(symbol,delayed,symbolFormat,invalidateCache,isFutures){if(angular.isUndefined(symbol)||""===symbol||angular.isArray(symbol)&&0===symbol.length)return!1;(angular.isUndefined(symbolFormat)||"ric"!==symbolFormat)&&(symbolFormat="ticker");var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),angular.isArray(symbol)&&(symbol=symbol.join(",")),symbol=symbol.replace(/\//g,"");var params={delayed:svi.ng.strToBoolean(delayed,!1)?"true":"false",symbolFormat:symbolFormat,accountIndex:accountList.getCurrentAccountIndex(),switchAccounts:"N"};return isFutures&&(params.isFutures=!0),$http.get("/Web/symbol/"+encodeURIComponent(symbol)+"/quote?"+$.param(params),config)},this.getNews=function(symbol,pageSize,pageNum,topic){if(angular.isUndefined(symbol)||""===symbol||angular.isArray(symbol)&&!symbol.length)return!1;angular.isArray(symbol)&&(symbol=symbol.join(","));var params={};return angular.isDefined(pageSize)&&angular.isNumber(pageSize)&&(params.pageSize=pageSize),angular.isDefined(pageNum)&&angular.isNumber(pageNum)&&(params.pageNum=pageNum),angular.isDefined(topic)&&angular.isString(topic)&&(params.topic=topic),angular.equals(params,{})?$http.get("/Web/symbol/"+symbol+"/news"):$http.get("/Web/symbol/"+symbol+"/news?"+$.param(params))},this.getNewsStory=function(symbol,storyId){return!angular.isUndefined(symbol)&&""!==symbol&&$http.get("/Web/symbol/"+symbol+"/news/"+storyId)},this.lookup=function(params,invalidateCache){if(!angular.isObject(params)||!params.hasOwnProperty("search"))throw"search parameter is required";params.hasOwnProperty("start")||(params.start=0),params.hasOwnProperty("limit")||(params.limit=20);var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get("/Modules/Research/SymbolLookup/symbolLookupJSON.php?"+$.param(params),config)},this.osiSubmitFormat=function(symbol){for(var a_symbol=symbol.split(svi.util.parseRegExp("/"+APP_CONFIG.optionMaskSeparator+"/i")),map=APP_CONFIG.optionOrder,output={},i=0;i<map.length;i++)switch(map[i]){case"symbol":output.symbol=a_symbol[i];break;case"putOrCall":switch(output.putOrCall=a_symbol[i],output.putOrCall.toUpperCase()){case"C":case"CALL":case 1:output.putOrCall="1";break;case"P":case"PUT":case 0:output.putOrCall="0"}break;case"strikePrice":output.strikePrice=a_symbol[i];break;case"expDate":output.expDate=php.date("Y/m/d",php.strtotime(a_symbol[i]))}return output},this.getMonthPriceHistory=function(symbol,invalidateCache){var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var url="/Web/symbol/"+symbol+"/history";return $http.get(url+"?"+$.param({timespan:"OneYear",calcOHLC:!0,interval:"Month"}),config)},this.getSymbolOSIInfo=function(searchQuery,invalidateCache){if(!searchQuery)throw"searchQuery param is required";var config={},url=svi.url.getHost()+"/Modules/Lib/MVC/OSI/loadOSIData.php?query="+encodeURIComponent(searchQuery);return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(url,config)},this.compareTwoOptionSymbols=function(symbol,symbolToCompare){return symbol.rootSymbol===symbolToCompare.symbol&&symbol.securityType===symbolToCompare.securityType&&symbol.strikePrice===symbolToCompare.strikePrice&&symbol.maturityDate===symbolToCompare.maturityDate&&symbol.putCall===symbolToCompare.putCall}}]),angular.module("services").service("tags",["$http",function($http){this.urlBase="/Web/util/tags",this.get=function(name){return name||(name=""),$http.get(this.urlBase+"/"+name)},this.getBySymbol=function(symbol){return!!symbol&&(angular.isArray(symbol)?$http.get(this.urlBase,{params:{"symbol[]":symbol}}):$http.get(this.urlBase,{params:{symbol:symbol}}))},this.create=function(name,value){return!(this.ignoring||!name||!value)&&$http.post(this.urlBase+"/"+name,value)},this.update=function(name,value){return!(this.ignoring||!name||!value)&&$http.put(this.urlBase+"/"+name,value)},this.remove=function(name){return!(this.ignoring||!name)&&$http.delete(this.urlBase+"/"+name)},this.addSymbol=function(name,symbol){return!(this.ignoring||!name||!symbol)&&$http.get(this.urlBase+"/"+name+"/addSymbol?symbol="+symbol)},this.removeSymbol=function(name,symbol){return!(this.ignoring||!name||!symbol)&&$http.get(this.urlBase+"/"+name+"/removeSymbol?symbol="+symbol)},this.ignoring=!1,this.ignoreUpdates=function(ignore){this.ignoring=ignore}}]),angular.module("services").service("topmovers",["$http",function($http){this.getTopMovers=function(accounts,howMany,invalidateCache){if(!1===angular.isArray(accounts))throw new Error("accounts is expected to be an array");var config={};angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache);var data={switchAccounts:"N"};return howMany&&(data.howMany=howMany),$http.get("/Web/multiAccount/"+accounts.join(",")+"/portfolioSummary/topMovers?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services").service("totalPortfolioMovers",["$http",function($http){this.getAllAccountsSummary=function(accountList,data,invalidateCache){if(angular.isUndefined(accountList)||""===accountList||!1===accountList)return!1;angular.isArray(accountList)&&(accountList=accountList.join(","));var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),void 0!==data&&data&&angular.isObject(data)||(data={}),data.switchAccounts="N",$http.get("/Web/multiAccount/"+accountList+"/portfolioSummary/accountsSummary?"+$.param(svi.util.sortByKeys(data)),config)}}]),angular.module("services.tracking").service("piwik",["$log","$location",function($log,$location){var self=this,getIndex=function(used){if(0===used.length)return 1;for(var i=1;i<=5;i++)if(!$.inArray(i,used))return i;return-1};this.trackDataLoad=function(scope,data){var name=scope.api.name||"unknown",friendlyName=scope.api.friendlyName||name;self.trackPage(name,friendlyName,1e3*data._loaderMetadata.elapsedTime)},this.trackPage=function(id,title,loadTime,customVariables){if("object"==typeof _paq&&angular.isFunction(_paq.push)){_paq.push(["setCustomUrl",$location.protocol()+"://"+$location.host()+"/Angular/"+id]),_paq.push(["setDocumentTitle",title]),_paq.push(["setReferrerUrl",$location.absUrl()]),angular.isNumber(loadTime)&&_paq.push(["setGenerationTimeMs",loadTime]),_paq.push(["deleteCustomVariables","page"]);var i,l,customVar,usedIndexes=[];if(svi.piwik&&svi.piwik.customVars)for(i=0,l=svi.piwik.customVars.length;i<l;i++)"page"==(customVar=svi.piwik.customVars[i]).scope&&(_paq.push(["setCustomVariable",customVar.index,customVar.name,customVar.value,customVar.scope]),usedIndexes.push(customVar.index));if(angular.isArray(customVariables))for(i=0,l=customVariables.length;i<l;i++)(customVar=customVariables[i]).hasOwnProperty("index")||(customVar.index=getIndex(usedIndexes)),customVar.index<1||5<customVar.index?$log.warn("Piwik CustomVar Index out of bounds",customVar):(_paq.push(["setCustomVariable",customVar.index,customVar.name,customVar.value,"page"]),usedIndexes.push(customVar.index));_paq.push(["trackPageView"])}},this.trackEvent=function(category,action,name,value){if("object"==typeof _paq&&angular.isFunction(_paq.push)){var data=["trackEvent",category,action];angular.isDefined(name)&&0<name.length&&data.push(name),angular.isNumber(value)&&data.push(value),_paq.push(data)}}}]),angular.module("services.ui").service("bsBreakpoint",["$window","$timeout","eventDispatcher",function($window,$timeout,eventDispatcher){var self=this;self.XS=0,self.SM=1,self.MD=2,self.LG=3;var MOBILE_BREAKPOINT=self.SM;self.getBreakpoint=function(){var windowWidth=$window.innerWidth;return windowWidth<768?self.XS:768<=windowWidth&&windowWidth<992?self.SM:992<=windowWidth&&windowWidth<1200?self.MD:1200<=windowWidth?self.LG:-1},self.getBreakpointName=function(breakpoint){switch(breakpoint){case self.XS:return"xs";case self.SM:return"sm";case self.MD:return"md";case self.LG:return"lg";default:return"invalid"}},self.isMobile=function(){return self.getBreakpoint()<MOBILE_BREAKPOINT};var currentBreakpoint=self.getBreakpoint(),previousBreakpoint=null,onResize=$.throttle(250,function(){var newBreakpoint=self.getBreakpoint();newBreakpoint!=currentBreakpoint&&(previousBreakpoint=currentBreakpoint,currentBreakpoint=newBreakpoint,eventDispatcher.trigger("WINDOW.BREAKPOINT",{current:currentBreakpoint,currentName:self.getBreakpointName(currentBreakpoint),previous:previousBreakpoint,previousName:self.getBreakpointName(previousBreakpoint)}))});angular.element($window).on("resize",onResize),angular.element($window).on("orientationchange",onResize)}]),angular.module("services.ui").service("expander",["eventDispatcher",function(eventDispatcher){var self=this;this.init=function(scope,eventIdBase,element,callback){if(!angular.isObject(scope)||!eventIdBase)return!1;scope.visibleRowsEventIdBase=eventIdBase,scope.visibleRowsCallback=angular.isFunction(callback)?callback:angular.noop,self.reset(scope),eventDispatcher.on("EXPANDER."+eventIdBase,function(e,data){data.hasOwnProperty("target")&&data.hasOwnProperty("show")&&self.setVisibility(scope,data.target,data.show)},!1,element)},this.reset=function(scope){angular.isObject(scope.visibleRows)&&angular.isFunction(scope.visibleRowsCallback)&&angular.forEach(scope.visibleRows,function(show,target){scope.visibleRowsCallback(target,null)}),scope.visibleRows={}},this.setVisibility=function(scope,target,show){angular.isFunction(scope.visibleRowsCallback)&&scope.visibleRowsCallback(target,show),scope.visibleRows[target]=show},this.expand=function(scope,target){var data={target:target,show:!0};eventDispatcher.trigger("EXPANDER."+scope.visibleRowsEventIdBase,data)},this.collapse=function(scope,target){var data={target:target,show:!1};eventDispatcher.trigger("EXPANDER."+scope.visibleRowsEventIdBase,data)}}]),angular.module("services.ui").service("floatThead",["APP_CONFIG","bsBreakpoint",function(APP_CONFIG,bsBreakpoint){this.init=function($scope,$element,name){if(!angular.isObject($scope))throw"$scope is required";if(name&&angular.isString(name)||(name="floatTheadOptions"),$element.parents(".widget").length)$scope[name]=!1;else{if($scope.hasOwnProperty(name)||($scope[name]={zIndex:500,position:"absolute"}),$("body").hasClass("sticky-navigation"))APP_CONFIG.hasOwnProperty("navHeightMobile")&&bsBreakpoint.getBreakpoint()<bsBreakpoint.SM?$scope[name].top=APP_CONFIG.navHeightMobile:$scope[name].top=APP_CONFIG.navHeight;else{var height=$(".sticky-navigation").height();height&&($scope[name].top=height)}$scope[name].hasOwnProperty("ariaLabel")||($scope[name].ariaLabel=function(table,headerCell,columnIndex){return headerCell.text().trim()})}}}]),angular.module("services.ui").service("grid",["APP_CONFIG","$timeout","$log","state","floatThead","eventDispatcher",function(APP_CONFIG,$timeout,$log,state,floatThead,eventDispatcher){var self=this;this.attachContainer=function($scope,$element,$attrs,defaultSortField,defaultSortDir){if(!angular.isObject($scope)||!$scope.hasOwnProperty("api")||!angular.isObject($scope.api))throw"$scope object must be defined and have $scope.api = this";if(!angular.isObject($element))throw"$element is required";if(!angular.isObject($attrs))throw"$attrs is required";var name=$scope.api.name||"unknown",eventName=($scope.api.friendlyName,$scope.api.eventName||name.toUpperCase());if(self.attachSorting($scope,$element,$attrs,defaultSortField,defaultSortDir),$scope.hasOwnProperty("currentPage")||($scope.currentPage=0,$scope.pageSize&&($scope.currentPage=1)),$scope.hasOwnProperty("totalPages")||($scope.totalPages=0),$scope.hasOwnProperty("pageCacheID")||($scope.pageCacheID=""),$scope.hasOwnProperty("columns")&&angular.isString($scope.columns))try{svi.ng.parseJSON($scope,$attrs,"columns")}catch(e){$log.error(name+": Error parsing columns: ",e,$attrs.columns),$scope.columns=$attrs.columns=[]}if($scope.hasOwnProperty("columnPriority")&&angular.isString($scope.columnPriority))try{svi.ng.parseJSON($scope,$attrs,"columnPriority")}catch(e){$log.warn(name+": Error parsing columnPriority: ",e,$attrs.columnPriority),$scope.columnPriority=$attrs.columnPriority=[]}if($scope.hasOwnProperty("totalsConfig")&&angular.isString($scope.totalsConfig))try{svi.ng.parseJSON($scope,$attrs,"totalsConfig")}catch(e){$log.error(name+": Error parsing totalsConfig: ",e,$attrs.totalsConfig),$scope.totalsConfig=$attrs.totalsConfig={}}eventDispatcher.on(eventName+".PAGE.CHANGED",function(e,data){$scope.currentPage!==data&&($scope.currentPage=data,$scope.api.load())},!0,$element),eventDispatcher.on(eventName+".REFRESH",function(){$scope.api.load(!0)},null,$element)},this.attachSorting=function($scope,$element,$attrs,defaultSortField,defaultSortDir){if(!angular.isObject($scope)||!$scope.hasOwnProperty("api")||!angular.isObject($scope.api))throw"$scope object must be defined and have $scope.api = this";if(!angular.isObject($element))throw"$element is required";if(!angular.isObject($attrs))throw"$attrs is required";var name=$scope.api.name||"unknown",eventName=($scope.api.friendlyName,$scope.api.eventName||name.toUpperCase());angular.isUndefined(defaultSortField)&&(defaultSortField=""),(angular.isUndefined(defaultSortDir)||"desc"!=defaultSortDir)&&(defaultSortDir="asc"),$scope.hasOwnProperty("initComplete")||($scope.initComplete=!1),$scope.api.hasOwnProperty("isReadyToLoad")||($scope.api.isReadyToLoad=function(){return $scope.initComplete}),$scope.hasOwnProperty("sortDir")||($scope.sortDir=state.get(name+"-sortDir",defaultSortDir),$scope.$watch("sortDir",function(val){state.set(name+"-sortDir",val).save()})),$scope.hasOwnProperty("sortField")||($scope.sortField=state.get(name+"-sortField",defaultSortField),$scope.$watch("sortField",function(val){state.set(name+"-sortField",val).save()})),eventDispatcher.on(eventName+".SORT.CHANGED",function(e,data){data.hasOwnProperty("field")&&data.hasOwnProperty("dir")&&($scope.sortField!==data.field||$scope.sortDir!==data.dir)&&($scope.sortField=data.field,$scope.sortDir=data.dir,$scope.api.load())},!0,$element)},this.attachGrid=function($scope,$element){if(!angular.isObject($scope)||!$scope.hasOwnProperty("api")||!angular.isObject($scope.api))throw"$scope object must be defined and have $scope.api = this";if(!angular.isObject($element))throw"$element is required";var name=$scope.api.name||"unknown";$scope.api.friendlyName,$scope.api.eventName||name.toUpperCase();floatThead.init($scope,$element),$scope.hasOwnProperty("responsiveColumnsSettings")||($scope.responsiveColumnsSettings={enabled:$scope.responsiveColumns,priority:$scope.columnPriority,formatters:{actionMenu:!1,change:"currencyChange",pctChange:"percentChange",marketValueChange:"currencyChange"}})}}]),angular.module("services.ui").service("modal",["APP_CONFIG","$timeout",function(APP_CONFIG,$timeout){this.attach=function($scope,$element,callback){if(!angular.isObject($scope)||!$scope.hasOwnProperty("api")||!angular.isObject($scope.api))throw"$scope object must be defined and have $scope.api = this";if(!angular.isObject($element))throw"$element is required";if($scope.api.hasOwnProperty("getModalCtrl")&&angular.isFunction($scope.api.getModalCtrl)||($scope.api.getModalCtrl=svi.ng.getControllerFactory($element,$scope,"svi-modal")),angular.isFunction(callback)){var initCallback=function(){var modalCtrl=$scope.api.getModalCtrl();modalCtrl?modalCtrl.setCallback(callback):$timeout(initCallback,APP_CONFIG.autoLoadDelay)};initCallback()}}}]),angular.module("services.ui").service("waypoints",["$timeout",function($timeout){this.init=function($scope,$element,name,throttleDelay){if(!angular.isObject($scope))throw"$scope is required";if(!angular.isObject($element))throw"$element is required";name&&angular.isString(name)||(name="waypoints"),throttleDelay||(throttleDelay=250),$scope.hasOwnProperty(name)||($scope[name]={waypoints:null,status:{}}),$scope[name].refresh=function(){angular.forEach($scope[name].waypoints,function(item){item.context.refresh()})},$scope[name].destroy=function(){angular.forEach($scope[name].waypoints,function(item){item.context.destroy()}),$scope[name].status={}},$scope[name].waypoints&&$scope[name].destroy(),$timeout(function(){$scope[name].waypoints=$element.waypoint($.throttle(throttleDelay,function(direction){$scope.$applyAsync(name+".status = { "+direction+": true }")})),$timeout($scope[name].refresh,1e3)},0)}}]),angular.module("services.ui").service("widget",["APP_CONFIG","$timeout","piwik",function(APP_CONFIG,$timeout,piwik){this.attach=function($scope,$element){if(!angular.isObject($scope)||!$scope.hasOwnProperty("api")||!angular.isObject($scope.api))throw"$scope object must be defined and have $scope.api = this";if(!angular.isObject($element))throw"$element is required";var name=$scope.api.name||"unknown",friendlyName=$scope.api.friendlyName||name;if(angular.isUndefined($scope.viewMode)&&($scope.viewMode=APP_CONFIG.viewMode),$scope.api.hasOwnProperty("getWidgetCtrl")&&angular.isFunction($scope.api.getWidgetCtrl)||($scope.api.getWidgetCtrl=svi.ng.getControllerFactory($element,$scope,"svi-widget")),$scope.api.hasOwnProperty("widgetResize")&&angular.isFunction($scope.api.widgetResize)||($scope.api.widgetResize=function(){var widgetCtrl=$scope.api.getWidgetCtrl();widgetCtrl&&widgetCtrl.checkWidgetSize(100)}),$scope.api.hasOwnProperty("setLoader")&&angular.isFunction($scope.api.setLoader)){var originalLoader=$scope.api.setLoader;$scope.api.setLoader=function(loader){var widgetCtrl=$scope.api.getWidgetCtrl();widgetCtrl&&widgetCtrl.setLoader(loader),originalLoader.apply($scope.api,arguments)}}$scope.api.hasOwnProperty("canToggleSettings")&&angular.isFunction($scope.api.canToggleSettings)||($scope.api.canToggleSettings=function(){return!$scope.viewMode}),$scope.api.hasOwnProperty("toggleSettings")&&angular.isFunction($scope.api.toggleSettings)||($scope.api.toggleSettings=function(){if($scope.api.canToggleSettings()){var widgetCtrl=$scope.api.getWidgetCtrl();widgetCtrl&&(widgetCtrl.getFlipped()?$scope.api.hideSettings():$scope.api.showSettings())}}),$scope.api.hasOwnProperty("showSettings")&&angular.isFunction($scope.api.showSettings)||($scope.api.showSettings=function(){if($scope.api.canToggleSettings()){piwik.trackEvent(friendlyName,"Show Settings");var widgetCtrl=$scope.api.getWidgetCtrl();widgetCtrl&&widgetCtrl.flip(!0)}}),$scope.api.hasOwnProperty("hideSettings")&&angular.isFunction($scope.api.hideSettings)||($scope.api.hideSettings=function(){piwik.trackEvent(friendlyName,"Hide Settings");var widgetCtrl=$scope.api.getWidgetCtrl();widgetCtrl&&widgetCtrl.flip(!1)}),$scope.api.hasOwnProperty("more")&&angular.isFunction($scope.api.more)||($scope.api.more=function(){$scope.hasOwnProperty("moreUrl")&&sviUrl.href($scope.moreUrl)})},this.initSize=function($scope,$element,getActiveSize,minSize,maxSize,unitSize){if(!angular.isObject($scope))throw"$scope is required";if(!angular.isObject($element))throw"$element is required";var baseFontSize=parseFloat($element.css("fontSize"));(!angular.isNumber(minSize)||minSize<1)&&(minSize=APP_CONFIG.defaultWidgetSize),angular.isNumber(maxSize)?maxSize<minSize&&(maxSize=minSize):maxSize=APP_CONFIG.maxWidgetSize,isNaN(baseFontSize)?(minSize*=12,maxSize*=12):(minSize*=baseFontSize,maxSize*=baseFontSize),angular.isNumber(unitSize)?isNaN(baseFontSize)?unitSize*=12:unitSize*=baseFontSize:unitSize=!1,angular.isFunction(getActiveSize)||(getActiveSize=function(){return $scope.flipped?$element.find(".back").height():$element.find(".front").height()});var checkSizeTimeout=null,internalResize=function(){var height=getActiveSize(),overflow=!1;height<minSize?height=minSize:maxSize<height&&(height=maxSize,overflow=!0),unitSize&&(height=Math.ceil(height/unitSize)*unitSize),$element.find(".widget").toggleClass("max-height",overflow).height(height),$element.find(".widget").trigger("heightChanged")};($scope.checkWidgetSize=function(delay){if(checkSizeTimeout&&($timeout.cancel(checkSizeTimeout),checkSizeTimeout=null),delay)return checkSizeTimeout=$timeout($scope.checkWidgetSize,delay);$timeout(internalResize),$scope.checkWidgetSize(1e3)},$scope.observeChanges)&&new MutationObserver($.throttle(200,function(){$scope.checkWidgetSize(),$scope.$applyAsync()})).observe($element.find(".widget").get(0),{childList:!0,subtree:!0});$scope.checkWidgetSize(100)}}]),angular.module("services").service("sviUrl",["$window","$location","navigation",function($window,$location,navigation){var self=this;self.href=function(url,target,specs){if(angular.isString(url)&&""!==url)angular.isString(target)&&""!==target?angular.isString(specs)&&""!==specs?$window.open(url,target,specs):$window.open(url,target):$window.location.href=url;else{if(!angular.isObject(url))return $window.location.href;navigation.getLaminasUrl(url).then(function(response){response.data.success&&(url=svi.url.getHost()+response.data.url)&&self.href(url,target,specs)})}},self.historyBack=function(){return $window.history.back()},self.getSearchParamsFromQuery=function(){var params={},query=new URL($window.location.href).search;return!(!angular.isString(query)||""===query)&&(query.substr(1).split("&").forEach(function(item){params[item.split("=")[0]]=item.split("=")[1]}),params)},self.updateLocation=function(loc){if(angular.isArray(self.scopes)&&0<self.scopes.length)for(var i=0,l=self.scopes.length;i<l;i++)self.scopes[i].path(loc)};var loc;svi.hasOwnProperty("location")||(svi.location=self),loc=$location,svi.location.hasOwnProperty("scopes")||(svi.location.scopes=[]),-1===svi.location.scopes.indexOf(loc)&&svi.location.scopes.push(loc)}]),angular.module("services").service("userMessage",["$http","$cacheFactory",function($http,$cacheFactory){this.urlBase="/Web/user/message",this.getMessages=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase,config)},this.getMessagesBadge=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase+"/badge",config)}}]),angular.module("services").service("watchlist",["$http",function($http){this.urlBase="/Web/user/watchlist",this.getList=function(invalidateCache){var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase,config)},this.getWatchlist=function(name,invalidateCache){if(!name)return!1;var config={};return angular.isDefined(invalidateCache)&&(config.invalidateCache=invalidateCache),$http.get(this.urlBase+"/"+name,config)},this.create=function(name){return!!name&&$http.post(this.urlBase+"/"+name,{})},this.addSymbol=function(name,symbol){return!(!name||!symbol)&&(symbol=symbol.replace(/\//g,""),$http.post(this.urlBase+"/"+name+"/"+symbol,{}))},this.removeSymbol=function(name,symbol){return!(!name||!symbol)&&(symbol=symbol.replace(/\//g,""),$http.delete(this.urlBase+"/"+name+"/"+symbol,{}))},this.remove=function(name){return!!name&&$http.delete(this.urlBase+"/"+name)}}]),angular.module("templates-app",[]),angular.module("templates-common",[]),angular.module("templates-accountInfo",["accountProfile/accountProfile.tpl.html","accountsSummaryContainer/accountsSummaryContainer.tpl.html","accountsSummaryContainer/accountsSummaryContainerWidget.tpl.html","accountsSummaryGrid/accountSummaryModal.tpl.html","accountSummaryDetail/accountSummaryDetail.tpl.html","iraContribution/iraContribution.tpl.html","iraContribution/iraContributionWidget.tpl.html","iraSummary/iraSummary.tpl.html","myFinancialAdvisor/myFinancialAdvisor.tpl.html","myFinancialAdvisor/myFinancialAdvisorInfo.tpl.html"]),angular.module("accountProfile/accountProfile.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountProfile/accountProfile.tpl.html",'<div class="svi-directive svi-account-profile" data-svi-widget data-title="labels.accountProfileTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t\t<div class="loader na-loader" data-svi-loader data-callback="setLoader"></div>\n\t\t\t<div class="list-body">\n\t\t\t\t<ul class="list-group with-border">\n\t\t\t\t\t<li class="list-group-item address" data-ng-if="nameAddress.address">\n\t\t\t\t\t\t<div class="text" data-ng-repeat="line in nameAddress.address track by $index" data-ng-if="line.length" data-ng-bind="line"></div>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class="list-group-item user-email" data-ng-if="nameAddress.userEmail">\n\t\t\t\t\t\t<div class="text" data-ng-bind="nameAddress.userEmail"></div>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class="list-group-item option-level" data-ng-if="nameAddress.optionApprovalCode1 && nameAddress.optionApprovalCode1 != \'0\'">\n\t\t\t\t\t\t<div class="strong" data-ng-bind="labels.optionLevelApproval"></div>\n\t\t\t\t\t\t<div class="text" data-ng-bind="nameAddress.optionApprovalCode1|optionLevel:labels"></div>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class="list-group-item margin-account" data-ng-if="nameAddress.marginEnabled">\n\t\t\t\t\t\t<div class="strong" data-ng-bind="labels.accountProfileMarginAccount"></div>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class="list-group-item bonus-trades" data-ng-if="::showBonusTrades"\n\t\t\t\t\t\tdata-svi-bonus-trades\n\t\t\t\t\t\tdata-show-title="false"\n\t\t\t\t\t\tdata-show-expiration="{{::showBonusTradesExpiration}}"></li>\n\t\t\t\t\t<li class="list-group-item pattern-day-trader-status" data-ng-if="showDayTraderValue && showDayTraderValue === nameAddress.daytrader">\n\t\t\t\t\t\t<div class="strong" data-ng-bind="labels.patternDayTraderStatus"></div>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("accountsSummaryContainer/accountsSummaryContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountsSummaryContainer/accountsSummaryContainer.tpl.html",'<div class="svi-directive svi-accounts-summary-container">\n\t<h3 class="title" data-ng-if="labels.accountsSummaryTitle && showTitle" data-ng-bind="labels.accountsSummaryTitle"></h3>\n\t<div class="row"><div class="col-md-12" data-svi-loader data-callback="setLoader"></div></div>\n\t<div class="row" data-ng-show="totalPortfolioMovers">\n\t\t<div data-svi-accounts-summary-grid class="col-md-12"\n\t\t\t data-columns="columns"\n\t\t\t data-column-priority="columnPriority"\n\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t data-sort-field="sortField"\n\t\t\t data-sort-dir="sortDir"\n\t\t\t data-sortable="sortable"\n\t\t\t data-total-portfolio-movers="totalPortfolioMovers"\n\t\t\t data-show-expander="{{::showExpander}}"\n\t\t\t data-auto-expand-single="{{::autoExpandSingle}}"\n\t\t\t data-local-product-type="{{::localProductType}}"\n\t\t></div>\n\t</div>\n</div>')}]),angular.module("accountsSummaryContainer/accountsSummaryContainerWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountsSummaryContainer/accountsSummaryContainerWidget.tpl.html",'<div class="svi-directive svi-accounts-summary-container" data-svi-widget data-title="labels.accountsSummaryTitle">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div data-svi-account-summary-detail data-ng-if="totalPortfolioMovers && !multiAccountFlag"\n\t\t\t\t\t\t data-account="{{totalPortfolioMovers.accounts[0].accountIndex}}"\n\t\t\t\t\t\t data-account-data="totalPortfolioMovers"\n\t\t\t\t\t\t data-data-points="detailDatapoints"\n\t\t\t\t\t\t data-default-classes="{{defaultClasses}}"\n\t\t\t\t\t\t data-financial-advisor-classes="{{financialAdvisorClasses}}"\n\t\t\t\t\t\t data-trades-classes="{{tradesClasses}}"\n\t\t\t\t\t\t data-quick-links-classes="{{quickLinksClasses}}"\n\t\t\t\t\t\t data-show-option-buying-power="{{showOptionBuyingPower}}"\n\t\t\t\t\t\t data-quick-links="quickLinks"></div>\n\n\t\t\t\t\t<div data-ng-if="multiAccountFlag">\n\t\t\t\t\t\t<div data-svi-accounts-summary-grid data-ng-show="totalPortfolioMovers"\n\t\t\t\t\t\t\t data-columns="columns"\n\t\t\t\t\t\t\t data-column-priority="columnPriority"\n\t\t\t\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t\t\t\t data-sort-field="sortField"\n\t\t\t\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t\t\t\t data-sortable="sortable"\n\t\t\t\t\t\t\t data-total-portfolio-movers="totalPortfolioMovers"\n\t\t\t\t\t\t\t data-show-expander="{{showExpander}}"\n\t\t\t\t\t\t\t data-auto-expand-single="{{autoExpandSingle}}"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("accountsSummaryGrid/accountSummaryModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountsSummaryGrid/accountSummaryModal.tpl.html",'<div class="modal svi-directive svi-accounts-summary-container" data-backdrop-limit="1" tabindex="-1" role="dialog" id="{{id}}" aria-labelledby="portfolioValueChartModal">\n    <div class="modal-dialog modal-lg modal-dialog-centered" role="document">\n        <div class="modal-content">\n            <div class="modal-header">\n                <h1 id="accountSummaryModalTitle{{id}}"\n                    class="modal-title"\n                    data-ng-bind="title"></h1>\n                <div class="close dim glyphicon glyphicon-remove pointer"\n                     data-ng-click="api.hide()"\n                     data-dismiss="modal"\n                     role="button"\n                     tabindex="0"\n                     aria-label="Close"></div>\n            </div>\n            <div class="modal-body">\n                <div data-svi-account-summary-detail\n                     data-account="{{accountIndex}}"\n                     data-account-data="accountData"\n                     data-data-points="detailDatapoints"\n                     data-quick-links="quickLinks"></div>\n            </div>\n            <div class="modal-footer">\n                <button\n                        type="button"\n                        class="btn btn-primary"\n                        data-ng-click="api.hide()"\n                        data-dismiss="modal"\n                        data-ng-bind="labels.close"></button>\n            </div>\n        </div>\n    </div>\n</div>\n')}]),angular.module("accountSummaryDetail/accountSummaryDetail.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountSummaryDetail/accountSummaryDetail.tpl.html",'<div class="svi-directive svi-account-summary-detail"\n     data-svi-product-type-mgr\n     data-listen-event="PRODUCT_TYPE.CHANGED.ACCOUNT.SUMMARY.DETAIL"\n>\n    <div class="row">\n        <div class="col-md-8 col-xs-8 account-breadcrumb" data-ng-show="currentAccountData">\n            <div>\n                <b data-ng-bind="labels.account"></b>:\n                <span data-ng-bind="currentAccountData.account" data-ng-class="accountClasses" ></span>\n                <span data-ng-if="currentAccountData.nickname">&nbsp;|&nbsp;{{currentAccountData.nickname}}</span>\n                <span data-ng-if="currentAccountData.groups && currentAccountData.groups.length && shouldShowAccountLinks">&nbsp;|&nbsp; {{labels.groupName}}:&nbsp;\n                    <a href="javascript:void(0)" data-ng-repeat="group in currentAccountData.groups"\n                       data-ng-click="showGroupAccounts(group.id)">{{group.nickname}}<span data-ng-if="!$last">, </span></a>\n                </span>\n            </div>\n        </div>\n\n        <div class="col-md-4 col-xs-4 show-all-accounts" data-ng-if="shouldShowAccountLinks">\n            <a href="javascript:void(0)" data-ng-click="showAllAccounts()" data-ng-bind="labels.viewAllAccounts"></a>\n        </div>\n    </div>\n\n    <div class="datapoint-section" data-ng-show="accountData">\n        <div data-ng-class="defaultClasses">\n            <div class="datapoint-box text-center">\n                <div class="data-label" data-ng-bind="labels.cash"></div>\n                <span class="data-value" data-ng-bind="accountData.cash|sviCurrency"></span>\n            </div>\n        </div>\n        <div data-ng-class="defaultClasses">\n            <div class="datapoint-box text-center">\n                <div class="data-label" data-ng-bind="labels.totalMarketValue"></div>\n                <span class="data-value" data-ng-bind-html="accountData.marketValue|sviCurrency"></span>\n            </div>\n        </div>\n        <div data-ng-class="defaultClasses">\n            <div class="datapoint-box text-center">\n                <div class="data-label" data-ng-bind="labels.dayChange"></div>\n                <span class="data-value" data-ng-bind-html="accountData.marketValueChange|currencyIndicator"\n                      data-ng-class="{positive: totalPortfolioMovers.marketValueChange > 0, negative: totalPortfolioMovers.marketValueChange < 0}"></span>\n            </div>\n        </div>\n        <div data-ng-class="defaultClasses">\n            <div class="datapoint-box text-center">\n                <div class="data-label" data-ng-bind="labels.dayChangePct"></div>\n                <span class="data-value" data-ng-bind-html="accountData.percentChange|percentIndicator"\n                      data-ng-class="{positive: totalPortfolioMovers.percentChange > 0, negative: totalPortfolioMovers.percentChange < 0}"></span>\n            </div>\n        </div>\n    </div>\n\n    <div class="datapoint-section" data-ng-if="fields">\n        <div class="datapoint-container" data-ng-class="defaultClasses"\n             data-ng-show="balancesLoader.showSpinner || balancesLoader.shouldShowMessages()">\n            <div class="datapoint-box">\n                <div class="data-label" data-ng-bind="labels.balancesLoading"></div>\n                <div class="data-value" data-svi-loader data-callback="setBalancesLoader"\n                     data-ignore-invisible="true"></div>\n            </div>\n        </div>\n        <div class="datapoint-container" data-ng-class="defaultClasses"\n             data-ng-show="orderStatusLoader.showSpinner || orderStatusLoader.shouldShowMessages()">\n            <div class="datapoint-box">\n                <div class="data-label" data-ng-bind="labels.orderStatusLoading"></div>\n                <div class="data-value" data-svi-loader data-callback="setOrderStatusLoader"\n                     data-ignore-invisible="true"></div>\n            </div>\n        </div>\n        <div class="datapoint-container" data-ng-class="defaultClasses"\n             data-ng-show="incomeSummaryLoader.showSpinner || incomeSummaryLoader.shouldShowMessages()">\n            <div class="datapoint-box">\n                <div class="data-label" data-ng-bind="labels.incomeSummaryLoading"></div>\n                <div class="data-value" data-svi-loader data-callback="setIncomeSummaryLoader"\n                     data-ignore-invisible="true"></div>\n            </div>\n        </div>\n        <div class="datapoint-container" data-ng-class="defaultClasses"\n             data-ng-show="iraSummaryLoader.showSpinner || iraSummaryLoader.shouldShowMessages()">\n            <div class="datapoint-box">\n                <div class="data-label" data-ng-bind="labels.iraSummaryLoading"></div>\n                <div class="data-value" data-svi-loader data-callback="setIraSummaryLoader"\n                     data-ignore-invisible="true"></div>\n            </div>\n        </div>\n        <div class="datapoint-container" data-ng-class="defaultClasses"\n             data-ng-show="holdingsLoader.showSpinner || holdingsLoader.shouldShowMessages()">\n            <div class="datapoint-box">\n                <div class="data-label" data-ng-bind="labels.holdingsLoading"></div>\n                <div class="data-value" data-svi-loader data-callback="setHoldingsLoader"\n                     data-ignore-invisible="true"></div>\n            </div>\n        </div>\n        <div class="datapoint-container" data-ng-class="defaultClasses"\n             data-ng-show="projectedIncomeLoader.showSpinner || projectedIncomeLoader.shouldShowMessages()">\n            <div class="datapoint-box">\n                <div class="data-label" data-ng-bind="labels.projectedIncomeLoading"></div>\n                <div class="data-value" data-svi-loader data-callback="setProjectedIncomeLoader"\n                     data-ignore-invisible="true"></div>\n            </div>\n        </div>\n        <div data-ng-repeat="field in fields" class="datapoint-container"\n             data-ng-class="field.classes + \' \' + field.name" data-ng-show="getValue(field.name) !== null">\n            <div class="datapoint-box">\n                <div class="data-label" data-ng-bind="field.label"></div>\n                <div class="data-value" data-ng-bind="getValue(field.name)"></div>\n            </div>\n        </div>\n        <div class="datapoint-container" data-ng-class="defaultClasses" data-ng-repeat="detail in rcRows({})">\n            <div class="datapoint-box">\n                <div class="data-label" ng-bind="::detail.label"></div>\n                <div class="data-value" ng-bind-html="::detail.value"></div>\n            </div>\n        </div>\n    </div>\n\n    <div class="info-section svi-container" data-ng-class="financialAdvisorClasses">\n        <div class="financial-advisor-section" data-ng-if="myFA">\n            <div data-svi-my-financial-advisor data-template="Info" data-account="{{account}}"\n                 data-listener="*EMPTY*"></div>\n        </div>\n        <div class="trade-pricing-section" data-ng-if="tradePricing">\n            <div data-svi-trade-pricing></div>\n            <div data-svi-bonus-trades data-account="{{account}}" data-listener="*EMPTY*"></div>\n        </div>\n    </div>\n    <div class="quick-links-section" data-ng-class="quickLinksClasses" data-ng-if="quickLinks && quickLinks.length">\n        <h4 class="header-title" data-ng-bind="labels.wantTo"></h4>\n        <div data-svi-action-bar data-max-items="20" data-stacked="true" data-items="quickLinks"></div>\n    </div>\n</div>\n')}]),angular.module("iraContribution/iraContribution.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("iraContribution/iraContribution.tpl.html",'<div class="svi-directive svi-ira-contribution">\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div data-svi-visibility-group="{{visGroupId}}" data-svi-hide="!showIraContributionWidget">\n\t\t<div data-ng-show="iraSummaryData">\n\t\t\t<div data-svi-tabs data-ng-if="showPriorYear">\n\t\t\t\t<div class="item prior-year" data-tab-title="Prior Year">\n\t\t\t\t\t<h4 class="title iraContribTitle" data-ng-if="!iraContributionPYMaxed">{{labels.iraContributionMessageTitle}}</h4>\n\t\t\t\t\t<h4 class="title iraContribTitle" data-ng-if="iraContributionPYMaxed">{{labels.iraContributionMsgCongrats}}</h4>\n\t\t\t\t\t<p data-ng-if="!iraContributionPYMaxed">{{labels.iraContributionMessage}}</p>\n\t\t\t\t\t<div class="pbar-with-labels-container">\n\t\t\t\t\t\t<div class="progress">\n\t\t\t\t\t\t\t<div class="progress-bar" role="progressbar" aria-valuenow="{{precentagePriorYear}}" aria-valuemin="0" aria-valuemax="100" style="width: {{precentagePriorYear}}%;">\n\t\t\t\t\t\t\t\t<span>{{precentagePriorYear}}%</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class="pull-left ira-contrib-left">$0</span>\n\t\t\t\t\t\t<span class="pull-right ira-contrib-right">\n\t\t\t\t\t\t<span data-ng-bind="contributionLimitPriorYear|sviCurrency"></span>\n\t\t\t\t\t\t<span>&#42;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="contributed-text-center">\n\t\t\t\t\t\t<p>{{labels.iraContributionUpToDatePreTextPY}} <b data-ng-bind="contributionsPriorYear|sviCurrency"></b>\n\t\t\t\t\t\t\t<span data-ng-show="displayAccount"></br>to&#32;<b data-ng-bind="accountDisplay"></b></span>&#32;{{labels.iraContributionUpToDatePostTextPY}}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="pull-right" data-ng-show="contributeButtonlink">\n\t\t\t\t\t\t<button class="btn btn-primary btn-stretch-xs" data-ng-click="onClick(account)" data-ng-bind="labels.iraContributionButton" data-ng-disabled="iraContributionPYMaxed"></button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="pull-left ira-contrib-limits-bottom">\n\t\t\t\t\t\t<span>&#42;{{labels.iraContributionMax}} ({{priorYear}})</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="item current-year" data-tab-title="Current Year">\n\t\t\t\t\t<h4 class="title iraContribTitle" data-ng-if="!iraContributionCYMaxed">{{labels.iraContributionMessageTitle}}</h4>\n\t\t\t\t\t<h4 class="title iraContribTitle" data-ng-if="iraContributionCYMaxed">{{labels.iraContributionMsgCongrats}}</h4>\n\t\t\t\t\t<p data-ng-if="!iraContributionCYMaxed">{{labels.iraContributionMessage}}</p>\n\t\t\t\t\t<div class="pbar-with-labels-container">\n\t\t\t\t\t\t<div class="progress">\n\t\t\t\t\t\t\t<div class="progress-bar" role="progressbar" aria-valuenow="{{precentageCurrentYear}}" aria-valuemin="0" aria-valuemax="100" style="width: {{precentageCurrentYear}}%;">\n\t\t\t\t\t\t\t\t<span>{{precentageCurrentYear}}%</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class="pull-left ira-contrib-left">$0</span>\n\t\t\t\t\t\t<span class="pull-right ira-contrib-right">\n\t\t\t\t\t\t<span data-ng-bind="contributionLimitCurrentYear|sviCurrency"></span>\n\t\t\t\t\t\t<span>&#42;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="contributed-text-center">\n\t\t\t\t\t\t<p>{{labels.iraContributionUpToDatePreText}} <b data-ng-bind="contributionsCurrentYear|sviCurrency"></b>\n\t\t\t\t\t\t\t<span data-ng-show="displayAccount"></br>to&#32;<b data-ng-bind="accountDisplay"></b></span>&#32;{{labels.iraContributionUpToDatePostText}}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="pull-right" data-ng-show="contributeButtonlink">\n\t\t\t\t\t\t<button class="btn btn-primary btn-stretch-xs" data-ng-click="onClick(account)" data-ng-bind="labels.iraContributionButton" data-ng-disabled="iraContributionCYMaxed"></button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="pull-left ira-contrib-limits-bottom">\n\t\t\t\t\t\t<span>&#42;{{labels.iraContributionMax}} ({{currentYear}})</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div data-ng-if="!showPriorYear" class="current-year">\n\t\t\t\t<h4 class="title iraContribTitle" data-ng-if="!iraContributionCYMaxed">{{labels.iraContributionMessageTitle}}</h4>\n\t\t\t\t<h4 class="title iraContribTitle" data-ng-if="iraContributionCYMaxed">{{labels.iraContributionMsgCongrats}}</h4>\n\t\t\t\t<p data-ng-if="!iraContributionCYMaxed">{{labels.iraContributionMessage}}</p>\n\t\t\t\t<div class="pbar-with-labels-container">\n\t\t\t\t\t<div class="progress">\n\t\t\t\t\t\t<div class="progress-bar" role="progressbar" aria-valuenow="{{precentageCurrentYear}}" aria-valuemin="0" aria-valuemax="100" style="width: {{precentageCurrentYear}}%;">\n\t\t\t\t\t\t\t<span>{{precentageCurrentYear}}%</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class="pull-left ira-contrib-left">$0</span>\n\t\t\t\t\t<span class="pull-right ira-contrib-right">\n\t\t\t\t\t<span data-ng-bind="contributionLimitCurrentYear|sviCurrency"></span>\n\t\t\t\t\t<span>&#42;</span>\n\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div class="contributed-text-center">\n\t\t\t\t\t<p>{{labels.iraContributionUpToDatePreText}} <b data-ng-bind="contributionsCurrentYear|sviCurrency"></b>\n\t\t\t\t\t\t<span data-ng-show="displayAccount"></br>to&#32;<b data-ng-bind="accountDisplay"></b></span>&#32;{{labels.iraContributionUpToDatePostText}}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="pull-right" data-ng-show="contributeButtonlink">\n\t\t\t\t\t<button class="btn btn-primary btn-stretch-xs" data-ng-click="onClick(account)" data-ng-show="contributeButtonlink" data-ng-bind="labels.iraContributionButton" data-ng-disabled="iraContributionCYMaxed"></button>\n\t\t\t\t</div>\n\t\t\t\t<div class="pull-left ira-contrib-limits-bottom">\n\t\t\t\t\t<span>&#42;{{labels.iraContributionMax}} ({{currentYear}})</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("iraContribution/iraContributionWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("iraContribution/iraContributionWidget.tpl.html",'<div class="svi-directive svi-ira-contribution" data-svi-widget data-title="labels.iraContributionTitle"\n     data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div data-svi-loader data-callback="setLoader"></div>\n                    <div class="row">\n                        <div class="col-md-12">\n                            <div data-svi-visibility-group="{{visGroupId}}" data-svi-hide="!showIraContributionWidget">\n                                <div data-ng-show="iraSummaryData">\n                                    <div data-svi-tabs data-ng-if="showPriorYear">\n                                        <div class="item prior-year" data-tab-title="Prior Year">\n                                            <h4 class="title iraContribTitle" data-ng-if="!iraContributionPYMaxed">\n                                                {{labels.iraContributionMessageTitle}}</h4>\n                                            <h4 class="title iraContribTitle" data-ng-if="iraContributionPYMaxed">\n                                                {{labels.iraContributionMsgCongrats}}</h4>\n                                            <p data-ng-if="!iraContributionPYMaxed">\n                                                {{labels.iraContributionMessage}}</p>\n                                            <div class="pbar-with-labels-container">\n                                                <div class="progress">\n                                                    <div class="progress-bar" role="progressbar"\n                                                         aria-valuenow="{{precentagePriorYear}}" aria-valuemin="0"\n                                                         aria-valuemax="100" style="width: {{precentagePriorYear}}%;">\n                                                        <span>{{precentagePriorYear}}%</span>\n                                                    </div>\n                                                </div>\n                                                <span class="pull-left ira-contrib-left">$0</span>\n                                                <span class="pull-right ira-contrib-right">\n\t\t\t\t\t\t<span data-ng-bind="contributionLimitPriorYear|sviCurrency"></span>\n\t\t\t\t\t\t<span>&#42;</span>\n\t\t\t\t\t</span>\n                                            </div>\n                                            <div class="contributed-text-center">\n                                                <p>{{labels.iraContributionUpToDatePreTextPY}} <b\n                                                        data-ng-bind="contributionsPriorYear|sviCurrency"></b>\n                                                    <span data-ng-show="displayAccount"></br>to&#32;<b\n                                                            data-ng-bind="accountDisplay"></b></span>&#32;{{labels.iraContributionUpToDatePostTextPY}}\n                                                </p>\n                                            </div>\n                                            <div class="pull-right" data-ng-show="contributeButtonlink">\n                                                <button class="btn btn-primary btn-stretch-xs"\n                                                        data-ng-click="onClick(account)"\n                                                        data-ng-bind="labels.iraContributionButton"\n                                                        data-ng-disabled="iraContributionPYMaxed"></button>\n                                            </div>\n                                            <div class="pull-left ira-contrib-limits-bottom">\n                                                <span>&#42;{{labels.iraContributionMax}} ({{priorYear}})</span>\n                                            </div>\n                                        </div>\n                                        <div class="item current-year" data-tab-title="Current Year">\n                                            <h4 class="title iraContribTitle" data-ng-if="!iraContributionCYMaxed">\n                                                {{labels.iraContributionMessageTitle}}</h4>\n                                            <h4 class="title iraContribTitle" data-ng-if="iraContributionCYMaxed">\n                                                {{labels.iraContributionMsgCongrats}}</h4>\n                                            <p data-ng-if="!iraContributionCYMaxed">\n                                                {{labels.iraContributionMessage}}</p>\n                                            <div class="pbar-with-labels-container">\n                                                <div class="progress">\n                                                    <div class="progress-bar" role="progressbar"\n                                                         aria-valuenow="{{precentageCurrentYear}}" aria-valuemin="0"\n                                                         aria-valuemax="100" style="width: {{precentageCurrentYear}}%;">\n                                                        <span>{{precentageCurrentYear}}%</span>\n                                                    </div>\n                                                </div>\n                                                <span class="pull-left ira-contrib-left">$0</span>\n                                                <span class="pull-right ira-contrib-right">\n\t\t\t\t\t\t<span data-ng-bind="contributionLimitCurrentYear|sviCurrency"></span>\n\t\t\t\t\t\t<span>&#42;</span>\n\t\t\t\t\t</span>\n                                            </div>\n                                            <div class="contributed-text-center">\n                                                <p>{{labels.iraContributionUpToDatePreText}} <b\n                                                        data-ng-bind="contributionsCurrentYear|sviCurrency"></b>\n                                                    <span data-ng-show="displayAccount"></br>to&#32;<b\n                                                            data-ng-bind="accountDisplay"></b></span>&#32;{{labels.iraContributionUpToDatePostText}}\n                                                </p>\n                                            </div>\n                                            <div class="pull-right" data-ng-show="contributeButtonlink">\n                                                <button class="btn btn-primary btn-stretch-xs"\n                                                        data-ng-click="onClick(account)"\n                                                        data-ng-bind="labels.iraContributionButton"\n                                                        data-ng-disabled="iraContributionCYMaxed"></button>\n                                            </div>\n                                            <div class="pull-left ira-contrib-limits-bottom">\n                                                <span>&#42;{{labels.iraContributionMax}} ({{currentYear}})</span>\n                                            </div>\n                                        </div>\n                                    </div>\n                                    <div data-ng-if="!showPriorYear" class="current-year">\n                                        <h4 class="title iraContribTitle" data-ng-if="!iraContributionCYMaxed">\n                                            {{labels.iraContributionMessageTitle}}</h4>\n                                        <h4 class="title iraContribTitle" data-ng-if="iraContributionCYMaxed">\n                                            {{labels.iraContributionMsgCongrats}}</h4>\n                                        <p data-ng-if="!iraContributionCYMaxed">{{labels.iraContributionMessage}}</p>\n                                        <div class="pbar-with-labels-container">\n                                            <div class="progress">\n                                                <div class="progress-bar" role="progressbar"\n                                                     aria-valuenow="{{precentageCurrentYear}}" aria-valuemin="0"\n                                                     aria-valuemax="100" style="width: {{precentageCurrentYear}}%;">\n                                                    <span>{{precentageCurrentYear}}%</span>\n                                                </div>\n                                            </div>\n                                            <span class="pull-left ira-contrib-left">$0</span>\n                                            <span class="pull-right ira-contrib-right">\n\t\t\t\t\t<span data-ng-bind="contributionLimitCurrentYear|sviCurrency"></span>\n\t\t\t\t\t<span>&#42;</span>\n\t\t\t\t</span>\n                                        </div>\n                                        <div class="contributed-text-center">\n                                            <p>{{labels.iraContributionUpToDatePreText}} <b\n                                                    data-ng-bind="contributionsCurrentYear|sviCurrency"></b>\n                                                <span data-ng-show="displayAccount"></br>to&#32;<b\n                                                        data-ng-bind="accountDisplay"></b></span>&#32;{{labels.iraContributionUpToDatePostText}}\n                                            </p>\n                                        </div>\n                                        <div class="pull-right" data-ng-show="contributeButtonlink">\n                                            <button class="btn btn-primary btn-stretch-xs"\n                                                    data-ng-click="onClick(account)"\n                                                    data-ng-show="contributeButtonlink"\n                                                    data-ng-bind="labels.iraContributionButton"\n                                                    data-ng-disabled="iraContributionCYMaxed"></button>\n                                        </div>\n                                        <div class="pull-left ira-contrib-limits-bottom">\n                                            <span>&#42;{{labels.iraContributionMax}} ({{currentYear}})</span>\n                                        </div>\n                                    </div>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("iraSummary/iraSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("iraSummary/iraSummary.tpl.html",'<div class="svi-directive ira-summary">\n\t<h3 class="title">{{labels.iraSummaryTitle}}\n\t\t<a class="showMore" href="" data-ng-click="showMore()">(more...)</a>\n\t\t<div data-ng-if="yearDropdown" class="title-button pull-right" data-svi-filter-dropdown\n\t\t\t data-event-id="IRA_SUMMARY.YEAR"\n\t\t\t data-state-id="iraSummary-year"\n\t\t\t data-selected="{{year}}"\n\t\t\t data-options="{{yearDropdown}}"></div>\n\t</h3>\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div data-ng-if="iraSummary">\n\t\t<dl class="dl-horizontal col-md-12 col-sm-12 col-xs-12">\n\t\t\t<dt data-ng-bind="labels.iraSummaryContributions" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t<dd data-ng-if="year == \'current\'" data-ng-bind="iraSummary.totalContributionsCurrentYear|sviCurrency" class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t\t<dd data-ng-if="year == \'prior\'" data-ng-bind="iraSummary.totalContributionsPriorYear|sviCurrency"  class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t\t<dt data-ng-bind="labels.iraSummaryDistributions" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t<dd data-ng-if="year == \'current\'" data-ng-bind="iraSummary.totalDistributionsCurrentYear|sviCurrency" class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t\t<dd data-ng-if="year == \'prior\'" data-ng-bind="iraSummary.totalDistributionsPriorYear|sviCurrency" class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t</dl>\n\t\t<div class="ira-summary-modal modal fade" tabindex="-1" role=dialog aria-labelledby="iraSummaryModal">\n\t\t\t<div class="modal-dialog modal-md" role="document">\n\t\t\t\t<div class="modal-content pull-left">\n\t\t\t\t\t<div class="modal-header">\n\t\t\t\t\t\t<h1 class="title" data-ng-bind="labels.iraSummaryTitle"></h1>\n\t\t\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="hideMore()" aria-label="Close"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="modal-body">\n\t\t\t\t\t\t<h3 data-ng-bind="labels.iraContributionSummary"></h3>\n\t\t\t\t\t\t<table class="table table-striped">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th>&nbsp;<span class="svi-visually-hidden">Empty header cell</span></th>\n\t\t\t\t\t\t\t\t\t<th class="currency" data-ng-bind="labels.currentYear"></th>\n\t\t\t\t\t\t\t\t\t<th class="currency" data-ng-bind="labels.priorYear"></th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td data-ng-bind="labels.iraSummaryContributions"></td>\n\t\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.contributionsCurrentYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.contributionsPriorYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr data-ng-if="!(hideNullable == true && iraSummary.rolloversCurrentYear == 0 && iraSummary.rolloversPriorYear == 0)">\n\t\t\t\t\t\t\t\t\t<td data-ng-bind="labels.iraSummaryRollovers"></td>\n\t\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.rolloversCurrentYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.rolloversPriorYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t<tfoot>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class="total" data-ng-bind="labels.iraContributionSummaryTotal"></td>\n\t\t\t\t\t\t\t\t\t<td class="total currency" data-ng-bind="iraSummary.totalContributionsCurrentYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t\t<td class="total currency" data-ng-bind="iraSummary.totalContributionsPriorYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tfoot>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<div class="contribution-limit" data-ng-if="::showContributionLimit">\n\t\t\t\t\t\t\t{{ labels.iraSummaryContributionLimit }}: <span class="currency pull-right" data-ng-bind="iraSummary.contributionLimitCurrentYear|sviCurrency"></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<h3 data-ng-bind="labels.iraDistributionSummary"></h3>\n\t\t\t\t\t\t<table class="table table-striped">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th>&nbsp;<span class="svi-visually-hidden">Empty header cell</span></th>\n\t\t\t\t\t\t\t\t<th class="currency" data-ng-bind="labels.currentYear"></th>\n\t\t\t\t\t\t\t\t<th class="currency" data-ng-bind="labels.priorYear"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td data-ng-bind="labels.iraSummaryDistributions"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.distributionsCurrentYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.distributionsPriorYear|sviCurrency"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr data-ng-if="::showTaxWithholding && !(hideNullable == true && iraSummary.federalTaxCurrentYear == 0 && iraSummary.federalTaxPriorYear == 0)">\n\t\t\t\t\t\t\t\t<td data-ng-bind="labels.iraFedTaxWithholding"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.federalTaxCurrentYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.federalTaxPriorYear|sviCurrency"></td>\n\n\t\t\t\t\t\t\t<tr data-ng-if="::showTaxWithholding && !(hideNullable == true && iraSummary.stateTaxCurrentYear == 0 && iraSummary.stateTaxPriorYear == 0)">\n\t\t\t\t\t\t\t\t<td data-ng-bind="labels.iraStateTaxWithholding"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.stateTaxCurrentYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind="iraSummary.stateTaxPriorYear|sviCurrency"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t<tfoot>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td class="total" data-ng-bind="labels.iraDistributionSummaryTotal"></td>\n\t\t\t\t\t\t\t\t<td class="total currency" data-ng-bind="iraSummary.totalDistributionsCurrentYear|sviCurrency"></td>\n\t\t\t\t\t\t\t\t<td class="total currency" data-ng-bind="iraSummary.totalDistributionsPriorYear|sviCurrency"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tfoot>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="modal-footer" data-ng-if="::showContributionLimit == true">\n\t\t\t\t\t\t<p data-ng-bind-html="labels.iraSummaryDisclaimer"></p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("myFinancialAdvisor/myFinancialAdvisor.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("myFinancialAdvisor/myFinancialAdvisor.tpl.html",'<div class="svi-directive svi-my-financial-advisor" data-svi-widget data-title="labels.advisorTitle">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group with-border">\n\t\t\t\t<li class="list-group-item" data-ng-if="advisorInfo.name || advisorInfo.company || advisorInfo.title">\n\t\t\t\t\t<div class="strong" data-ng-if="advisorInfo.name" data-ng-bind="advisorInfo.name"></div>\n\t\t\t\t\t<div class="strong" data-ng-if="advisorInfo.name2" data-ng-bind="advisorInfo.name2"></div>\n\t\t\t\t\t<div class="strong" data-ng-if="advisorInfo.name3" data-ng-bind="advisorInfo.name3"></div>\n\t\t\t\t\t<div class="strong" data-ng-if="advisorInfo.company" data-ng-bind="advisorInfo.company"></div>\n\t\t\t\t\t<div class="text" data-ng-if="advisorInfo.title" data-ng-bind="advisorInfo.title"></div>\n\t\t\t\t\t<div class="text" data-ng-if="advisorInfo.title2" data-ng-bind="advisorInfo.title2"></div>\n\t\t\t\t</li>\n\t\t\t\t<li class="list-group-item" data-ng-if="advisorInfo.email || advisorInfo.url">\n\t\t\t\t\t<i class="glyphicon glyphicon-envelope pull-left"></i>\n\t\t\t\t\t<div><a data-ng-href="mailto:{{ advisorInfo.email }}" data-ng-if="advisorInfo.email" target="_blank">{{ labels.advisorEmail }}</a></div>\n\t\t\t\t\t<div><a data-ng-href="{{ advisorInfo.url }}" data-ng-if="advisorInfo.url" target="_blank">{{ labels.advisorWeb }}</a></div>\n\t\t\t\t</li>\n\t\t\t\t<li class="list-group-item" data-ng-if="advisorInfo.phone || advisorInfo.tollFree">\n\t\t\t\t\t<i class="glyphicon glyphicon-earphone pull-left"></i>\n\t\t\t\t\t<div class="strong" data-ng-if="advisorInfo.phone" data-ng-bind="labels.advisorPhone1"></div>\n\t\t\t\t\t<div class="text" data-ng-if="advisorInfo.phone" data-ng-bind="advisorInfo.phone"></div>\n\t\t\t\t\t<div class="strong" data-ng-if="advisorInfo.tollFree" data-ng-bind="labels.advisorPhone2"></div>\n\t\t\t\t\t<div class="text" data-ng-if="advisorInfo.tollFree" data-ng-bind="advisorInfo.tollFree"></div>\n\t\t\t\t</li>\n\t\t\t\t<li class="list-group-item" data-ng-if="advisorInfo.address || advisorInfo.city || advisorInfo.state || advisorInfo.zip || advisorInfo.mapLink">\n\t\t\t\t\t<i class="glyphicon glyphicon-map-marker pull-left"></i>\n\t\t\t\t\t<div class="strong" data-ng-if="advisorInfo.address || advisorInfo.city || advisorInfo.state || advisorInfo.zip" data-ng-bind="labels.advisorLocation"></div>\n\t\t\t\t\t<div class="text" data-ng-repeat="line in advisorInfo.address track by $index" data-ng-if="line.length" data-ng-bind="line"></div>\n\t\t\t\t\t<div class="text" data-ng-if="advisorInfo.city || advisorInfo.state || advisorInfo.zip">{{ advisorInfo.city }}&nbsp;{{ advisorInfo.state }}&nbsp;{{ advisorInfo.zip }}</div>\n\t\t\t\t\t<div class="strong" data-ng-if="advisorInfo.mapLink" data-ng-bind="labels.advisorMap"></div>\n\t\t\t\t\t<div class="text" data-ng-if="advisorInfo.mapLink" data-ng-bind="advisorInfo.mapLink"></div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("myFinancialAdvisor/myFinancialAdvisorInfo.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("myFinancialAdvisor/myFinancialAdvisorInfo.tpl.html",'<div class="svi-directive svi-my-financial-advisor">\n    <div data-svi-loader data-callback="api.getLoader" data-ignore-invisible="true"></div>\n    <div class="row adviser-block" data-ng-show="advisorInfo">\n        <div class="col-md-12">\n            <h4 class="header-title" data-ng-bind="labels.getAdvisedTitle"></h4>\n            <div class="advisor-name" data-ng-bind="advisorInfo.name"></div>\n        </div>\n        <div class="col-lg-4 col-md-4 col-sm-2 col-xs-2" data-ng-if="advisorInfo.imageUrl">\n            <div class="logo-wrapper"><img src="{{advisorInfo.imageUrl}}" alt="Advisor logo" width="80%"></div>\n        </div>\n        <div class="col-lg-4 col-md-4 col-sm-5 col-xs-5 info-block">\n            <div class="strong" data-ng-if="advisorInfo.phone" data-ng-bind="labels.advisorCallCenter"></div>\n            <div class="text" data-ng-if="advisorInfo.phone" data-ng-bind="advisorInfo.phone"></div>\n            <div class="strong" data-ng-if="advisorInfo.tollFree" data-ng-bind="labels.advisorPhone2"></div>\n            <div class="text" data-ng-if="advisorInfo.tollFree" data-ng-bind="advisorInfo.tollFree"></div>\n        </div>\n        <div class="col-lg-4 col-md-4 col-sm-5 col-xs-5 info-block">\n            <div class="strong" data-ng-if="advisorInfo.address || advisorInfo.city || advisorInfo.state || advisorInfo.zip" data-ng-bind="labels.advisorAddressTitle"></div>\n            <div class="text" data-ng-repeat="line in advisorInfo.address track by $index" data-ng-if="line.length" data-ng-bind="line"></div>\n            <div class="text" data-ng-if="advisorInfo.city || advisorInfo.state || advisorInfo.zip">{{ advisorInfo.city }}&nbsp;{{ advisorInfo.state }}&nbsp;{{ advisorInfo.zip }}</div>\n            <div class="strong" data-ng-if="advisorInfo.mapLink" data-ng-bind="labels.advisorMap"></div>\n            <div class="text" data-ng-if="advisorInfo.mapLink" data-ng-bind="advisorInfo.mapLink"></div>\n        </div>\n    </div>\n</div>')}]),angular.module("templates-assetAllocation",["assetAllocation/assetAllocation.tpl.html","assetAllocation/assetAllocationWidget.tpl.html","assetAllocationBalances/assetAllocationBalances.tpl.html","assetAllocationByAccount/assetAllocationByAccount.tpl.html"]),angular.module("assetAllocation/assetAllocation.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("assetAllocation/assetAllocation.tpl.html",'<div class="svi-directive svi-asset-allocation asset-allocation-overview" id="{{::id}}">\n\t<h3 class="title" data-ng-if="title" data-ng-bind="title"></h3>\n\t<div data-ng-if="assetClassificationConfig" class="filters" data-ng-show="assetClassificationEnabled && assetClassificationFilterShow">\n\t\t<div data-svi-filter-dropdown\n\t\t\t data-dropdown-class="dropdown-menu-right"\n\t\t\t data-event-id="ASSET_OVERVIEW.BY_ASSET_CLASSIFICATION"\n\t\t\t data-options="{{ assetClassificationConfig.assetClassificationTypeFilter }}"\n\t\t\t data-state-id="assetOverview-assetClassificationType"\n\t\t\t data-selected="{{ assetClassificationConfig.assetClassificationTypeDefault }}"\n\t\t\t data-title="{{ assetClassificationConfig.assetClassificationTypeLabel }}"></div>\n\t</div>\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div class="chart-wrapper">\n\t\t<div class="chart-inner">\n\t\t\t<a class="svi-visually-hidden" data-svi-skip-link="#{{::id}}-table">Skip to chart\'s table for detailed information.</a>\n\t\t\t<div class="chart"></div>\n\t\t\t<div class="chart-note" data-ng-show="chart" data-ng-bind="labels.assetChartNoNegative"></div>\n\t\t</div>\n\t</div>\n\t<div id="{{::id}}-table" class="table-wrapper" data-ng-class="assetClassificationType" data-ng-show="assets && assets.length > 0 && !currentPoint">\n\t\t<table class="table table-striped">\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th class="svi-visually-hidden"></th>\n\t\t\t\t<th class="svi-visually-hidden" data-ng-bind="labels.investmentType"></th>\n\t\t\t\t<th class="svi-visually-hidden" data-ng-bind="labels.marketValuePctTotal"></th>\n\t\t\t\t<th class="svi-visually-hidden" data-ng-bind="labels.marketValue"></th>\n\t\t\t</tr>\t\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat="asset in assets">\n\t\t\t\t<td data-ng-style="{\'background-color\':asset.legendColor}"></td>\n\t\t\t\t<td role="rowheader" data-ng-bind="asset.assetType | labels:labels"></td>\n\t\t\t\t<td data-ng-bind="asset.pctValue|percent:2"></td>\n\t\t\t\t<td data-ng-bind="asset.marketValue|sviCurrency:null:null:2" class="currency"></td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\t<div class="table-wrapper" data-ng-class="assetClassificationType" data-ng-repeat="assetType in assetTypes" data-ng-show="assets && assets.length > 0 && currentPoint.id == assetType.id">\n\t\t<table data-ng-if="assetTypes" class="table table-striped">\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th class="svi-visually-hidden"></th>\n\t\t\t\t<th class="svi-visually-hidden" data-ng-bind="labels.investmentType"></th>\n\t\t\t\t<th class="svi-visually-hidden" data-ng-bind="labels.marketValuePctTotal"></th>\n\t\t\t\t<th class="svi-visually-hidden" data-ng-bind="labels.marketValue"></th>\n\t\t\t</tr>\t\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td data-ng-style="{\'background-color\':assetType.legendColor}"></td>\n\t\t\t\t<td role="rowheader" data-ng-bind="assetType.name"></td>\n\t\t\t\t<td data-ng-bind="assetType.pctValue|percent:2"></td>\n\t\t\t\t<td data-ng-bind="assetType.marketValue|sviCurrency:null:null:2" class="currency"></td>\n\t\t\t</tr>\n\t\t\t<tr data-ng-repeat="security in assetType.securities">\n\t\t\t\t<td></td>\n\t\t\t\t<td role="rowheader" data-ng-bind="security.symbol"></td>\n\t\t\t\t<td data-ng-bind="security.pctValue|percent:2"></td>\n\t\t\t\t<td data-ng-bind="security.marketValue|sviCurrency:null:null:2" class="currency"></td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>')}]),angular.module("assetAllocation/assetAllocationWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("assetAllocation/assetAllocationWidget.tpl.html",'<div class="svi-directive svi-asset-allocation asset-allocation-overview" id="{{::id}}" data-svi-widget data-title="title" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div data-svi-loader data-callback="setLoader"></div>\n                    <div class="row" data-ng-if="assetClassificationConfig"\n                         data-ng-show="assetClassificationEnabled && assetClassificationFilterShow">\n                        <div class="col-md-12">\n                            <div class="filters">\n                                <div data-svi-filter-dropdown\n                                     data-dropdown-class="dropdown-menu-right"\n                                     data-event-id="ASSET_OVERVIEW.BY_ASSET_CLASSIFICATION"\n                                     data-options="{{ assetClassificationConfig.assetClassificationTypeFilter }}"\n                                     data-state-id="assetOverview-assetClassificationType"\n                                     data-selected="{{ assetClassificationConfig.assetClassificationTypeDefault }}"\n                                     data-title="{{ assetClassificationConfig.assetClassificationTypeLabel }}"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div class="chart-wrapper">\n                        <div class="chart-inner">\n                        \t<a class="svi-visually-hidden" data-svi-skip-link="#{{::id}}-table">Skip to chart\'s table for detailed information.</a>\n                            <div class="chart"></div>\n                            <div class="chart-note" data-ng-show="chart"\n                                 data-ng-bind="labels.assetChartNoNegative"></div>\n                        </div>\n                    </div>\n                    <div id="{{::id}}-table" class="table-wrapper" data-ng-class="assetClassificationType"\n                         data-ng-show="assets && assets.length > 0 && !currentPoint">\n                        <table class="table table-striped">\n                            <thead>\n                            <tr>\n                                <th class="svi-visually-hidden"></th>\n                                <th class="svi-visually-hidden" data-ng-bind="labels.investmentType"></th>\n                                <th class="svi-visually-hidden" data-ng-bind="labels.marketValuePctTotal"></th>\n                                <th class="svi-visually-hidden" data-ng-bind="labels.marketValue"></th>\n                            </tr>\n                            </thead>\n                            <tbody>\n                            <tr data-ng-repeat="asset in assets">\n                                <td data-ng-style="{\'background-color\':asset.legendColor}"></td>\n                                <td role="rowheader" data-ng-bind="asset.assetType | labels:labels"></td>\n                                <td data-ng-bind="asset.pctValue|percent:2"></td>\n                                <td data-ng-bind="asset.marketValue|sviCurrency:null:null:2" class="currency"></td>\n                            </tr>\n                            </tbody>\n                        </table>\n                    </div>\n                    <div class="table-wrapper" data-ng-class="assetClassificationType"\n                         data-ng-repeat="assetType in assetTypes"\n                         data-ng-show="assets && assets.length > 0 && currentPoint.id == assetType.id">\n                        <table data-ng-if="assetTypes" class="table table-striped">\n                            <thead>\n                            <tr>\n                                <th class="svi-visually-hidden"></th>\n                                <th class="svi-visually-hidden" data-ng-bind="labels.investmentType"></th>\n                                <th class="svi-visually-hidden" data-ng-bind="labels.marketValuePctTotal"></th>\n                                <th class="svi-visually-hidden" data-ng-bind="labels.marketValue"></th>\n                            </tr>\n                            </thead>\n                            <tbody>\n                            <tr>\n                                <td data-ng-style="{\'background-color\':assetType.legendColor}"></td>\n                                <td role="rowheader" data-ng-bind="assetType.name"></td>\n                                <td data-ng-bind="assetType.pctValue|percent:2"></td>\n                                <td data-ng-bind="assetType.marketValue|sviCurrency:null:null:2" class="currency"></td>\n                            </tr>\n                            <tr data-ng-repeat="security in assetType.securities">\n                                <td></td>\n                                <td role="rowheader" data-ng-bind="security.symbol"></td>\n                                <td data-ng-bind="security.pctValue|percent:2"></td>\n                                <td data-ng-bind="security.marketValue|sviCurrency:null:null:2" class="currency"></td>\n                            </tr>\n                            </tbody>\n                        </table>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n')}]),angular.module("assetAllocationBalances/assetAllocationBalances.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("assetAllocationBalances/assetAllocationBalances.tpl.html",'<div class="svi-directive svi-asset-allocation-balances" data-ng-show="show" id="{{::id}}">\n\t<h3><span data-ng-bind="title || \'Total\'"></span><span data-ng-bind="total"></span></h3>\n\t<div data-svi-loader data-callback="setLoader" data-ignore-invisible="true"></div>\n\t<div class="chart-wrapper ng-cloak" data-ng-cloak>\n\t\t<div class="chart-inner">\n\t\t\t<a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n\t\t\t<div class="chart" data-ng-show="seriesData.length"></div>\n\t\t\t<div class="alert alert-info" data-ng-show="!loader.showSpinner && !seriesData.length" data-ng-bind="labels.chartNoData"></div>\n\t\t\t<div class="chart-note" data-ng-show="!loader.showSpinner && longOrShort != \'short\'" data-ng-bind="labels.assetChartNoNegative"></div>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("assetAllocationByAccount/assetAllocationByAccount.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("assetAllocationByAccount/assetAllocationByAccount.tpl.html",'<div class="svi-directive svi-asset-allocation-by-account">\n\t<h3 ng-bind="title"></h3>\n    <div class="spinner" ng-show="showSpinner"><i class="fa fa-2x fa-spinner fa-spin"></i> Loading...</div>\n\t<div class="chart" ng-bind="message"></div>\n</div>')}]),angular.module("templates-balances",["accountBalance/accountBalance.tpl.html","accountBalance/accountBalanceWidget.tpl.html","accountBalanceValue/accountBalanceValue.tpl.html","balanceListContainer/balanceListContainer.tpl.html","balanceListContainer/balanceListContainerWidget.tpl.html","buyingPower/buyingPower.tpl.html","cashFlowContainer/cashFlowContainer.tpl.html","incomeExpenseSummary/incomeExpenseSummary.tpl.html","incomeInformation/incomeInformation.tpl.html"]),angular.module("accountBalance/accountBalance.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountBalance/accountBalance.tpl.html",'<div class="svi-directive svi-account-balance">\n\t<h3 class="title" data-ng-bind="labels.accountBalanceTitle"></h3>\n\t<div data-svi-loader></div>\n\t<div data-ng-if="!useTradingBalances && balance">\n\t\t<div>\n\t\t\t<dl class="dl-horizontal col-md-12 col-sm-12 col-xs-12">\n\t\t\t\t<dt data-ng-bind="labels.totalCash" class="total col-md-6 col-sm-6 col-xs-7"></dt>\n\t\t\t\t<dd data-ng-bind="balance.accountBalance.money.total|sviCurrency" class="total col-md-6 col-sm-6 col-xs-5"></dd>\n\t\t\t\t<dt data-ng-bind="labels.cash" data-ng-if="showCashAndMmf" class="col-md-6 col-sm-6 col-xs-7"></dt>\n\t\t\t\t<dd data-ng-bind="balance.accountBalance.money.cash|sviCurrency" data-ng-if="showCashAndMmf" class="col-md-6 col-sm-6 col-xs-5"></dd>\n\t\t\t\t<dt data-ng-bind="labels.mmf" data-ng-if="showCashAndMmf && balance.accountBalance.money.mmf > 0" class="col-md-6 col-sm-6 col-xs-7"></dt>\n\t\t\t\t<dd data-ng-bind="balance.accountBalance.money.mmf|sviCurrency" data-ng-if="showCashAndMmf && balance.accountBalance.money.mmf > 0" class="col-md-6 col-sm-6 col-xs-5"></dd>\n\t\t\t\t<dt data-ng-bind="labels.bankDepositProgram" data-ng-if="showBankDepositProgram && balance.accountBalance.money.bankDepositProgram != 0" class="col-md-6 col-sm-6 col-xs-7"></dt>\n\t\t\t\t<dd data-ng-bind="balance.accountBalance.money.bankDepositProgram|sviCurrency" data-ng-if="showBankDepositProgram && balance.accountBalance.money.bankDepositProgram != 0" class="col-md-6 col-sm-6 col-xs-5"></dd>\n\t\t\t\t<dt data-ng-bind="labels.optionReq" data-ng-if="balance.accountBalance.requirements != null" class="col-md-6 col-sm-6 col-xs-7"></dt>\n\t\t\t\t<dd data-ng-bind="balance.accountBalance.requirements.optionMarginRequirement|sviCurrency" data-ng-if="balance.accountBalance.requirements != null" class="col-md-6 col-sm-6 col-xs-5"></dd>\n\t\t\t\t<dt data-ng-bind="labels.totalSecurities" class="total col-md-6 col-sm-6 col-xs-7"></dt>\n\t\t\t\t<dd data-ng-bind="balance.accountBalance.securities.total|sviCurrency" class="total col-md-6 col-sm-6 col-xs-5"></dd>\n\t\t\t\t<dt data-ng-if="hasHeldAway && showHeldAway" data-ng-bind="labels.totalHeldAway" class="heldAway total col-md-6 col-sm-6 col-xs-7"></dt>\n\t\t\t\t<dd data-ng-if="hasHeldAway && showHeldAway" data-ng-bind="(balance.accountBalance.heldAway.totalCashEquiv + balance.accountBalance.heldAway.rtTotMarketValue)|sviCurrency" class="heldAway total col-md-6 col-sm-6 col-xs-5"></dd>\n\t\t\t</dl>\n\t\t\t<div data-ng-if="hasHeldAway && showHeldAway" class="heldAway disclaimer" data-ng-bind="labels.balancesHeldAwayDisclaimer"></div>\n\t\t</div>\n\t</div>\n</div>\n\n')}]),angular.module("accountBalance/accountBalanceWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountBalance/accountBalanceWidget.tpl.html",'<div class="svi-directive svi-account-balance" data-svi-widget data-title="labels.accountBalanceTitle">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item" data-ng-if="useTradingBalances && balance">\n\t\t\t\t\t<table class="table table-striped svi-account-balance-table">\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr data-ng-if="showAccountValue">\n\t\t\t\t\t\t\t<th data-ng-bind="labels.accountBalanceAccountValue"></th>\n\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="balance.accountValue|sviCurrency"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr data-ng-if="showCashMmf">\n\t\t\t\t\t\t\t<th data-ng-bind="labels.accountBalanceCashMmf"></th>\n\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="balance.cashMmfBalance|sviCurrency"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr data-ng-if="showCashEquiv">\n\t\t\t\t\t\t\t<th data-ng-bind="labels.accountBalanceCashEquiv"></th>\n\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="balance.cashEquiv|sviCurrency"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr data-ng-if="showSecurities">\n\t\t\t\t\t\t\t<th data-ng-bind="labels.accountBalanceSecurities"></th>\n\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="balance.securities|sviCurrency"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr data-ng-if="showStockBuyingPower && !balance.cashOnly">\n\t\t\t\t\t\t\t<th data-ng-bind="labels.accountBalanceStockBuyingPower"></th>\n\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="balance.stockBuyingPower|sviCurrency"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr data-ng-if="showOptionBuyingPower && !balance.cashOnly">\n\t\t\t\t\t\t\t<th data-ng-bind="labels.accountBalanceOptionBuyingPower"></th>\n\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="balance.optionsBuyingPower|sviCurrency"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n\t<svi:widget-shortcuts>\n\t\t<span data-ng-if="::showDetailsLink" class="more-icon fas fa-external-link-alt" data-ng-click="api.more()" title="{{labels.moreTooltip}}" role="button" aria-label="{{labels.accountBalanceTitle}} {{labels.moreTooltip}}"></span>\n\t</svi:widget-shortcuts>\n</div>')}]),angular.module("accountBalanceValue/accountBalanceValue.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountBalanceValue/accountBalanceValue.tpl.html",'<div class="svi-directive svi-account-balance-value">\n    <div data-svi-loader data-callback="setLoader"></div>\n    <div data-ng-show="loaded">\n        <dl data-ng-class="marginEnabled ? \'col-xs-12 col-md-6\' : \'col-md-12\'" class="total-account-value" data-ng-show="loaded">\n            <dt data-ng-bind="labels.totalAccountValue"></dt>\n            <dd data-ng-bind="balance.accountBalance.accountValue|sviCurrency"></dd>\n        </dl>\n       \t<dl class="margin-debit col-xs-12 col-md-6" data-ng-show="loaded" data-ng-if="marginEnabled">\n            <dt data-ng-bind="labels.marginDebit"></dt>\n            <dd data-ng-bind="balance.accountBalance.money.marginBalance|sviCurrency"></dd>\n        </dl>\n        <hr/>\n        <div class="viewActivities col-sm-3" data-ng-if="::activitiesUrl">\n            <a href="{{::activitiesUrl}}">View Account Activity</a>\n        </div>\n    </div>\n</div>')}]),angular.module("balanceListContainer/balanceListContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("balanceListContainer/balanceListContainer.tpl.html",'<div class="svi-directive svi-balance-list-container">\n\t<h3 class="title" data-ng-if="labels.balanceListTitle" data-ng-bind="labels.balanceListTitle"></h3>\n\t<div class="row"><div class="col-md-12" data-svi-loader data-callback="setLoader"></div></div>\n\t<div class="row" data-ng-show="balances">\n\t\t<div data-svi-balance-list-grid class="col-md-12"\n\t\t\t data-columns="columns"\n\t\t\t data-custom-classes="customClasses"\n\t\t\t data-sort-field="sortField"\n\t\t\t data-sort-dir="sortDir"\n\t\t\t data-sortable="sortable"\n\t\t\t data-account-url="accountUrl"\n\t\t\t data-balances="balances"></div>\n\t</div>\n</div>')}]),angular.module("balanceListContainer/balanceListContainerWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("balanceListContainer/balanceListContainerWidget.tpl.html",'<div class="svi-directive svi-balance-list-container" data-svi-widget data-title="labels.balanceListTitle">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<div class="list-group-item" data-ng-show="balances">\n\t\t\t\t\t<div data-svi-balance-list-grid\n\t\t\t\t\t\t\t data-columns="columns"\n\t\t\t\t\t\t\t data-sort-field="sortField"\n\t\t\t\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t\t\t\t data-sortable="sortable"\n\t\t\t\t\t\t\t data-account-url="accountUrl"\n\t\t\t\t\t\t\t data-balances="balances"\n\t\t\t\t\t\t\t data-owned-account="ownedAccount"\n\t\t\t\t\t\t\t data-owned-disclaimer="ownedDisclaimer"\n\t\t\t\t\t\t\t data-owned-tooltip="ownedTooltip"\n\t\t\t\t\t\t\t data-owned-totals-tooltip="ownedTotalsTooltip"\n\t\t\t\t\t\t\t data-custom-classes="customClasses"\n\t\t\t\t\t></div>\n\t\t\t\t</div>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("buyingPower/buyingPower.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("buyingPower/buyingPower.tpl.html",'<div class="svi-directive buying-power">\n\t<h3 class="title" data-ng-bind="labels.buyingPowerTitle"></h3>\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div data-ng-show="loaded">\n\t\t<div>\n\t\t\t<dl class="dl-horizontal col-md-12 col-sm-12 col-xs-12">\n\t\t\t\t<dt data-ng-if="showStockBuyingPower" data-ng-bind="labels.stockBuyingPower" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t\t<dd data-ng-if="showStockBuyingPower" data-ng-bind="balance.accountBalance.buyingPower.stock|sviCurrency" class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t\t\t<dt data-ng-if="balance.accountBalance.buyingPower.daytrading > 0 && showOldDayTrading" data-ng-bind="labels.daytradingBuyingPower" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t\t<dd data-ng-if="balance.accountBalance.buyingPower.daytrading > 0 && showOldDayTrading" data-ng-bind="balance.accountBalance.buyingPower.daytrading|sviCurrency" class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t\t\t<dt data-ng-if="showNonMarginBuyingPower" data-ng-bind="labels.optionBuyingPower" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t\t<dd data-ng-if="showNonMarginBuyingPower" data-ng-bind="balance.accountBalance.buyingPower.options|sviCurrency" class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t\t\t<dt data-ng-if="optionLevelValue != null && showOptiontradinglevel" data-ng-bind="labels.optionLevel" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t\t<dd data-ng-if="optionLevelValue != null && showOptiontradinglevel" class="col-md-6 col-sm-6 col-xs-6">{{labels.optionLevelLevel}} {{optionLevelValue}} - <span data-ng-bind="optionLevelValue|optionLevel:labels"></span></dd>\n\t\t\t\t<dt data-ng-bind="labels.equityPercentage" data-ng-if="marginEnabled" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t\t<dd data-ng-bind-html="balance.accountBalance.buyingPower.equityPercentage|percent:0" data-ng-if="marginEnabled" class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t\t\t<dt data-ng-bind="labels.marginEnabled" data-ng-if="marginEnabled" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t\t<dd data-ng-if="marginEnabled" class="col-md-6 col-sm-6 col-xs-6">Yes</dd>\n\t\t\t\t<dt data-ng-if="showDayTrading" data-ng-bind="labels.daytradingBuyingPower" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t\t<dd data-ng-if="showDayTrading" data-ng-bind="balance.accountBalance.buyingPower.daytrading|sviCurrency" class="col-md-6 col-sm-6 col-xs-6"></dd>\n\t\t\t\t<dt data-ng-if="showPatternDayTrader" data-ng-bind="labels.patternDayTraderStatus" class="col-md-6 col-sm-6 col-xs-6"></dt>\n\t\t\t\t<dd data-ng-if="showPatternDayTrader" class="col-md-6 col-sm-6 col-xs-6">Yes</dd>\n\t\t\t</dl>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("cashFlowContainer/cashFlowContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("cashFlowContainer/cashFlowContainer.tpl.html",'<div class="row svi-directive svi-cash-flow-container">\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<div class="col-md-12" data-ng-show="cashFlow">\n\t\t<div class="row">\n\t\t\t<div class="col-md-12" data-svi-cash-flow-grid\n\t\t\t\tdata-columns="columns"\n\t\t\t\tdata-column-priority="columnPriority"\n\t\t\t\tdata-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\tdata-cash-flow="cashFlow"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("incomeExpenseSummary/incomeExpenseSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("incomeExpenseSummary/incomeExpenseSummary.tpl.html",'<div class="svi-directive svi-income-expense-summary">\n\t<h3 class="title" data-ng-bind="labels.incomeExpenseSummaryTitle"></h3>\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div data-ng-show="summary">\n\t\t<table data-ng-if="summary.income" role="grid" class="table table-striped incomeSummary">\n\t\t\t<tr class="heading">\n\t\t\t\t<th data-ng-bind="labels.incomeSummarySection" data-col-name="label"></th>\n\t\t\t\t<th data-ng-if="!ytdOnly" class="number" data-ng-bind="labels.incomeExpenseCurrentPeriod"></th>\n\t\t\t\t<th class="number" data-ng-bind="labels.incomeExpenseYTD"></th>\n\t\t\t</tr>\n\t\t\t<tr data-ng-repeat="item in summary.income">\n\t\t\t\t<td data-ng-bind="item.category|labels:labels" data-col-name="label"></td>\n\t\t\t\t<td data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="item.currentPeriod|sviCurrency"></td>\n\t\t\t\t<td class="number" data-ng-bind="item.yearToDate|sviCurrency"></td>\n\t\t\t</tr>\n\t\t\t<tr class="total">\n\t\t\t\t<td data-ng-bind="labels.incomeSummaryTotal" data-col-name="label"></td>\n\t\t\t\t<td data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="summary.totals.incomeCurrentPeriod|sviCurrency"></td>\n\t\t\t\t<td class="number" data-ng-bind="summary.totals.incomeYearToDate|sviCurrency"></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<table data-ng-if="summary.exemptIncome" role="grid" class="table table-striped exemptIncome">\n\t\t\t<tr class="heading">\n\t\t\t\t<th data-ng-bind="labels.exemptIncomeSection" data-col-name="label"></th>\n\t\t\t\t<th data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="labels.incomeExpenseCurrentPeriod"></th>\n\t\t\t\t<th class="number" data-ng-bind="labels.incomeExpenseYTD"></th>\n\t\t\t</tr>\n\t\t\t<tr data-ng-repeat="item in summary.exemptIncome">\n\t\t\t\t<td data-ng-bind="item.category|labels:labels" data-col-name="label"></td>\n\t\t\t\t<td data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="item.currentPeriod|sviCurrency"></td>\n\t\t\t\t<td class="number" data-ng-bind="item.yearToDate|sviCurrency"></td>\n\t\t\t</tr>\n\t\t\t<tr class="total">\n\t\t\t\t<td data-ng-bind="labels.exemptIncomeTotal" data-col-name="label"></td>\n\t\t\t\t<td data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="summary.totals.exemptIncomeCurrentPeriod|sviCurrency"></td>\n\t\t\t\t<td class="number" data-ng-bind="summary.totals.exemptIncomeYearToDate|sviCurrency"></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<table data-ng-if="summary.expense" role="grid" class="table table-striped expense">\n\t\t\t<tr class="heading">\n\t\t\t\t<th data-ng-bind="labels.expenseSection" data-col-name="label"></th>\n\t\t\t\t<th data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="labels.incomeExpenseCurrentPeriod"></th>\n\t\t\t\t<th class="number" data-ng-bind="labels.incomeExpenseYTD"></th>\n\t\t\t</tr>\n\t\t\t<tr data-ng-repeat="item in summary.expense">\n\t\t\t\t<td data-ng-bind="item.category|labels:labels" data-col-name="label"></td>\n\t\t\t\t<td data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="item.currentPeriod|sviCurrency"></td>\n\t\t\t\t<td class="number" data-ng-bind="item.yearToDate|sviCurrency"></td>\n\t\t\t</tr>\n\t\t\t<tr class="total">\n\t\t\t\t<td data-ng-bind="labels.expenseSummaryTotal" data-col-name="label"></td>\n\t\t\t\t<td data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="summary.totals.expenseCurrentPeriod|sviCurrency"></td>\n\t\t\t\t<td class="number" data-ng-bind="summary.totals.expenseYearToDate|sviCurrency"></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<table data-ng-if="summary.grossProceeds" role="grid" class="table table-striped grossProceeds">\n\t\t\t<tr class="heading">\n\t\t\t\t<th data-ng-bind="labels.grossProceedsSection" data-col-name="label"></th>\n\t\t\t\t<th data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="labels.incomeExpenseCurrentPeriod"></th>\n\t\t\t\t<th class="number" data-ng-bind="labels.incomeExpenseYTD"></th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td data-ng-bind="labels.incomeExpenseGrossProceeds" data-col-name="label"></td>\n\t\t\t\t<td data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="summary.grossProceeds.currentPeriod|sviCurrency"></td>\n\t\t\t\t<td class="number" data-ng-bind="summary.grossProceeds.yearToDate|sviCurrency"></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<table data-ng-if="summary.mmfYield" role="grid" class="table table-striped mmfYield">\n\t\t\t<tr class="heading">\n\t\t\t\t<th data-ng-bind="labels.mmfYieldSection" data-col-name="label"></th>\n\t\t\t\t<th data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="labels.incomeExpenseCurrentPeriod"></th>\n\t\t\t\t<th class="number" data-ng-bind="labels.incomeExpenseYTD"></th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td data-ng-bind="labels.incomeExpenseMmfYield" data-col-name="label"></td>\n\t\t\t\t<td data-ng-if="!ytdOnly" class="number" data-col-name="no-ytd-only-value" data-ng-bind="summary.mmfYield.currentPeriod|sviCurrency"></td>\n\t\t\t\t<td class="number" data-ng-bind="summary.mmfYield.yearToDate|sviCurrency"></td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n</div>')}]),angular.module("incomeInformation/incomeInformation.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("incomeInformation/incomeInformation.tpl.html",'<div class="svi-directive svi-income-information row">\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<table data-ng-show="incomeMargin" class="table table-striped col-md-12 incomeInformation">\n\t\t<thead>\n\t\t<tr>\n\t\t\t<th class="svi-column-header header-text" data-ng-bind="labels.incomeInformationTitle" colspan="{{isMultiAccount?4:2}}"></th>\n\t\t</tr>\n\t\t<tr data-ng-if="isMultiAccount">\n\t\t\t<th class="svi-column-header header-text" data-ng-bind="labels.incomeType" colspan="2"></th>\n\t\t\t<th class="svi-column-header header-text" data-ng-bind="labels.account"></th>\n\t\t\t<th class="svi-column-header header-text number" data-ng-bind="labels.incomeValue"></th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr data-ng-class="{parent: isMultiAccount}" data-ng-repeat-start="item in incomeItems">\n\t\t\t\t<td data-ng-if="isMultiAccount" data-col-name="expander"><span data-ng-if="accountData && accountData.length > 0" data-svi-expander data-expanded="item.expanded" data-target="{{$index}}" data-event-id="INCOMEINFOGRID"></span></td>\n\t\t\t\t<td data-ng-bind="labels[item.propertyName]"></td>\n\t\t\t\t<td data-ng-if="isMultiAccount">Multiple</td>\n\t\t\t\t<td data-ng-bind="formatValue(incomeMargin, item.propertyName)" data-ng-class="item.clazz"></td>\n\t\t\t</tr>\n\t\t\t<tr data-ng-repeat-end data-ng-if="item.expanded" data-ng-repeat="detail in accountData">\n\t\t\t\t<td></td>\n\t\t\t\t<td data-ng-bind="labels[item.propertyName]"></td>\n\t\t\t\t<td data-ng-if="isMultiAccount" data-ng-bind="detail.account"></td>\n\t\t\t\t<td data-ng-bind="formatValue(detail, item.propertyName)" data-ng-class="item.clazz"></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t<table data-ng-if="incomeMargin && incomeMargin.marginEnabled" class="table table-striped col-md-12 marginInformation">\n\t\t<thead>\n\t\t<tr>\n\t\t\t<th class="svi-column-header header-text" data-ng-bind="labels.marginInformationTitle"></th>\n\t\t\t<th></th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td data-ng-bind="labels.marginBuyingPower"></td>\n\t\t\t<td data-ng-bind="incomeMargin.buyingPower|sviCurrency" class="currency"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td data-ng-bind="labels.marginCashAvailable"></td>\n\t\t\t<td data-ng-bind="incomeMargin.marginCashAvailable|sviCurrency" class="currency"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td data-ng-bind="labels.marginPctEquity"></td>\n\t\t\t<td data-ng-bind="incomeMargin.pctEquity|percent" class="number"></td>\n\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>')}]),angular.module("templates-cd",["cdContainer/cdContainer.tpl.html"]),angular.module("cdContainer/cdContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("cdContainer/cdContainer.tpl.html",'<div class="row svi-directive svi-cd-container cd-container">\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<div class="col-md-12" data-ng-show="cd">\n\t\t<div class="row paging-top" data-ng-show="pageSize">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="CD" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<h5 class="col-md-4 pull-right currency" data-ng-show="cd.lastFileDate">\n\t\t\t\t<span data-ng-bind="labels.asOfDate"></span>: <span class="cd-asOfDate" data-ng-bind="cd.lastFileDate"></span>\n\t\t\t</h5>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-md-12" data-svi-cd-grid\n\t\t\t\t data-columns="columns"\n\t\t\t\t data-column-priority="columnPriority"\n\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t data-cd="cd"\n\t\t\t\t data-sort-field="sortField"\n\t\t\t\t data-sort-dir="sortDir"></div>\n\t\t</div>\n\t\t<div class="row paging-bottom" data-ng-show="pageSize">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="CD" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("templates-core",["accountDropdown/accountDropdown.tpl.html","actionBar/actionBar.tpl.html","actionMenu/actionMenu.tpl.html","breadcrumbs/breadcrumbs.tpl.html","collapse/collapse.tpl.html","columnChart/columnChart.tpl.html","errorPage/datesPopup.tpl.html","errorPage/errorPage.tpl.html","expander/expander.tpl.html","filterCheckbox/filterCheckbox.tpl.html","filterDateRange/filterDateRange.tpl.html","filterDropdown/filterDropdown.tpl.html","filterMultiDropdown/filterMultiDropdown.tpl.html","filterText/filterText.tpl.html","gaugeChart/gaugeChart.tpl.html","help/help.tpl.html","inputSymbol/inputSymbol.tpl.html","lipperAttribution/lipperAttribution.tpl.html","loader/loader.tpl.html","modal/sviModal.tpl.html","moreContainer/moreContainer.tpl.html","multiselect/multiselect.tpl.html","multiSelectDropdown/multiSelectDropdown.tpl.html","optionSearchControls/optionSearchControls.tpl.html","pagingControl/pagingControl.tpl.html","productTypeBadge/productTypeBadge.tpl.html","screenText/screenText.tpl.html","screenText/screenTextModal.tpl.html","symbol/popover.tpl.html","symbol/symbol.tpl.html","tabs/tabs.tpl.html","tags/tags.tpl.html","typeahead/sviTypeahead.tpl.html"]),angular.module("accountDropdown/accountDropdown.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountDropdown/accountDropdown.tpl.html",'<div class="svi-directive dropdown svi-account-dropdown">\n  <label class="control-label" for="{{::id}}-account" data-ng-bind="labels.account"></label>\n  <button type="button" id="{{::id}}-account" class="btn btn-default dropdown-toggle {{dropdownClasses}}" data-ng-class="buttonClass" data-toggle="dropdown" aria-expanded="false" data-ng-click="onDropdown($event)" data-ng-focus="onFocus()" aria-label="account dropdown, current selection {{selectLabel}}">\n    <span class="button-text" data-ng-bind="selectLabel"></span>\n    <span class="caret"></span>\n  </button>\n  <ul class="dropdown-menu" role="menu">\n    <li data-ng-repeat="account in accountList" id="{{::id}}-{{$index}}"><a role="menuitem" data-ng-class="accountClasses" class="menuitem" href="" data-ng-click="onClick(account)" data-ng-bind="account|sviAccount"></a></li>\n  </ul>\n  <div class="inline" svi-product-type-badge></div>\n  <div class="svi-visually-hidden" aria-live="polite">{{ labels.ariaAccountSelection }} {{ selectLabel }}</div>\n</div>')}]),angular.module("actionBar/actionBar.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("actionBar/actionBar.tpl.html",'<ul data-ng-class="{invisible: (!items || items.length < 1), \'nav-stacked\': stacked}" class="svi-directive svi-action-bar nav nav-pills">\n\t<li data-ng-repeat="item in items|limitTo:maxItems" data-ng-class="item.class + (item.type == \'dropdown\' ? \'dropdown\' : \'\')">\n\t\t<a data-ng-if="item.type != \'dropdown\'"\n\t\t   href="{{item.url}}"\n\t\t   data-ng-bind="item.label"\n\t\t   title="{{item.title}}"\n\t\t   data-ng-click="onClick(item, $event)"></a>\n\t\t<a data-ng-if="item.type == \'dropdown\'"\n\t\t   data-ng-class="item.dropdownClass"      \n\t\t   class="dropdown-toggle"\n\t\t   data-toggle="dropdown"\n\t\t   href=""\n\t\t   role="button"\n\t\t   aria-haspopup="true"\n\t\t   aria-expanded="false"\n\t\t   data-ng-mouseenter="enableDropdown($event)">\n\t\t\t{{item.label}}\n\t\t\t<span class="caret"></span>\n\t\t</a>\n\t\t<ul data-ng-if="item.type == \'dropdown\'" class="dropdown-menu {{menuClass}}">\n\t\t\t<li data-ng-repeat="dropdownItem in item.items" class="{{dropdownItem.class}}">\n\t\t\t\t<a href="{{dropdownItem.url}}"\n\t\t\t\t   data-ng-bind="dropdownItem.label"\n\t\t\t\t   title="{{dropdownItem.title}}"\n\t\t\t\t   data-ng-click="onClick(dropdownItem, $event)"></a>\n\t\t\t</li>\n\t\t</ul>\n\t</li>\n\t<li class="overflow pull-right dropdown" data-ng-if="items.length > maxItems">\n\t\t<a class="dropdown-toggle" data-toggle="dropdown" href="" role="button" aria-haspopup="true" aria-expanded="false">\n\t\t\t<span class="glyphicon glyphicon-option-vertical"></span>\n\t\t</a>\n\t\t<ul class="dropdown-menu dropdown-items-menu">\n\t\t\t<li data-ng-repeat="item in items|limitTo:(maxItems - items.length)" data-ng-class="item.class + (item.type == \'dropdown\' ? \'dropdown-submenu\' : \'\')">\n\t\t\t\t<a data-ng-if="item.type != \'dropdown\'" href="{{item.url}}" data-ng-bind="item.label" title="{{item.title}}" data-ng-click="onClick(item, $event)"></a>\n\t\t\t\t<a data-ng-if="item.type == \'dropdown\'" data-ng-class="item.dropdownClass" href="">\n\t\t\t\t\t{{item.label}} <span class="pull-right glyphicon glyphicon-chevron-right"></span>\n\t\t\t\t</a>\n\t\t\t\t<ul data-ng-if="item.type == \'dropdown\'" class="dropdown-menu {{menuClass}}">\n\t\t\t\t\t<li data-ng-repeat="dropdownItem in item.items" class="{{dropdownItem.class}}">\n\t\t\t\t\t\t<a href="{{dropdownItem.url}}" data-ng-bind="dropdownItem.label" title="{{dropdownItem.title}}" data-ng-click="onClick(dropdownItem, $event)"></a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</ul>\n\t</li>\n</ul>\n')}]),angular.module("actionMenu/actionMenu.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("actionMenu/actionMenu.tpl.html",'<div data-ng-class="{invisible: (!items || items.length < 1)}" class="svi-directive svi-action-menu inline">\n\t<div class="dropdown inline">\n\t\t<button type="button" class="{{buttonClass}} dropdown-toggle" data-toggle="dropdown" aria-expanded="false" data-ng-click="onDropdown($event)" aria-label="{{ariaLabel}} action menu">\n\t\t\t{{label}} <span class="{{icon}}"></span>\n\t\t</button>\n\t\t<ul class="dropdown-menu {{menuClass}}">\n\t\t\t<li data-ng-repeat="item in items" data-ng-class="item.class + (item.type == \'dropdown\' ? \'dropdown-submenu\' : \'\')">\n\t\t\t\t<a data-ng-if="::item.type != \'dropdown\'" href="{{::item.url}}" data-ng-bind="::item.label" title="{{::item.title}}" data-ng-click="onClick(item, $event)" aria-label="{{::item.label}}" tabindex="{{(item.class == \'divider\' ? \'-1\' : \'\')}}" aria-hidden="{{(item.class == \'divider\' ? \'true\' : \'false\')}}"></a>\n\t\t\t\t<a href="" data-ng-if="::item.type == \'dropdown\'" data-ng-class="::item.dropdownClass" data-ng-click="onClick(item, $event)">\n\t\t\t\t\t<span class="pull-right glyphicon glyphicon-chevron-right"></span>{{::item.label}}\n\t\t\t\t</a>\n\t\t\t\t<ul data-ng-if="::item.type == \'dropdown\'" class="dropdown-menu {{::menuClass}}">\n\t\t\t\t\t<li data-ng-repeat="dropdownItem in ::item.items" class="{{::dropdownItem.class}}">\n\t\t\t\t\t\t<a href="{{::dropdownItem.url}}" data-ng-bind="::dropdownItem.label" title="{{::dropdownItem.title}}" data-ng-click="onClick(dropdownItem, $event)" tabindex="{{(item.class == \'divider\' ? \'-1\' : \'\')}}" aria-hidden="{{(item.class == \'divider\' ? \'true\' : \'false\')}}"></a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</div>')}]),angular.module("breadcrumbs/breadcrumbs.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("breadcrumbs/breadcrumbs.tpl.html",'<span data-ng-repeat-start="segment in parts"\n\t  data-ng-bind="segment"\n\t  data-ng-class="{\'breadcrumb-category\' : !$last, \'breadcrumb-page\' : $last}"></span>\n<span data-ng-repeat-end\n\t  data-ng-if="!$last"\n\t  class="breadcrumb-divider"></span>')}]),angular.module("collapse/collapse.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("collapse/collapse.tpl.html",'<div class="svi-collapse svi-container" data-ng-class="{\'svi-collapse-no-title\': !collapsibleTitle}">\n\t<div class="panel panel-default panel-collapse">\n\t\t<div class="panel-heading" data-ng-show="collapsibleTitle" aria-label="{{collapsibleTitle}} panel">\n\t\t\t<h3 class="panel-title">\n\t\t\t\t{{collapsibleTitle}}\n\t\t\t\t<span class="buttons pull-right">\n\t\t\t\t\t<i data-ng-if="zoomEnabled" id="{{ ::id }}-btnZoom" class="zoom-button" data-ng-class="{\'glyphicon glyphicon-remove\': zoomed, \'fas fa-expand-alt\': !zoomed}" role="button" data-ng-click="toggleZoom()"  aria-label="{{collapsibleTitle}} panel zoomed in" tabindex="0"></i>\n\t\t\t\t\t<i data-ng-click="toggle()" id="{{ ::id }}-btnExpand" data-ng-if="!zoomed" class="expand-button fa" data-ng-class="{\'fa-caret-down\': expanded, \'fa-caret-up\': !expanded}" role="button" aria-expanded="{{ expanded }}" aria-label="{{collapsibleTitle}} panel" tabindex="0"></i>\n\t\t\t\t</span>\n\t\t\t</h3>\n\t\t</div>\n\t\t<div class="panel-body" data-ng-class="{\'in\': expanded, \'transitioning\': transitioning}">\n\t\t\t<div data-ng-transclude id="{{ ::id }}-panel"></div>\n\t\t</div>\n\t</div>\n\t<div class="backdrop" data-ng-click="unzoomPanel()" tabindex="-1"></div>\n</div>')}]),angular.module("columnChart/columnChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("columnChart/columnChart.tpl.html",'<div class="svi-directive svi-column-chart" id="{{::id}}">\n    <div class="chart-wrapper">\n        <div class="chart-inner">\n            <div class="column-chart"></div>\n        </div>\n    </div>\n</div>')}]),angular.module("errorPage/datesPopup.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("errorPage/datesPopup.tpl.html",'<div class="pr-error-page_dates-popup pr_popup">\n  <div class="arrow"></div>\n  Dates with errors:\n  <ul>\n    <li data-ng-repeat="date in error.dates" data-ng-bind="date"></li>\n  </ul>\n</div>')}]),angular.module("errorPage/errorPage.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("errorPage/errorPage.tpl.html",'<div class="pr-error-page" data-ng-if="error">\n  <div class="pr-error-page_text-container">\n    <div class="pr-error-page__title" data-ng-bind="error.title"></div>\n    <div class="pr-error-page__message">{{error.message}} <span class="pr_link" data-ng-if="error.dates.length > 0" data-ng-click="showDates($event);">Click to see the affected dates.</span>\n    </div>\n  </div>\n</div>\n')}]),angular.module("expander/expander.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("expander/expander.tpl.html",'<button type="button" class="svi-directive svi-expander btn btn-xs btn-{{ ::btnStyle }}" title="{{ ::tooltip }}" data-ng-click="toggle($event)" aria-expanded="{{ expanded ? \'true\':\'false\' }}" aria-label="{{ ::ariaLabel }}">\n\t<span data-ng-class="icon"></span>\n</button>')}]),angular.module("filterCheckbox/filterCheckbox.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("filterCheckbox/filterCheckbox.tpl.html",'<label for="{{::id}}" data-ng-bind="title">{{title}} </label>\n<input class="svi-directive svi-filter-checkbox" type="checkbox" id="{{::id}}" data-ng-model="value" data-ng-true-value="\'true\'" data-ng-false-value="\'false\'" aria-label="Filter" />')}]),angular.module("filterDateRange/filterDateRange.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("filterDateRange/filterDateRange.tpl.html",'<div data-ng-form name="dateForm" class="svi-directive svi-filter-date-range form-group-keep-together inline-block" data-ng-class="{\'has-error\': validationError}">\n\t<div class="form-group wrapper-date-range-input" data-ng-class="{\'has-error\': validationError || (dateForm.fromDate.$invalid && dateForm.fromDate.$touched && fromDate !== null)}">\n\t\t<label class="{{labelClass}}" for="{{::id}}-from" data-ng-bind="fromLabel"></label>\n\t\t<input id="{{::id}}-from"\n\t\t\t   name="fromDate"\n\t\t\t   type="text"\n\t\t\t   class="form-control"\n\t\t\t   data-bs-datepicker\n\t\t\t   data-placement="bottom-left"\n\t\t\t   data-ng-model="fromDate"\n\t\t\t   data-date-format="{{format}}"\n\t\t\t   data-disabled-dates="disabledFrom"\n\t\t\t   placeholder="{{fromLabel}}"\n\t\t\t   data-ng-focus="onFocus()" />\n\t\t<div data-ng-show="dateForm.fromDate.$invalid && dateForm.fromDate.$touched && fromDate !== null && !validationError" class="on-error help-block" data-ng-bind="labels.dateInvalidFormat" role="alert" aria-live="assertive"></div>\n\t</div>\n\t<div class="form-group wrapper-date-range-input" data-ng-class="{\'has-error\': validationError || (dateForm.toDate.$invalid && dateForm.toDate.$touched && toDate !== null)}">\n\t\t<label class="{{labelClass}}" for="{{::id}}-to" data-ng-bind="toLabel"></label>\n\t\t<input id="{{::id}}-to"\n\t\t\t   name="toDate"\n\t\t\t   type="text"\n\t\t\t   class="form-control"\n\t\t\t   data-bs-datepicker\n\t\t\t   data-placement="bottom-right"\n\t\t\t   data-ng-model="toDate"\n\t\t\t   data-date-format="{{format}}"\n\t\t\t   data-disabled-dates="disabledTo"\n\t\t\t   placeholder="{{toLabel}}"\n\t\t\t   data-ng-focus="onFocus()" />\n\t\t<div data-ng-show="dateForm.toDate.$invalid && dateForm.toDate.$touched && toDate !== null && !validationError" class="on-error help-block" data-ng-bind="labels.dateInvalidFormat" role="alert" aria-live="assertive"></div>\n\t</div>\n\t<div class="on-error help-block filter-date-range-error" data-ng-bind="validationError" aria-live="polite"></div>\n</div>')}]),angular.module("filterDropdown/filterDropdown.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("filterDropdown/filterDropdown.tpl.html",'<div class="svi-directive svi-filter-dropdown btn-group dropdown">\n    <div class="form-group">\n            <label class="control-label" data-ng-if="labelText" data-ng-bind="labelText"></label>\n            <div class="dropdown inline-block" role="presentation">\n       <button class="btn btn-default dropdown-toggle"\n               data-ng-class="[(buttonClass), (hasError ? \'dropdown-button--has-error\' : \'\')]"\n               data-toggle="dropdown"\n               data-ng-focus="onBlur()"\n               aria-expanded="false"\n               data-ng-disabled="disabled"\n               aria-label="{{ariaLabel}} dropdown current selection {{selectedItemNames}}"\n               aria-live="polite">\n           {{title}}\n           <span class="caret"></span>\n       </button>\n       <ul class="dropdown-menu" data-ng-class="dropdownClass" role="menu" style="min-width: 10px;" data-ng-blur="onBlur()">\n           <li role="none"\n               data-ng-repeat="option in options"\n               id="{{eventId}}-{{option.value}}">\n               <a role="menuitem"\n                  href=""\n                  data-ng-click="onClick(option)">\n                   {{option.display}}\n               </a>\n           </li>\n       </ul>\n            </div>\n    </div>\n</div>')}]),angular.module("filterMultiDropdown/filterMultiDropdown.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("filterMultiDropdown/filterMultiDropdown.tpl.html",'<div class="svi-directive svi-filter-multi-dropdown">\n\t<label class="filter-multi-dropdown-label" for="{{buttonId}}" data-ng-bind="ariaLabel"></label>\n\t<div data-multiselect\n\t\t data-title="{{title}}"\n\t\t id="{{stateId}}"\n\t\t data-event-id="{{eventId}}"\n\t\t data-button-id="{{buttonId}}"\n\t\t data-selected-label="{{selectedLabel}}"\n\t\t data-multiple="true"\n\t\t data-filter="{{filter}}"\n\t\t data-select-all="{{selectAll}}"\n\t\t data-ng-model="selected"\n\t\t data-options="option.display for option in options"\n\t\t data-change="onClick()"\n\t\t data-aria-label="{{ariaLabel}}"></div>\n</div>')}]),angular.module("filterText/filterText.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("filterText/filterText.tpl.html",'<div class="svi-directive svi-filter-text">\n\t<label data-ng-class="{\'sr-only\': isLabelForSrOnly}"\n\t\t\t\t for="{{::id}}"\n\t\t\t\t data-ng-bind="title"></label>\n\t<input type="text"\n\t\t\t\t class="form-control"\n\t\t\t\t id="{{::id}}"\n\t\t\t\t data-ng-model="value"\n\t\t\t\t data-ng-disabled="isDisabled"\n\t\t\t\t placeholder="{{title}}"\n\t\t\t\t data-ng-focus="onFocus()"/>\n</div>')}]),angular.module("gaugeChart/gaugeChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("gaugeChart/gaugeChart.tpl.html",'<div class="svi-directive svi-gauge-chart" id="{{::id}}">\n    <div class="chart-wrapper">\n\t\t<div class="chart-inner">\n\t\t\t<div class="gauge-chart"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("help/help.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("help/help.tpl.html",'<span class="svi-help glyphicon glyphicon-info-sign" data-ng-show="message" title="{{ message }}" aria-label="{{ message }}" data-toggle="tooltip" data-placement="bottom" data-html="true"></span>')}]),angular.module("inputSymbol/inputSymbol.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("inputSymbol/inputSymbol.tpl.html",'<div class="svi-directive svi-input-symbol">\n\t<div class="svi-visually-hidden" data-ng-bind="arialive" aria-live="polite"></div>\n\t<div data-ng-class="{\'input-group\': enableLookup || manualSubmit}">\n\t\t<div data-svi-typeahead data-ng-show="!symbolLookup" class="symbol-input-area" data-ng-class="{\'lookup-enabled\':enableLookup}"\n\t\t\t data-name="{{name}}"\n\t\t\t data-id="{{id}}"\n\t\t\t data-source="ttAdapter"\n\t\t\t data-templates="templates"\n\t\t\t data-highlight="true"\n\t\t\t data-disabled="{{isInputDisabled}}"\n\t\t\t data-capitalize="{{capitalize}}"\n\t\t\t aria-describedby="{{ariaDescribedby}}"\n\t\t\t data-ng-model="value"\n\t\t\t data-ng-model-options="{ updateOn: \'default blur\', debounce: { default: debounceDelay, blur: 0 }, allowInvalid: true }"\n\t\t\t data-cls="{{inputCls}}"\n\t\t\t data-placeholder="{{placeholder}}"\n\t\t\t data-type="{{ osi ? \'text\' : \'search\' }}"\n\t\t\t data-aria-label="{{ osi ? \'\' : placeholder }}"\n\t\t\t data-comm="{ \'placeholder\': placeholder }"></div>\n\t\t<div data-ng-if="enableLookup" data-ng-show="symbolLookup" class="symbol-lookup-area"\n\t\t\t data-svi-symbol-lookup\n\t\t\t data-ng-model="comm.value"\n\t\t\t data-name="{{name}}-lookup"\n\t\t\t data-placement="{{lookupPlacement}}"></div>\n\t\t<span data-ng-if="enableLookup" class="input-group-btn">\n\t\t\t<button class="btn btn-default symbol-lookup-toggle" type="button"\n\t\t\t\t\tdata-ng-click="api.toggleSymbolLookup()"\n\t\t\t\t\tdata-bs-tooltip\n\t\t\t\t\tdata-container=".svi-bs"\n\t\t\t\t\tdata-trigger="{{ isMobile() ? \'manual\' : \'hover focus\' }}"\n\t\t\t\t\tdata-title="{{symbolLookup ? labels.symbolLookupReturn : labels.symbolLookupStart}}"\n\t\t\t\t\taria-label="{{symbolLookup ? labels.symbolLookupReturn : labels.symbolLookupStart}}">\n\t\t\t\t<span class="glyphicon" data-ng-class="{\'glyphicon-search\': !symbolLookup, \'glyphicon-share-alt glyphicon-flip\': symbolLookup}"></span>\n\t\t\t</button>\n\t\t</span>\n\t\t<span data-ng-if="manualSubmit" class="input-group-btn">\n\t\t\t<button class="btn btn-primary symbol-submit" type="button"\n\t\t\t\t\tdata-ng-click="api.symbolSubmit()"\n\t\t\t\t\tdata-ng-disabled="disabled"\n\t\t\t\t\tdata-bs-tooltip\n\t\t\t\t\tdata-container=".svi-bs"\n\t\t\t\t\tdata-trigger="{{ isMobile() ? \'manual\' : \'hover focus\' }}"\n\t\t\t\t\tdata-title="{{submitMessage}}"\n\t\t\t\t\taria-label="{{submitMessage}}">\n\t\t\t\t<span data-ng-class="submitClass"></span>\n\t\t\t</button>\n\t\t</span>\n\t</div>\n</div>')}]),angular.module("lipperAttribution/lipperAttribution.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("lipperAttribution/lipperAttribution.tpl.html",'<a href=""\n   data-bs-popover\n   data-bs-on-show="api.onPopoverShow"\n   class="svi-lipper-attribution"\n   data-trigger="{{trigger}}"\n   data-auto-close="1"\n   data-container="{{container}}"\n   data-placement="{{placement}}"\n   data-custom-class="{{customClass}}"\n   data-content="{{lipperHelpText}}">\n    {{label}}\n</a>\n')}]),angular.module("loader/loader.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("loader/loader.tpl.html",'<div class="svi-directive svi-loader" data-ng-show="!hidden">\n\t<div class="message-section" data-ng-show="shouldShowMessages()" aria-live="polite">\n\t\t<div class="svi-visually-hidden" data-ng-bind="ariaMsg"></div>\n\t\t<div class="alert alert-info" data-ng-show="message && !(retrying || warning || error)">\n\t\t\t<p data-ng-show="message" class="pre-line" data-ng-bind="message"></p>\n\t\t\t<button type="button" class="close" aria-label="dismiss message" data-ng-click="clearAllMessages()" tabindex="-1"><span class="glyphicon glyphicon-remove"></span></button>\n\t\t</div>\n\t\t<div class="alert alert-warning" data-ng-show="warning || (retrying && !error)">\n\t\t\t<p data-ng-show="warning">\n\t\t\t\t<strong data-ng-if="labels.warningTitle" data-ng-bind="labels.warningTitle"></strong>\n\t\t\t\t<span class="pre-line" data-ng-bind="warning"></span>\n\t\t\t</p>\n\t\t\t<p data-ng-show="message && !error" class="pre-line" data-ng-bind="message"></p>\n\t\t\t<p data-ng-show="retrying && !error">\n\t\t\t\t<span data-ng-bind="labels.retry1"></span> <span data-ng-bind="retrying"></span> <span data-ng-bind="labels.retry2"></span>...\n\t\t\t</p>\n\t\t\t<button type="button" class="close" aria-label="dismiss message" data-ng-click="clearAllMessages()" tabindex="-1"><span class="glyphicon glyphicon-remove"></span></button>\n\t\t</div>\n\t\t<div class="alert alert-danger" data-ng-show="error">\n\t\t\t<p data-ng-show="error">\n\t\t\t\t<strong data-ng-if="labels.errorTitle" data-ng-bind="labels.errorTitle"></strong>\n\t\t\t\t<span class="pre-line" data-ng-bind="error"></span>\n\t\t\t</p>\n\t\t\t<p data-ng-show="message" class="pre-line" data-ng-bind="message"></p>\n\t\t\t<p data-ng-show="retrying">\n\t\t\t\t<span data-ng-bind="labels.retry1"></span> <span data-ng-bind="retrying"></span> <span data-ng-bind="labels.retry2"></span>...\n\t\t\t</p>\n\t\t\t<button type="button" class="close" aria-label="dismiss message" data-ng-click="clearAllMessages()" tabindex="-1"><span class="glyphicon glyphicon-remove"></span></button>\n\t\t</div>\n\t</div>\n    <div class="well spinner" data-ng-if="showSpinner" role="alert" aria-live="assertive"><i class="fa fa-2x fa-spinner fa-spin"></i> <span data-ng-bind="loadingLabel ? loadingLabel : labels.loading" ></span>...</div>\n</div>\n')}]),angular.module("modal/sviModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("modal/sviModal.tpl.html",'<div class="svi-directive svi-modal modal" data-ng-class="cls" id="{{::id}}" data-backdrop-limit="1" tabindex="-1" role="dialog" aria-labelledby="{{::id}}-modalTitle">\n\t<div class="modal-dialog modal-{{::size}}" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header" data-ng-if="!modalHeader">\n\t\t\t\t<h1 id="{{::id}}-modalTitle" class="modal-title" data-ng-bind="title"></h1>\n\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="api.hideModal()" aria-label="{{labels.close}}"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-header" data-ng-if="modalHeader" data-ng-transclude="modalHeader"></div>\n\t\t\t<div class="modal-body" data-ng-transclude="modalBody"></div>\n\t\t\t<div class="modal-footer" data-ng-if="modalFooter && !hideFooter" data-ng-transclude="modalFooter"></div>\n\t\t\t<div class="modal-footer" data-ng-if="!modalFooter && !hideFooter">\n\t\t\t\t<button class="btn btn-primary" data-ng-bind="labels.close" data-ng-click="api.hideModal()"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("moreContainer/moreContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("moreContainer/moreContainer.tpl.html",'<div class="svi-directive svi-more-container">\n\t<div class="more-section collapse" data-ng-class="cls" id="{{::id}}" data-ng-transclude></div>\n\t<div class="more-less-banner">\n\t\t<button type="button" class="btn btn-lg btn-link" aria-expanded="{{ expanded ? \'true\' : \'false\'}}" data-ng-click="api.toggle()" aria-controls="{{::id}}">\n\t\t\t{{ expanded ? lessText : moreText }} <span class="glyphicon" data-ng-class="{\'glyphicon-chevron-up\': expanded, \'glyphicon-chevron-down\': !expanded}"></span>\n\t\t</button>\n\t</div>\n</div>')}]),angular.module("multiselect/multiselect.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("multiselect/multiselect.tpl.html",'<div data-svi-click-outside="toggleSelect(false)" class="svi-directive btn-group dropdown multiselect" data-ng-class="{open: isVisible}">\n    <button type="button"\n            class="btn btn-default dropdown-toggle"\n            id="{{buttonId}}"\n            data-ng-click="toggleSelect()"\n            data-ng-disabled="disabled"\n            data-ng-class="{\'error\': !valid()}"\n            aria-expanded="{{ isVisible ? \'true\' : \'false\' }}"\n            aria-label="{{ariaLabel}} dropdown current selection {{selectedItemNames}}"\n            aria-live="polite">\n        <span data-ng-if="header">{{header}}</span>\n        <span class="caret"></span>\n    </button>\n    <ul class="dropdown-menu" role="menu">\n        <li data-ng-show="filter">\n            <input class="form-control input-sm"\n                   type="text"\n                   data-ng-model="searchText.label"\n                   autofocus="autofocus"\n                   placeholder="Filter"\n                   aria-label="Filter" />\n        </li>\n\t\t<li data-ng-show="multiple && selectAll" class="selectAll">\n\t\t\t<button class="btn btn-link btn-xs"\n                    data-ng-click="checkAll(false, $event)" type="button">\n                <span class="glyphicon glyphicon-ok"></span>Select All\n            </button>\n\t\t\t<button class="btn btn-link btn-xs pull-right"\n                    data-ng-click="uncheckAll(false, $event)"\n                    type="button">\n                <span class="glyphicon glyphicon-remove"></span>Deselect All\n            </button>\n\t\t</li>\n        <li data-ng-show="dropdownMenuLabel.length">\n            <div>{{dropdownMenuLabel}}</div>\n        </li>\n        <li data-ng-repeat="i in items | filter:searchText">\n            <input type="checkbox"\n                   role="checkbox"\n                   class="checkbox"\n                   data-ng-click="select(i, $event)"\n                   data-ng-checked="i.checked"\n                   aria-checked="{{i.checked}}"\n                   name="checkbox{{i.label|convertSpaces}}"\n                   id="checkbox{{i.label|convertSpaces}}{{::id}}" />\n            <label for="checkbox{{i.label|convertSpaces}}{{::id}}"\n                   data-ng-bind="i.label"></label>\n        </li>\n    </ul>\n</div>')}]),angular.module("multiSelectDropdown/multiSelectDropdown.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("multiSelectDropdown/multiSelectDropdown.tpl.html",'<div data-svi-click-outside="toggleSelect(false)"\n\t\t class="svi-directive btn-group dropdown svi-multi-select-dropdown multiselect"\n\t\t data-ng-class="{open: isVisible}">\n\t<div class="dropdown-button-wrapper">\n\t\t<div class="svi-multi-select-dropdown-label" data-ng-bind="ariaLabel"></div>\n\t\t<button type="button"\n\t\t\t\t\t\tclass="btn btn-default dropdown-toggle"\n\t\t\t\t\t\tid="{{buttonId}}"\n\t\t\t\t\t\tdata-ng-click="toggleSelect()"\n\t\t\t\t\t\taria-expanded="{{ isVisible ? \'true\' : \'false\' }}"\n\t\t\t\t\t\taria-label="{{ariaLabel}} dropdown current selection {{selectedItemNames}}"\n\t\t\t\t\t\tdata-ng-disabled="disabled"\n\t\t\t\t\t\taria-live="polite"\n\t\t\t\t\t\tdata-ng-class="{\'button-validation-error\': hasError}">\n        <span data-ng-if="buttonTitle">\n            {{ buttonTitle }}\n        </span>\n\t\t\t<span class="caret"></span>\n\t\t</button>\n\t</div>\n\t<div class="multi-select-dropdown-validation-error" data-ng-if="hasError">\n\t\t{{ errorMessage }}\n\t</div>\n\t<ul class="dropdown-menu" role="menu">\n\t\t<li class="dropdown-menu-options-filter">\n\t\t\t<input class="form-control input-sm"\n\t\t\t\t\t\t type="text"\n\t\t\t\t\t\t data-ng-model="searchText.label"\n\t\t\t\t\t\t autofocus="autofocus"\n\t\t\t\t\t\t placeholder="{{filterInputPlaceholder}}"\n\t\t\t\t\t\t aria-label="{{filterInputPlaceholder}}"/>\n\t\t</li>\n\t\t<li class="selectAll">\n\t\t\t<button class="btn btn-link btn-xs" data-ng-click="checkOrUncheckAll(true)">\n\t\t\t\t<span class="glyphicon glyphicon-ok"></span>\n\t\t\t\t<span>\n\t\t\t\t\t{{ labels.selectAll }}\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t\t<button class="btn btn-link btn-xs" data-ng-click="checkOrUncheckAll()">\n\t\t\t\t<span class="glyphicon glyphicon-remove"></span>\n\t\t\t\t<span>\n\t\t\t\t\t{{ labels.deselectAll }}\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t</li>\n\t\t<li data-ng-if="description.length" class="dropdown-menu-notes-item">\n\t\t\t<div>{{ description }}</div>\n\t\t</li>\n\t\t<li data-ng-if="dropdownMenuLabel.length" class="dropdown-menu-notes-item">\n\t\t\t<div>{{ dropdownMenuLabel }}</div>\n\t\t</li>\n\t\t<li data-ng-repeat="i in localOptions | filter: searchText">\n\t\t\t<input type="checkbox"\n\t\t\t\t\t\t role="checkbox"\n\t\t\t\t\t\t class="checkbox"\n\t\t\t\t\t\t data-ng-click="onOptionClick(i)"\n\t\t\t\t\t\t data-ng-checked="i.checked"\n\t\t\t\t\t\t aria-checked="{{i.checked}}"\n\t\t\t\t\t\t name="checkbox-{{i.label}}"\n\t\t\t\t\t\t id="checkbox-{{i.label}}-{{::id}}"/>\n\t\t\t<label for="checkbox-{{i.label}}-{{::id}}"\n\t\t\t\t\t\t data-ng-bind="i.label"></label>\n\t\t</li>\n\t</ul>\n</div>')}]),angular.module("optionSearchControls/optionSearchControls.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("optionSearchControls/optionSearchControls.tpl.html",'<div class="svi-directive svi-option-search-controls">\n\t<div class="option-search-controls">\n\t\t<div class="search-controls-label" data-ng-bind="controlsLabel"></div>\n\t\t<div class="option-search-dropdowns-container">\n\t\t\t<div class="dropdown inline-block" role="presentation">\n\t\t\t\t<button class="btn btn-default dropdown-toggle svi-option-chains-dropdown"\n\t\t\t\t        data-ng-class="buttonClass"\n\t\t\t\t        data-toggle="dropdown"\n\t\t\t\t        data-ng-focus="onBlur()"\n\t\t\t\t        aria-expanded="false"\n\t\t\t\t        data-ng-click="handleDropdownState(\'.svi-option-chains-dropdown\')"\n\t\t\t\t        aria-label="{{ariaLabel}} dropdown current selection"\n\t\t\t\t        aria-live="polite">\n\t\t\t\t\t{{optionChainsTitle}}\n\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t</button>\n\t\t\t\t<ul class="dropdown-menu"\n\t\t\t\t    data-ng-class="dropdownClass"\n\t\t\t\t    role="menu"\n\t\t\t\t    style="min-width: 10px;"\n\t\t\t\t    data-ng-blur="onBlur()">\n\t\t\t\t\t<li role="none"\n\t\t\t\t\t    data-ng-repeat="option in optionChainsOptions"\n\t\t\t\t\t    id="{{eventId}}-{{option.value}}">\n\t\t\t\t\t\t<a role="menuitem"\n\t\t\t\t\t\t   href=""\n\t\t\t\t\t\t   data-ng-click="onDropdownItemClick(option, \'.svi-option-chains-dropdown\')">\n\t\t\t\t\t\t\t{{option.display}}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<div class="dropdown inline-block" role="presentation">\n\t\t\t\t<button class="btn btn-default dropdown-toggle svi-option-price-dropdown"\n\t\t\t\t        data-ng-class="optionPriceDropdownButtonClass"\n\t\t\t\t        data-toggle="dropdown"\n\t\t\t\t        data-ng-focus="onBlur()"\n\t\t\t\t        aria-expanded="false"\n\t\t\t\t        data-ng-click="handleDropdownState(\'.svi-option-price-dropdown\')"\n\t\t\t\t        aria-label="{{ariaLabel}} dropdown current selection"\n\t\t\t\t        aria-live="polite">\n\t\t\t\t\t{{optionPriceTitle}}\n\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t</button>\n\t\t\t\t<ul class="dropdown-menu dropdown-menu-scrollable"\n\t\t\t\t    id="option-price-menu"\n\t\t\t\t    data-ng-class="dropdownClass"\n\t\t\t\t    data-ng-style="{\'height\': optionPriceData.length > 10 ? \'210px\' : auto}"\n\t\t\t\t    role="menu"\n\t\t\t\t    style="min-width: 10px;"\n\t\t\t\t    data-ng-blur="onBlur()">\n\t\t\t\t\t<li role="none"\n\t\t\t\t\t    data-ng-repeat="option in optionPriceData"\n\t\t\t\t\t    id="p{{option.display}}">\n\t\t\t\t\t\t<a role="menuitem"\n\t\t\t\t\t\t   href=""\n\t\t\t\t\t\t   data-ng-click="onDropdownItemClick(option, \'.svi-option-price-dropdown\')">\n\t\t\t\t\t\t\t{{option.display}}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<div class="dropdown inline-block" role="presentation">\n\t\t\t\t<button class="btn btn-default dropdown-toggle svi-option-date-dropdown "\n\t\t\t\t        data-ng-class="optionDateDropdownButtonClass"\n\t\t\t\t        data-toggle="dropdown"\n\t\t\t\t        data-ng-focus="onBlur()"\n\t\t\t\t        aria-expanded="false"\n\t\t\t\t        data-ng-click="handleDropdownState(\'.svi-option-date-dropdown\')"\n\t\t\t\t        aria-label="{{ariaLabel}} dropdown current selection"\n\t\t\t\t        aria-live="polite">\n\t\t\t\t\t{{optionDateTitle}}\n\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t</button>\n\t\t\t\t<ul class="dropdown-menu"\n\t\t\t\t    data-ng-class="{\'dropdown-menu-scrollable\': optionDateData.length > 10 }"\n\t\t\t\t    data-ng-style="{\'height\': optionDateData.length > 10 ? \'210px\' : auto}"\n\t\t\t\t    role="menu"\n\t\t\t\t    style="min-width: 10px;"\n\t\t\t\t    data-ng-blur="onBlur()">\n\t\t\t\t\t<li role="none"\n\t\t\t\t\t    data-ng-repeat="option in optionDateData"\n\t\t\t\t\t    id="{{eventId}}-{{option.value}}">\n\t\t\t\t\t\t<a role="menuitem"\n\t\t\t\t\t\t   href=""\n\t\t\t\t\t\t   data-ng-click="onDropdownItemClick(option, \'.svi-option-date-dropdown\')">\n\t\t\t\t\t\t\t{{option.display}}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<button class="btn btn-primary symbol-submit"\n\t\t\t        data-ng-class="submitButtonClass"\n\t\t\t        type="button"\n\t\t\t        data-ng-click="symbolSubmit()"\n\t\t\t        data-bs-tooltip\n\t\t\t        data-container=".svi-bs">\n\t\t\t\t<span class="glyphicon glyphicon-search"></span>\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("pagingControl/pagingControl.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("pagingControl/pagingControl.tpl.html",'<ul class="svi-directive svi-paging-control pagination" data-ng-if="totalPages > 1" role="presentation">\n    <li data-ng-class="{disabled: currentPage == 1}"><a data-ng-bind="labels.previousPage" data-ng-click="onClick(currentPage-1)"></a></li>\n    <li data-ng-if="showFirst()" data-ng-class="{active: currentPage == 1}"><a data-ng-click="onClick(1)">1</a></li>\n    <li data-ng-if="showStartEllipsis()" class="disabled"><span>...</span></li>\n    <li data-ng-repeat="i in range()" data-ng-class="{active: currentPage == i}"><a data-ng-bind="i" data-ng-click="onClick(i)"></a></li>\n    <li data-ng-if="showEndEllipsis()" class="disabled"><span>...</span></li>\n    <li data-ng-if="showLast()" data-ng-class="{active: currentPage == totalPages}"><a data-ng-bind="totalPages" data-ng-click="onClick(totalPages)"></a></li>\n    <li data-ng-class="{disabled: currentPage == totalPages}"><a data-ng-bind="labels.nextPage" data-ng-click="onClick(currentPage+1)"></a></li>\n</ul>')}]),angular.module("productTypeBadge/productTypeBadge.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("productTypeBadge/productTypeBadge.tpl.html",'<span class="svi-directive svi-product-type-badge">\n\t<span class="loader" data-ignore-invisible="true" data-hidden="true" data-svi-loader data-callback="setLoader"></span>\n\t<span data-ng-show="loader.showSpinner" class="fa fa-spinner fa-spin" data-callback="setLoader"></span>\n\t<span class="badge" data-ng-style="{\'background-color\':badgeColor}" data-ng-show="showBadge">{{ badgeText }}</span>\n\t<span class="svi-product-help-icon" data-svi-help data-message="{{ helpIconText }}" data-ng-show="showBadge"></span>\n</span>')}]),angular.module("screenText/screenText.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("screenText/screenText.tpl.html",'<div class="svi-directive svi-screen-text">\n\t<div data-svi-loader></div>\n\t<div data-ng-if="text" data-ng-bind-html="text" class="screen-text-content" role="document"></div>\n</div>')}]),angular.module("screenText/screenTextModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("screenText/screenTextModal.tpl.html",'<div class="svi-directive svi-screen-text" data-svi-modal\n\t data-cls="svi-screen-text-modal"\n\t data-id="{{::refId}}-screenTextModal"\n\t data-event-name="{{::eventName}}"\n\t data-title="{{title}}"\n\t data-size="lg">\n\t<svi:modal-body>\n\t\t<div data-svi-screen-text data-template="{{template}}" data-identifier="{{identifier}}"></div>\n\t</svi:modal-body>\n</div>')}]),angular.module("symbol/popover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbol/popover.tpl.html",'<div class="svi-directive svi-symbol-popover popover" id="{{::id}}" data-svi-click-outside="api.hideQuote()">\n\t<div class="arrow"></div>\n\t<div class="popover-content">\n\t\t<div data-svi-detailed-quote\n\t\t     data-template="newPopover"\n\t\t     data-symbol="{{title}}"\n\t\t     data-id="{{::id}}"\n\t\t     data-mobile-scroll-on-update="true"></div>\n\t</div>\n\t<a class="svi-visually-hidden"\n\t   data-svi-skip-link="#{{::parentId}}"\n\t   data-callback="api.hideQuote"\n\t   data-ng-bind="labels.returnFromQuotePopup"></a>\n</div>')}]),angular.module("symbol/symbol.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbol/symbol.tpl.html",'<a data-ng-if="::(showHover)"\n   data-ng-bind-html="(instrument.symbol === \'\' ? \'&nbsp;\' : instrument.symbol|ellipsis:displayLength:true)"\n   class="svi-directive svi-symbol ignoreToggle"\n   data-ng-class="::cls"\n   data-symbol="{{instrument.symbol}}"\n   data-ng-click="api.showQuote($event)"\n   data-bs-tooltip="instrument.desc"\n   data-trigger="{{ isUnitPrice ? \'hover focus\' : \'manual\' }}"\n   href=""\n   id="{{::id}}"></a>\n<span data-ng-if="::(!showHover)"\n   data-ng-bind-html="(instrument.symbol === \'\' ? \'&nbsp;\' : instrument.symbol|ellipsis:displayLength:true)"\n   class="svi-directive svi-symbol"\n   data-ng-class="::cls"\n   data-symbol="{{instrument.symbol}}"\n   data-bs-tooltip="instrument.desc"\n   data-trigger="{{ isUnitPrice ? \'hover focus\' : \'manual\' }}"\n   id="{{::id}}"></span>')}]),angular.module("tabs/tabs.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("tabs/tabs.tpl.html",'<div class="svi-directive svi-tabs">\n\t<a href="" data-ng-if="::arrowsEnabled" data-ng-show="!isAtBeginning()" class="svi-carousel-control carousel-control-prev" data-ng-click="previous()" role="button">\n\t\t<i class="carousel-control-prev-icon glyphicon glyphicon-chevron-left" aria-hidden="true"></i>\n\t\t<span class="sr-only">Previous</span>\n\t</a>\n\t<a href="" data-ng-if="::arrowsEnabled" data-ng-show="!isAtEnd()" class="svi-carousel-control carousel-control-next" data-ng-click="next()" role="button">\n\t\t<i class="carousel-control-next-icon glyphicon glyphicon-chevron-right" aria-hidden="true"></i>\n\t\t<span class="sr-only">Next</span>\n\t</a>\n\n\t<div class="tab-controls">\n\t\t<ul class="nav nav-pills" role="tablist" data-ng-class="tabClass">\n\t\t\t<li data-ng-repeat="tab in tabs track by $index" class="nav-item" data-ng-class="{active: active === $index, hidden: tab.hidden}" role="presentation">\n\t\t\t\t<a role="tab" href="" class="nav-link" data-ng-click="selectTab($index)" data-ng-bind="tab.title" aria-selected="{{ active === $index ? \'true\' : \'false\' }}" data-tab-id="{{::tab.id}}" data-tab-index="{{$index}}"></a>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n\n\t<div class="carousel-inner" data-ng-style="carouselInnerStyle" data-ng-transclude></div>\n\t\n\t<ol data-ng-if="indicatorsEnabled" class="carousel-indicators">\n\t\t<li data-ng-repeat="tab in tabs" data-ng-if="!tab.hidden" data-ng-click="selectTab($index)" data-ng-class="{active: active === $index}" aria-label="{{tab.title}}" data-tab-id="{{::tab.id}}" data-tab-index="{{$index}}"></li>\n\t</ol>\n</div>')}]),angular.module("tags/tags.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("tags/tags.tpl.html",'<div data-ng-if="displayInline" class="svi-directive tags">\n\t<span\n\t\t\tdata-ng-show="!editable"\n\t\t\tdata-ng-bind-html="tagsToHtml()"\n\t\t\tdata-ng-click="startEdit($event)"\n\t\t\ttitle="{{labels.clickToEditTags}}"\n\t\t\taria-label="{{labels.clickToEditTags}}"\n\t\t\t></span>\n\t<span\n\t\t\tdata-ng-show="!editable"\n\t\t\tdata-ng-click="startEdit($event)"\n\t\t\ttitle="{{labels.clickToEditTags}}"\n\t\t\taria-label="{{labels.clickToEditTags}}"\n\t\t\tclass="pull-right pointer glyphicon glyphicon-pencil"\n\t\t\t></span>\n\t<span\n\t\t\tdata-ng-if="editable"\n\t\t\tdata-bootstrap-tagsinput\n\t\t\tdata-ng-model="tags"\n\t\t\tdata-typeahead-source="queryTags"\n\t\t\tdata-tagclass="getTagClass"\n\t\t\tdata-itemvalue="getValue"\n\t\t\tdata-itemtext="getText"\n\t\t\tdata-placeholder="{{labels.addTag}}"\n\t\t\t></span>\n\t<span\n\t\t\tdata-ng-show="editable"\n\t\t\tclass="pointer glyphicon glyphicon-ok"\n\t\t\tdata-ng-click="endEdit($event)"\n\t\t\ttitle="{{labels.clickToCollapseTags}}"\n\t\t\taria-label="{{labels.clickToCollapseTags}}"\n\t\t\t></span>\n</div>\n<div data-ng-if="!displayInline" class="tags">\n\t<div class="svi-popover">\n\t\t<div\n\t\t\t\tclass="editor"\n\t\t\t\tdata-ng-if="editable"\n\t\t\t\tdata-bootstrap-tagsinput\n\t\t\t\tdata-ng-model="tags"\n\t\t\t\tdata-typeahead-source="queryTags"\n\t\t\t\tdata-tagclass="getTagClass"\n\t\t\t\tdata-itemvalue="getValue"\n\t\t\t\tdata-itemtext="getText"\n\t\t\t\tdata-placeholder="{{labels.addTag}}"\n\t\t\t\t></div>\n\t\t<div\n\t\t\t\tclass="buttons pointer glyphicon glyphicon-remove"\n\t\t\t\tdata-ng-click="endEdit($event)"\n\t\t\t\ttitle="{{labels.endEditTooltip}}"\n\t\t\t\taria-label="{{labels.endEditTooltip}}"\n\t\t\t\t></div>\n\t\t<div\n\t\t\t\tclass="buttons pointer glyphicon glyphicon-ok"\n\t\t\t\tdata-ng-click="saveAndEndEdit($event)"\n\t\t\t\ttitle="{{labels.saveAndEndEditTooltip}}"\n\t\t\t\taria-label="{{labels.saveAndEndEditTooltip}}"\n\t\t\t\t></div>\n\t</div>\n\t<button\n\t\t\ttype="button"\n\t\t\tclass="tags-button btn btn-xs btn-default"\n\t\t\tdata-ng-class="{\'has-tags\': tags.length > 0, \'no-tags\': tags.length < 1}"\n\t\t\tdata-ng-click="startEdit($event)"\n\t\t\tdata-type="info"\n\t\t\t><span class="glyphicon glyphicon-tag"></span> {{tags.length}}</button>\n</div>')}]),angular.module("typeahead/sviTypeahead.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("typeahead/sviTypeahead.tpl.html",'<input type="{{::type}}"\n\t   class="svi-directive svi-typeahead"\n\t   data-ng-class="cls"\n\t   id="{{::id}}"\n\t   aria-label="{{ariaLabel}}"\n\t   data-ng-model="value"\n\t   data-ng-disabled="disabled"\n\t   data-ng-model-options="{ updateOn: \'default\', debounce: {default: 0}, allowInvalid: true }"\n\t   placeholder="{{placeholder}}"\n\t   data-ng-required="required" />')}]),angular.module("templates-dashboard",["dashboard/dashboard.tpl.html","displayWidget/base/displayWidget.tpl.html","displayWidget/companyLinks/companyLinks.tpl.html","displayWidget/companyNews/companyNews.tpl.html","displayWidget/companyResearch/companyResearch.tpl.html","displayWidget/marketHeadlines/marketHeadlines.tpl.html","displayWidget/markets/markets.tpl.html","displayWidget/markets/marketsDock.tpl.html","displayWidget/portfolioPctChange/portfolioPctChange.tpl.html","widget/widget.tpl.html"]),angular.module("dashboard/dashboard.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("dashboard/dashboard.tpl.html",'<div class="svi-directive svi-dashboard dashboard row" data-ng-class="{\'dragging\': dragging}">\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<div class="column-container {{getColumnClass($index)}}" data-ng-repeat="columns in resource.layout">\n\t\t<div data-ng-if="columns.length == 0" data-ng-show="dragging" class="dashboard-item">\n\t\t\t<div class="drop-target"><span data-ng-bind="labels.dragDropTarget"></span></div>\n\t\t</div>\n\t\t<div data-ng-if="panelsEnabled" data-ui-sortable="sortableConfig" data-ng-model="columns" class="dashboard-column" data-ng-class="\'dashboard-\' + type + \'-\' + id">\n\t\t\t<div class="panel panel-primary" data-ng-class="getSectionClass(sections[item])" data-ng-repeat="item in columns" data-section="{{item}}">\n\t\t\t\t<div class="panel-heading">\n\t\t\t\t\t<h2 class="panel-title"><span class="drag-handle with-icon"></span> {{sections[item].title}}</h2>\n\t\t\t\t</div>\n\t\t\t\t<div class="panel-body" data-svi-dynamic-html="sections[item].content"></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div data-ng-if="!panelsEnabled" data-ui-sortable="sortableConfig" data-ng-model="columns" class="dashboard-column" data-ng-class="\'dashboard-\' + type + \'-\' + id">\n\t\t\t<div class="dashboard-item pagebreak-after" data-ng-class="getSectionClass(sections[item])" data-ng-repeat="item in columns" data-svi-dynamic-html="sections[item].content" data-section="{{item}}"></div>\n\t\t</div>\n\t</div>\n\t<p class="instructions" data-ng-bind="labels.dashboardNotes"></p>\n</div>')}]),angular.module("displayWidget/base/displayWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("displayWidget/base/displayWidget.tpl.html",'<div class="svi-directive svi-display-widget widget widget-{{widgetSize}}" data-ng-class="overallStatus">\n\t<div class="flip-container" data-ng-class="{flip : flipped}">\n\t\t<div class="flipper">\n\t\t\t<div class="front" data-ng-class="{\'invisible\': hideFront, \'with-more-info\': moreInfo}">\n\t\t\t\t<div class="title-area drag-handle">\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleText" data-ng-bind="titleText"></h2>\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleTextPositive && (overallStatus == \'positive\')" data-ng-bind="titleTextPositive"></h2>\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleTextNegative && (overallStatus == \'negative\')" data-ng-bind="titleTextNegative"></h2>\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleTextUnchanged && (overallStatus == \'unchanged\')" data-ng-bind="titleTextUnchanged"></h2>\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleTextMixed && (overallStatus == \'mixed\')" data-ng-bind="titleTextMixed"></h2>\n\t\t\t\t</div>\n\t\t\t\t<div class="shortcut-area" data-ng-transclude="shortcuts"></div>\n\t\t\t\t<div class="widget-body">\n\t\t\t\t\t<div class="loader" data-svi-loader data-ignore-invisible="true"></div>\n\t\t\t\t\t<div class="body" data-ng-if="!listMode">\n\t\t\t\t\t\t<div class="hero"\n\t\t\t\t\t\t\t data-ng-class="{positive: (overallStatus == \'mixed\' && heroValue > 0), negative: (overallStatus == \'mixed\' && heroValue < 0)}"\n\t\t\t\t\t\t\t data-ng-show="heroValue !== false">\n\t\t\t\t\t\t\t<div class="section-label" data-ng-bind-html="heroLabel"></div>\n\t\t\t\t\t\t\t<div class="value" data-ng-bind-html="applyFilter(\'hero\')"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="sub left"\n\t\t\t\t\t\t\t data-ng-class="{positive: (overallStatus == \'mixed\' && leftValue > 0), negative: (overallStatus == \'mixed\' && leftValue < 0)}"\n\t\t\t\t\t\t\t data-ng-show="leftShow && leftValue !== false">\n\t\t\t\t\t\t\t<div class="section-label" data-ng-bind="leftLabel"></div>\n\t\t\t\t\t\t\t<div class="value" data-ng-bind-html="applyFilter(\'left\')"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="sub right"\n\t\t\t\t\t\t\t data-ng-class="{positive: (overallStatus == \'mixed\' && rightValue > 0), negative: (overallStatus == \'mixed\' && rightValue < 0)}"\n\t\t\t\t\t\t\t data-ng-show="rightShow && rightValue !== false">\n\t\t\t\t\t\t\t<div class="section-label" data-ng-bind="rightLabel"></div>\n\t\t\t\t\t\t\t<div class="value" data-ng-bind-html="applyFilter(\'right\')"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="list-body" data-ng-if="listMode">\n\t\t\t\t\t\t<ul class="list-group">\n\t\t\t\t\t\t\t<li data-ng-if="wrapContent" class="list-group-item" data-svi-dynamic-html="wrapContent"></li>\n\t\t\t\t\t\t\t<li data-ng-if="!wrapContent" class="list-group-item" data-ng-repeat="item in heroValue" data-ng-bind-html="item.value" data-ng-class="item.cls" data-ng-click="handleListClick(item)"></li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="more-info" data-ng-show="moreInfo" data-ng-click="toggleMoreInfo()">\n\t\t\t\t\t{{labels.moreInfo}} <span class="glyphicon glyphicon-circle-arrow-right"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="back" data-ng-class="{invisible: hideBack}">\n\t\t\t\t<div class="title-area drag-handle">\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleText" data-ng-bind="titleText"></h2>\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleTextPositive && (overallStatus == \'positive\')" data-ng-bind="titleTextPositive"></h2>\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleTextNegative && (overallStatus == \'negative\')" data-ng-bind="titleTextNegative"></h2>\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleTextUnchanged && (overallStatus == \'unchanged\')" data-ng-bind="titleTextUnchanged"></h2>\n\t\t\t\t\t<h2 class="title-text" data-ng-if="titleTextMixed && (overallStatus == \'mixed\')" data-ng-bind="titleTextMixed"></h2>\n\t\t\t\t</div>\n\t\t\t\t<div class="shortcut-area" data-ng-transclude="shortcuts"></div>\n\t\t\t\t<div class="widget-body">\n\t\t\t\t\t<p data-ng-bind-html="moreInfo"></p>\n\t\t\t\t\t<div class="more-info" data-ng-click="toggleMoreInfo()">\n\t\t\t\t\t\t<span class="glyphicon glyphicon-circle-arrow-left"></span> {{labels.moreInfoBack}}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("displayWidget/companyLinks/companyLinks.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("displayWidget/companyLinks/companyLinks.tpl.html",'<div class="svi-directive svi-company-links-display-widget">\n\t<div data-svi-display-widget\n\t\t data-title-text="labels.companyLinksTitle"\n\t\t data-hero-value="list"\n\t\t\t></div>\n</div>')}]),angular.module("displayWidget/companyNews/companyNews.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("displayWidget/companyNews/companyNews.tpl.html",'<div class="svi-directive svi-company-news-display-widget">\n\t<div data-svi-display-widget\n\t\t data-title-text="labels.companyNewsTitle"\n\t\t data-hero-value="list"\n\t\t\t></div>\n</div>')}]),angular.module("displayWidget/companyResearch/companyResearch.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("displayWidget/companyResearch/companyResearch.tpl.html",'<div class="svi-directive svi-company-research-display-widget">\n\t<div data-svi-display-widget\n\t\t data-title-text="labels.companyResearchTitle"\n\t\t data-hero-value="list"\n\t\t></div>')}]),angular.module("displayWidget/marketHeadlines/marketHeadlines.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("displayWidget/marketHeadlines/marketHeadlines.tpl.html",'<div class="svi-directive svi-market-headlines-display-widget">\n\t<div data-svi-display-widget\n\t\t data-title-text="labels.marketHeadlinesTitle"\n\t\t data-hero-value="list"\n\t\t data-more-info="moreInfo"\n\t\t\t></div>\n\n\t<div class="modal fade" tabindex="-1" role="dialog">\n\t\t<div class="modal-dialog modal-lg" role="document">\n\t\t\t<div class="modal-content">\n\t\t\t\t<div class="modal-header">\n\t\t\t\t\t<h1 class="modal-title" data-ng-bind-html="newsStoryHeadline"></h1>\n\t\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="api.hideModal()" aria-label="Close"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="modal-body">\n\t\t\t\t\t<div class="loader" data-svi-loader data-ignore-invisible="true"></div>\n\t\t\t\t\t<div class="story-body" data-ng-bind-html="newsStory"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("displayWidget/markets/markets.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("displayWidget/markets/markets.tpl.html",'<div class="svi-directive svi-markets-display-widget">\n\t<div data-svi-display-widget\n\t\t data-title-text-positive="labels.marketsTitlePositive"\n\t\t data-title-text-negative="labels.marketsTitleNegative"\n\t\t data-title-text-unchanged="labels.marketsTitleUnchanged"\n\t\t data-title-text-mixed="labels.marketsTitleMixed"\n\t\t data-hero-value="sp.pctChange"\n\t\t data-hero-label="labels.marketsSP"\n\t\t data-hero-filter="percent"\n\t\t data-left-value="nasdaq.pctChange"\n\t\t data-left-label="labels.marketsNASDAQ"\n\t\t data-left-filter="percent"\n\t\t data-right-value="dji.pctChange"\n\t\t data-right-label="labels.marketsDJI"\n\t\t data-right-filter="percent"\n\t\t data-more-info="moreInfo"\n\t\t\t></div>\n</div>')}]),angular.module("displayWidget/markets/marketsDock.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("displayWidget/markets/marketsDock.tpl.html",'<div class="svi-directive svi-markets-display-widget markets-dock">\n\t<div data-svi-loader data-ignore-invisible="true"></div>\n\t<div data-ng-show="dji && showDji" class="market-display">\n\t\t<div class="displayCol">\n\t\t\t<div class="market-label" data-ng-bind="labels.marketsDJI"></div>\n\t\t\t<div data-ng-if="!isClosed" class="market-dollar-value" data-ng-bind="dji.lastPrice|sviCurrency:null:\'\'"></div>\n\t\t\t<div data-ng-if="isClosed" class="market-dollar-value" data-ng-bind="labels.futures"></div>\n\t\t</div>\n\t\t<div class="displayCol">\n\t\t\t<div class="market-pct-change">\n\t\t\t\t<span data-ng-bind-html="dji.change|currencyChange:true:\'\'"></span>\n\t\t\t\t<span class="number parenChangePercent" data-ng-bind-html="dji.pctChange | percentChange"></span>\n\t\t\t</div>\n\t\t\t<div class="as-of-date">\n\t\t\t\t{{labels.asOf}} {{dji.quoteTime | sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div data-ng-show="sp" class="market-display">\n\t\t<div class="displayCol">\n\t\t\t<div class="market-label" data-ng-bind="labels.marketsSP"></div>\n\t\t\t<div data-ng-if="!isClosed" class="market-dollar-value" data-ng-bind="sp.lastPrice|sviCurrency:null:\'\'"></div>\n\t\t\t<div data-ng-if="isClosed" class="market-dollar-value" data-ng-bind="labels.futures"></div>\n\t\t</div>\n\t\t<div class="displayCol">\n\t\t\t<div class="market-pct-change">\n\t\t\t\t<span data-ng-bind-html="sp.change|currencyChange:true:\'\'"></span>\n\t\t\t\t<span class="number parenChangePercent" data-ng-bind-html="sp.pctChange | percentChange"></span>\n\t\t\t</div>\n\t\t\t<div class="as-of-date">\n\t\t\t\t{{labels.asOf}} {{sp.quoteTime | sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div data-ng-show="nasdaq" class="market-display">\n\t\t<div class="displayCol">\n\t\t\t<div class="market-label" data-ng-bind="labels.marketsNASDAQ"></div>\n\t\t\t<div data-ng-if="!isClosed" class="market-dollar-value" data-ng-bind="nasdaq.lastPrice|sviCurrency:null:\'\'"></div>\n\t\t\t<div data-ng-if="isClosed" class="market-dollar-value" data-ng-bind="labels.futures"></div>\n\t\t</div>\n\t\t<div class="displayCol">\n\t\t\t<div class="market-pct-change">\n\t\t\t\t<span data-ng-bind-html="nasdaq.change|currencyChange:true:\'\'"></span>\n\t\t\t\t<span class="number parenChangePercent" data-ng-bind-html="nasdaq.pctChange | percentChange"></span>\n\t\t\t</div>\n\t\t\t<div class="as-of-date">\n\t\t\t\t{{labels.asOf}} {{nasdaq.quoteTime | sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class="market-display"\n\t     data-ng-if="marketClockActive"\n\t     data-svi-market-clock\n\t     data-open-time="{{openTime}}"\n\t     data-close-time="{{closeTime}}"\n\t></div>\n</div>\n')}]),angular.module("displayWidget/portfolioPctChange/portfolioPctChange.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("displayWidget/portfolioPctChange/portfolioPctChange.tpl.html",'<div class="svi-directive svi-portfolio-pct-change-display-widget" data-svi-display-widget\n\t data-title-text-positive="labels.portfolioPctChangeTitlePositive"\n\t data-title-text-negative="labels.portfolioPctChangeTitleNegative"\n\t data-title-text-unchanged="labels.portfolioPctChangeTitleUnchanged"\n\t data-title-text-mixed="labels.portfolioPctChangeTitleMixed"\n\t data-hero-value="heroValue"\n\t data-hero-filter="percent"\n\t data-more-info="moreInfo"\n\t data-default-widget-size="5"\n\t></div>\n')}]),angular.module("widget/widget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("widget/widget.tpl.html",'<div class="svi-directive svi-widget widget" data-ng-class="widgetClasses" data-ng-hide="hidden">\n    <div class="flip-container" data-ng-class="{flip : flipped}">\n        <div class="flipper">\n            <div class="front" data-ng-class="{invisible: hideFront}">\n                <div class="title-area drag-handle">\n                    <h2 class="title-text" data-ng-bind="title"></h2>\n                    <span data-ng-if="message" data-svi-help data-message="{{ message }}"></span>\n                </div>\n                <div class="shortcut-area" data-ng-transclude="shortcuts"></div>\n                <div class="widget-body">\n                    <div data-ng-if="includeLoader" class="loader" data-svi-loader data-callback="api.setLoader"></div>\n                    <div data-ng-if="mode == \'wrapper\'" class="list-body">\n                        <ul class="list-group">\n                            <li class="list-group-item" data-ng-transclude="frontBody"></li>\n                        </ul>\n                    </div>\n                    <div data-ng-if="mode == \'body\'" class="front-body" data-ng-transclude="frontBody"></div>\n                </div>\n            </div>\n            <div class="back" data-ng-class="{invisible: hideBack}">\n                <div class="title-area drag-handle">\n                    <h2 class="title-text" data-ng-bind="title"></h2>\n                </div>\n                <div class="shortcut-area" data-ng-transclude="shortcuts"></div>\n                <div class="widget-body">\n                    <div data-ng-if="mode == \'wrapper\'" class="list-body">\n                        <ul class="list-group">\n                            <li class="list-group-item" data-ng-transclude="backBody"></li>\n                        </ul>\n                    </div>\n                    <div data-ng-if="mode == \'body\'" class="back-body" data-ng-transclude="backBody"></div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n')}]),angular.module("templates-docShare",["docShareContainer/docShareContainer.tpl.html","docShareGrid/deleteDocSharePopover.tpl.html","docShareModal/docShareModal.tpl.html","docShareUpload/docShareFileOverwitePopover.tpl.html","docShareUpload/docShareUpload.tpl.html"]),angular.module("docShareContainer/docShareContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("docShareContainer/docShareContainer.tpl.html",'<div class="svi-directive row"><div class="col-md-12" data-svi-loader data-callback="setLoader"></div></div>\n<div class="row data-svi-doc-share-container" data-ng-show="docShare">\n\t<div class="col-md-12">\n\t\t<div class="row">\n\t\t\t<div class="col-md-6"><h3 data-ng-bind="labels.investorViewGridTitle"></h3></div>\n\t\t\t<div class="col-md-6"><span class="pull-right"><button type="button" class="btn btn-primary" data-ng-click="showUploadForm()" data-ng-bind="labels.uploadFileButton"></button></span></div>\n\t\t</div>\n\t\t<div class="modal fade svi-doc-share-upload-modal" id="svi-doc-share-upload-modal" tabindex="-1" role="dialog" aria-labelledby="sviDocShareUploadModalLabelTitle">\n\t\t\t<div class="modal-dialog modal-md" role="document">\n\t\t\t\t<div class="modal-content">\n\t\t\t\t\t<div class="modal-header">\n\t\t\t\t\t\t<h1 class="modal-title" id="sviDocShareUploadModalLabelTitle" data-ng-bind="labels.uploadFormTitle"></h1>\n\t\t\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="hideUploadForm()" aria-label="Close"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="modal-body">\n\t\t\t\t\t\t<div class="svi-doc-share-upload"\n\t\t\t\t\t\t\t data-svi-doc-share-upload\n\t\t\t\t\t\t\t data-is-advisor={{isAdvisor}}></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row paging-top" data-ng-show="pageSize">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="DOCSHARE" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-md-12" data-svi-doc-share-grid\n\t\t\t\t data-columns="columns"\n\t\t\t\t data-doc-share="docShare"\n\t\t\t\t data-sort-field="sortField"\n\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t data-is-advisor={{isAdvisor}}></div>\n\t\t</div>\n\t\t<div class="row paging-bottom" data-ng-show="pageSize">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="DOCSHARE" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("docShareGrid/deleteDocSharePopover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("docShareGrid/deleteDocSharePopover.tpl.html",'<div class="svi-directive svi-delete-docshare-popover popover">\n\t<div class="arrow"></div>\n\t<div class="popover-content">\n\t\t<p data-ng-bind="labels.confirmDeleteDocshare"></p>\n\t\t<div class="docShare-confirm-buttons">\n\t\t\t<button type="button" data-ng-click="deleteFile(documentId)" class="btn btn-danger docshare-confirm-delete" data-ng-bind="labels.docShareDelete"></button>\n\t\t\t<button type="button" data-ng-click="hideDeleteDocSharePopover(documentId)" class="btn btn-default docshare-confirm-cancel" data-ng-bind="labels.docShareConfirmCancel"></button>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("docShareModal/docShareModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("docShareModal/docShareModal.tpl.html",'<div class="svi-directive docShareModal modal fade " tabindex="-1" role="dialog" aria-labelledby="sviDocShareModalLabelTitle" id="docShareModal">\n\t<div class="modal-dialog modal-md" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 class="modal-title" id="sviDocShareModalLabelTitle" data-ng-bind="labels.uploadFormTitle"></h1>\n\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="hideUploadForm()" aria-label="Close"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-body">\n\t\t\t\t<div class="container">\n\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div class="container">\n\t\t\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t\t\t<div data-svi-doc-share-container\n\t\t\t\t\t\t\t\t\t\t data-columns="{{columns}}"\n\t\t\t\t\t\t\t\t\t\t data-page-size="{{pageSize}}"\n\t\t\t\t\t\t\t\t\t\t data-is-modal="true"\n\t\t\t\t\t\t\t\t\t\t data-is-advisor="{{isAdvisor}}"\n\t\t\t\t\t\t\t\t\t></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("docShareUpload/docShareFileOverwitePopover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("docShareUpload/docShareFileOverwitePopover.tpl.html",'<div popover class="svi-directive svi-overwritefile-docshare-popover popover">\n\t<div class="arrow"></div>\n\t<div class="popover-content">\n\t\t<p data-ng-bind="title"></p>\n\t\t<div class="docShare-confirm-buttons">\n\t\t\t<button type="button" data-ng-click="upload(true)" class="btn btn-danger docshare-confirm-overwrite" data-ng-bind="labels.confirmOverwriteDocshare"></button>\n\t\t\t<button type="button" data-ng-click="hideOverwritePopover()" class="btn btn-default docshare-confirm-cancel" data-ng-bind="labels.docShareConfirmCancel"></button>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("docShareUpload/docShareUpload.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("docShareUpload/docShareUpload.tpl.html",'<div data-svi-loader data-callback="setLoader"></div>\n<div class="svi-directive svi-doc-share-upload">\n\t<div data-svi-loader data-callback="setSubmitLoader" data-max-retries="0" class="col-sm-12"></div>\n\t<div data-ng-form class="uploadFormPanel" data-ng-hide="fileUploadSuccess">\n\t\t<form class="docShareUploadForm" name="docShareUploadForm" role="form" data-ng-submit="docShareUploadForm.submitTheForm()" >\n\t\t\t<div class="form-group">\n\t\t\t\t<p>Upload a file to the following account</p>\n\t\t\t</div>\n\t\t\t<div class="form-group accountDropdown" data-ng-required >\n\t\t\t\t<label class="control-label" for="{{::id}}-account" data-ng-bind="labels.account"></label>\n\t\t\t\t<div id="{{::id}}-account" data-svi-account-dropdown></div>\n\t\t\t</div>\n\t\t\t<div class="form-group fileInput">\n\t\t\t\t<input type="file" class="btn btn-default" data-ng-model="uploadForm.docShareFile"  data-ng-required="true" name="uploadForm.docShareFile"/>\n\t\t\t</div>\n\t\t\t<div class="form-group">\n\t\t\t\t\t<input\n\t\t\t\t\t\tid="isShared"\n\t\t\t\t\t\ttype="checkbox" \n\t\t\t\t\t\tname="isShared" \n\t\t\t\t\t\tng-true-value="\'Y\'" \n\t\t\t\t\t\tng-false-value="\'N\'" \n\t\t\t\t\t\tdata-ng-checked="selectAll" \n\t\t\t\t\t\tdata-ng-model="uploadForm.isShared" />\n\t\t\t\t\t<label class="isShared" for="isShared">Share this file with all users with access to this account</label>\n\t\t\t</div>\n\t\t\t<div class="form-group button-group">\n\t\t\t\t<button type="submit"  class="btn btn-primary upload-submit" data-ng-click="upload(false)" data-ng-bind="labels.uploadFileButton" ></button>\n\t\t\t\t<button type="button" class="btn btn-default upload-cancel" data-ng-click="btnCancel()">Cancel</button>\n\t\t\t</div>\n\t\t</form>\n\t</div>\n\t<div class="uploadSuccessPanel" data-ng-show="fileUploadSuccess">\n\t\t<div class="form-group button-group">\n\t\t\t<button type="button" class="btn btn-primary center-block success-confirm" data-ng-click="btnCancel()">Ok</button>\n\t\t</div>\n\t</div>\n</div>\n\t\t\t\t\t\t\t\t')}]),angular.module("templates-gainLoss",["gainLossFilterControls/gainLossFilterControls.tpl.html","gainLossOverview/gainLossOverview.tpl.html","realizedGainLossContainer/realizedGainLossContainer.tpl.html","rglSummary/rglSummary.tpl.html","unrealizedGainLossContainer/unrealizedGainLossContainer.tpl.html"]),angular.module("gainLossFilterControls/gainLossFilterControls.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("gainLossFilterControls/gainLossFilterControls.tpl.html",'<div class="svi-directive svi-gain-loss-filter-controls">\n\t<div class="gain-loss-filters">\n\t\t<div class="multi-account-dropdown filter-item"\n\t\t\t\t data-svi-multi-select-dropdown\n\t\t\t\t data-ng-if="accountDropdownItems !== null"\n\t\t\t\t data-options="{{accountDropdownItems}}"\n\t\t\t\t data-aria-label="{{labels.accountsDropdownLabel}}"\n\t\t\t\t data-description="{{labels.accountDropdownDescription}}"\n\t\t\t\t data-dropdown-menu-label="{{accountDropdownMenuTitle}}"\n\t\t\t\t data-filter-input-placeholder="{{labels.filterAccountsInputPlaceholder}}"\n\t\t\t\t data-disabled="{{isAccountDropdownDisabled}}"\n\t\t\t\t data-event-id="{{accountDropdownEventId}}"\n\t\t\t\t data-error-message="{{labels.accountsErrorValidationText}}"></div>\n\t\t<div class="symbol-input filter-item"\n\t\t\t\t data-ng-if="isUGL && groupBy !== \'account\'"\n\t\t\t\t data-svi-filter-text\n\t\t\t\t data-title="{{labels.symbolInputTitle}}"\n\t\t\t\t data-event-id="{{symbolInputEventId}}"\n\t\t\t\t data-state-id="ugl-multiAccountSymbol"\n\t\t\t\t data-capitalize="true"\n\t\t\t\t data-delay="250"\n\t\t\t\t data-is-state-disabled="true"\n\t\t\t\t data-is-label-for-sr-only="false"></div>\n\t\t<div class="asset-type-dropdown filter-item"\n\t\t\t\t data-ng-if="!groupBy || isCustomView()"\n\t\t\t\t data-svi-filter-multi-dropdown\n\t\t\t\t data-event-id="{{assetTypeEventId}}"\n\t\t\t\t data-options="{{assetTypes}}"\n\t\t\t\t data-state-id="ugl-multiAccountAssetType"\n\t\t\t\t data-title="{{labels.allAssetTypes}}"\n\t\t\t\t data-selected-label="{{labels.assetTypes}}"\n\t\t\t\t data-filter="true"\n\t\t\t\t data-select-all="true"\n\t\t\t\t data-aria-label="{{labels.assetTypes}}"\n\t\t\t\t data-is-state-disabled="true"></div>\n\t\t<div class="term-type-dropdown filter-item"\n\t\t\t\t data-ng-if="!groupBy || isCustomView()"\n\t\t\t\t data-svi-filter-dropdown\n\t\t\t\t data-label-text="{{labels.termTypesDropdownTitle}}"\n\t\t\t\t data-event-id="{{termTypeEventId}}"\n\t\t\t\t data-options="{{termTypes}}"\n\t\t\t\t data-state-id="ugl-multiAccountTermType"\n\t\t\t\t data-title="{{labels.allTermTypes}}"\n\t\t\t\t data-aria-label="{{labels.termTypes}}"\n\t\t\t\t data-is-state-disabled="true"\n\t\t\t\t data-disabled="{{!!groupBy.length && !isSingleAccountSelected}}"></div>\n\t\t<div class="year-dropdown filter-item"\n\t\t\t\t data-svi-filter-dropdown\n\t\t\t\t data-ng-if="isRGL"\n\t\t\t\t data-label-text="{{labels.yearDropdownTitle}}"\n\t\t\t\t data-event-id="{{yearTypeEventId}}"\n\t\t\t\t data-options="{{yearTypes}}"\n\t\t\t\t data-state-id="rgl-yearType"\n\t\t\t\t data-is-state-disabled="true"\n\t\t\t\t data-title="{{labels.filterYearType}}"\n\t\t\t\t data-aria-label="{{labels.filterYearType}}"></div>\n\t\t<div class="gain-loss-date-range filter-item"\n\t\t\t\t data-svi-filter-date-range\n\t\t\t\t data-ng-if="isRGL"\n\t\t\t\t data-event-id="{{dateRangeEventId}}"\n\t\t\t\t data-state-id="rgl-dateRange"\n\t\t\t\t data-max-date="today"\n\t\t\t\t data-label-class="*EMPTY*"\n\t\t\t\t data-from-label="{{labels.fromDate}}"\n\t\t\t\t data-to-label="{{labels.untilDate}}"\n\t\t\t\t data-fire-event-immediately="true"\n\t\t\t\t data-is-state-disabled="true"></div>\n\t\t<div class="group-by-dropdown filter-item"\n\t\t\t\t data-ng-class="{\'group-by-rgl\': isRGL}"\n\t\t\t\t data-svi-filter-dropdown\n\t\t\t\t data-ng-if="(!isGroupByDisabled || isCustomView()) && groupByOptions !== null && groupByOptions.length > 0 && accountDropdownItems !== null"\n\t\t\t\t data-event-id="{{groupByEventId}}"\n\t\t\t\t data-options="{{groupByOptions}}"\n\t\t\t\t data-state-id="groupByStateId"\n\t\t\t\t data-title="{{labels.groupByTitle}}"\n\t\t\t\t data-aria-label="{{labels.groupByTitle}}"\n\t\t\t\t data-label-text="{{labels.groupByTitle}}"\n\t\t\t\t data-is-state-disabled="true"></div>\n\t</div>\n\t<div class="button-controls">\n\t\t<button class="btn btn-primary apply-button" data-ng-click="onApplyButtonClick()">\n\t\t\t{{labels.apply}}\n\t\t</button>\n\t\t<button class="btn btn-outline-primary clear-button" data-ng-click="onResetButtonClick()">\n\t\t\t{{labels.clear}}\n\t\t</button>\n\t</div>\n</div>')}]),angular.module("gainLossOverview/gainLossOverview.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("gainLossOverview/gainLossOverview.tpl.html",'<div class="svi-directive svi-gain-loss-overview" data-svi-widget data-title="labels.glOverviewTitle">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group with-border">\n\t\t\t\t<li class="list-group-item" data-ng-if="glOverview">\n\t\t\t\t\t<h3 data-ng-bind="labels.glOverviewUnrealizedTitle"></h3>\n\t\t\t\t\t<dl class="dl-horizontal">\n\t\t\t\t\t\t<dt data-ng-bind="labels.glOverviewUnrealizedLabel"></dt>\n\t\t\t\t\t\t<dd data-ng-bind-html="glOverview.unrealizedGainLoss|currencyChange"></dd>\n\t\t\t\t\t</dl>\n\t\t\t\t\t<div class="note" data-ng-bind="labels.glOverviewUGLNote"></div>\n\t\t\t\t</li>\n\t\t\t\t<li class="list-group-item" data-ng-if="glOverview">\n\t\t\t\t\t<h3 data-ng-bind="labels.glOverviewRealizedTitle"></h3>\n\t\t\t\t\t<dl class="dl-horizontal">\n\t\t\t\t\t\t<dt data-ng-bind="labels.glOverviewCurrentYear"></dt>\n\t\t\t\t\t\t<dd data-ng-bind-html="glOverview.currentYearGainLoss|currencyChange"></dd>\n\t\t\t\t\t\t<dt data-ng-bind="labels.glOverviewPriorYear"></dt>\n\t\t\t\t\t\t<dd data-ng-bind-html="glOverview.priorYearGainLoss|currencyChange"></dd>\n\t\t\t\t\t</dl>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("realizedGainLossContainer/realizedGainLossContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("realizedGainLossContainer/realizedGainLossContainer.tpl.html",'<div class="svi-directive svi-realized-gain-loss-container row">\n\t<div data-svi-loader\n\t\t\t data-ng-if="!isAdvanced"\n\t\t\t class="col-md-12"\n\t\t\t data-callback="setLoader"\n\t\t\t data-custom-error="{{technicalError}}"></div>\n\t<div class="col-md-12">\n\t\t<div class="col-md-12" data-ng-show="costbasis.gainLoss.length">\n\t\t\t<div class="pull-right clear-right" data-ng-show="costbasis.accountDefaultLRM">\n\t\t\t\t<span class="lotReliefMethodText"\n\t\t\t\t\t\t\tdata-ng-bind="labels.defaultLRM"></span>:\n\t\t\t\t<span class="lotReliefMethod" data-ng-bind="costbasis.accountDefaultLRM"></span>\n\t\t\t</div>\n\t\t\t<div class="pull-right clear-right" data-ng-show="costbasis.mutualFundDefaultLRM">\n\t\t\t\t<span class="lotReliefMethodText"\n\t\t\t\t\t\t\tdata-ng-bind="labels.mFundDefaultLRM"></span>:\n\t\t\t\t<span class="lotReliefMethod" data-ng-bind="costbasis.mutualFundDefaultLRM"></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row paging-top" data-ng-show="pageSize">\n\t\t\t<div data-svi-paging-control\n\t\t\t\t\t class="col-md-12"\n\t\t\t\t\t data-ng-if="!!costbasis"\n\t\t\t\t\t data-event-id="RGL"\n\t\t\t\t\t data-current-page="currentPage"\n\t\t\t\t\t data-total-pages="totalPages"></div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-md-12"\n\t\t\t\t\t data-svi-realized-gain-loss-grid\n\t\t\t\t\t data-columns="columns"\n\t\t\t\t\t data-grid-template="{{gridTemplate}}"\n\t\t\t\t\t data-totals-config="totalsConfig"\n\t\t\t\t\t data-column-priority="currentColumnPriority"\n\t\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t\t data-costbasis="costbasis"\n\t\t\t\t\t data-event-map="eventMap"\n\t\t\t\t\t data-sort-field="sortField"\n\t\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t\t data-asset-types="{{assetTypes}}"\n\t\t\t\t\t data-term-types="{{termTypes}}"\n\t\t\t\t\t data-year-types="{{yearTypes}}"\n\t\t\t\t\t data-options="{{options}}"\n\t\t\t\t\t data-group-by-options="{{groupByOptions}}"\n\t\t\t\t\t data-is-group-by-disabled="{{isGroupByDisabled}}"\n\t\t\t\t\t data-is-account-dropdown-disabled="{{isAccountDropdownDisabled}}"\n\t\t\t\t\t data-is-single-account-selected="isSingleAccountSelected"\n\t\t\t\t\t data-group-by="groupBy"\n\t\t\t\t\t data-are-totals-shown="{{areTotalsShown}}"></div>\n\t\t\t<div data-svi-loader\n\t\t\t\t\t data-ng-if="isAdvanced"\n\t\t\t\t\t class="col-md-12"\n\t\t\t\t\t data-callback="setLoader"\n\t\t\t\t\t data-custom-error="{{technicalError}}"></div>\n\t\t</div>\n\t\t<div class="row paging-bottom" data-ng-show="pageSize">\n\t\t\t<div data-svi-paging-control\n\t\t\t\t\t data-ng-if="!!costbasis"\n\t\t\t\t\t class="col-md-12"\n\t\t\t\t\t data-event-id="RGL"\n\t\t\t\t\t data-current-page="currentPage"\n\t\t\t\t\t data-total-pages="totalPages"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("rglSummary/rglSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("rglSummary/rglSummary.tpl.html",'<div class="svi-directive rgl-summary rgl-summary-modal modal" tabindex="-1" role="dialog" aria-labelledby="rglSummaryModalTitle" id="rglSummaryModal">\n\t<div data-ng-show="costbasis">\n\t\t<div class="modal-dialog modal-md" role="document">\n\t\t\t<div class="modal-content pull-left">\n\t\t\t\t<div class="modal-header">\n\t\t\t\t\t<h1 class="title" id="rglSummaryModalTitle" data-ng-bind="labels.rglSummaryTitle"></h1>\n\t\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="hideMore()" aria-label="Close"></div>\n\t\t\t\t\t<div data-ng-if="modalShowDropdown">\n\t\t\t\t\t\t<div data-ng-if="priorYearDropdown" data-svi-filter-dropdown\n\t\t\t\t\t\t\tdata-event-id="RGL_SUMMARY.YEAR_TYPE"\n\t\t\t\t\t\t\tdata-state-id="rglSummary-priorYear"\n\t\t\t\t\t\t\tdata-selected="{{priorYear}}"\n\t\t\t\t\t\t\tdata-options="{{priorYearDropdown}}">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="modal-body pull-left">\n\t\t\t\t\t<table class="table table-striped">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th>&nbsp;<span class="svi-visually-hidden">Description</span></th>\n\t\t\t\t\t\t\t\t<th class="currency" data-ng-bind-html="labels.rglSummaryGain"></th>\n\t\t\t\t\t\t\t\t<th class="currency" data-ng-bind-html="labels.rglSummaryLoss"></th>\n\t\t\t\t\t\t\t\t<th class="currency" data-ng-bind-html="labels.rglSummaryNetRealizedGainLoss"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td role="rowheader" class="total" data-ng-bind-html="labels.rglSummaryShortTerm"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="costbasis.grandTotals.shortTermGain|currencyIndicator"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="costbasis.grandTotals.shortTermLoss|currencyIndicator"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="costbasis.grandTotals.shortTermGainLoss|currencyIndicator"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td role="rowheader" class="total" data-ng-bind-html="labels.rglSummaryLongTerm"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="costbasis.grandTotals.longTermGain|currencyIndicator"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="costbasis.grandTotals.longTermLoss|currencyIndicator"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="costbasis.grandTotals.longTermGainLoss|currencyIndicator"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t<tfoot>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td role="rowheader" class="total" data-ng-bind="labels.rglSummaryTotal"></td>\n\t\t\t\t\t\t\t\t<td class="total currency" data-ng-bind-html="costbasis.grandTotals.gain|currencyIndicator"></td>\n\t\t\t\t\t\t\t\t<td class="total currency" data-ng-bind-html="costbasis.grandTotals.loss|currencyIndicator"></td>\n\t\t\t\t\t\t\t\t<td class="total currency" data-ng-bind-html="costbasis.grandTotals.gainLoss|currencyIndicator"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tfoot>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("unrealizedGainLossContainer/unrealizedGainLossContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("unrealizedGainLossContainer/unrealizedGainLossContainer.tpl.html",'<div class="svi-directive svi-unrealized-gain-loss-container row">\n\t<div class="col-md-12"\n\t\t\t data-ng-if="!isAdvanced"\n\t\t\t data-svi-loader\n\t\t\t data-callback="setLoader"\n\t\t\t data-custom-error="{{technicalError}}"></div>\n\t<div class="col-md-12">\n\t\t<div class="col-md-12">\n\t\t\t<div class="pull-right clear-right" data-ng-show="costbasis.accountDefaultLRM">\n\t\t\t\t<span class="lotReliefMethodText" data-ng-bind="labels.defaultLRM"></span>:\n\t\t\t\t<span class="lotReliefMethod" data-ng-bind="costbasis.accountDefaultLRM"></span>\n\t\t\t</div>\n\t\t\t<div class="pull-right clear-right" data-ng-show="costbasis.mutualFundDefaultLRM">\n\t\t\t\t<span class="lotReliefMethodText" data-ng-bind="labels.mFundDefaultLRM"></span>:\n\t\t\t\t<span class="lotReliefMethod" data-ng-bind="costbasis.mutualFundDefaultLRM"></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" data-ng-if="!isAdvanced">\n\t\t\t<h5 class="col-md-4 pull-right currency totalDailyChange" data-ng-show="showTotalDailyChange && costbasis.totals.dailyChange">\n\t\t\t\t<span data-ng-bind="labels.totalDailyChange"></span>:\n\t\t\t\t<span class="securitiesValue"\n\t\t\t\t\t\t\tdata-ng-bind-html="costbasis.totals.dailyChange|currencyPctIndicator:costbasis.totals.pctDailyChange"></span>\n\t\t\t</h5>\n\t\t\t<h5 class="col-md-4 pull-right currency totalGainLoss"\n\t\t\t\t\tdata-ng-show="showTotalGainLoss && costbasis.totals.gainLoss">\n\t\t\t\t<span data-ng-bind="labels.totalGainLoss"></span>:\n\t\t\t\t<span class="securitiesValue"\n\t\t\t\t\t\t\tdata-ng-bind-html="costbasis.totals.gainLoss|currencyPctIndicator:costbasis.totals.pctGainLoss"></span>\n\t\t\t</h5>\n\t\t\t<h5 class="col-md-4 pull-right currency totalPurchaseCost"\n\t\t\t\t\tdata-ng-show="showTotalPurchaseCost && costbasis.totals.purchaseCost">\n\t\t\t\t<span data-ng-bind="labels.totalPurchaseCost"></span>:\n\t\t\t\t<span class="securitiesValue" data-ng-bind="costbasis.totals.purchaseCost|sviCurrency"></span>\n\t\t\t</h5>\n\t\t</div>\n\t\t<div class="row paging-top" data-ng-show="pageSize && costbasis.gainLoss.length">\n\t\t\t<div data-svi-paging-control\n\t\t\t\t\t data-ng-if="!!costbasis"\n\t\t\t\t\t class="col-md-12"\n\t\t\t\t\t data-event-id="UGL"\n\t\t\t\t\t data-current-page="currentPage"\n\t\t\t\t\t data-total-pages="totalPages"></div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div data-svi-unrealized-gain-loss-grid\n\t\t\t\t\t class="col-md-12"\n\t\t\t\t\t data-grid-template="{{gridTemplate}}"\n\t\t\t\t\t data-columns="columns"\n\t\t\t\t\t data-totals-config="totalsConfig"\n\t\t\t\t\t data-column-priority="currentColumnPriority"\n\t\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t\t data-options="{{options}}"\n\t\t\t\t\t data-costbasis="costbasis"\n\t\t\t\t\t data-event-map="eventMap"\n\t\t\t\t\t data-sort-field="sortField"\n\t\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t\t data-asset-types="{{assetTypes}}"\n\t\t\t\t\t data-term-types="{{termTypes}}"\n\t\t\t\t\t data-group-by-options="{{groupByOptions}}"\n\t\t\t\t\t data-is-group-by-disabled="{{isGroupByDisabled}}"\n\t\t\t\t\t data-is-account-dropdown-disabled="{{isAccountDropdownDisabled}}"\n\t\t\t\t\t data-group-by="groupBy"\n\t\t\t\t\t data-is-single-account-selected="isSingleAccountSelected"\n\t\t\t\t\t data-are-totals-shown="{{areTotalsShown}}"></div>\n\t\t\t<div class="col-md-12"\n\t\t\t\t\t data-ng-if="isAdvanced"\n\t\t\t\t\t data-svi-loader\n\t\t\t\t\t data-callback="setLoader"\n\t\t\t\t\t data-custom-error="{{technicalError}}"></div>\n\t\t</div>\n\t\t<div class="row paging-bottom" data-ng-show="pageSize && costbasis.gainLoss.length">\n\t\t\t<div data-svi-paging-control\n\t\t\t\t\t data-ng-if="!!costbasis"\n\t\t\t\t\t class="col-md-12"\n\t\t\t\t\t data-event-id="UGL"\n\t\t\t\t\t data-current-page="currentPage"\n\t\t\t\t\t data-total-pages="totalPages"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("templates-grid",["columnHeader/columnHeader.tpl.html","customView/customView.tpl.html"]),angular.module("columnHeader/columnHeader.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("columnHeader/columnHeader.tpl.html",'\x3c!-- note: svi-column-header uses white-space: pre which means any whitespace will not be collapsed so do not break these lines up --\x3e\n<span class="svi-directive svi-column-header"\n      data-ng-click="onClick()"\n      data-ng-class="{pointer: sortable, disabled: !sortable}"\n      tabindex="{{sortable ? \'0\' :\'-1\'}}"\n      data-event="{{::eventId}}.{{::sortField}}"\n      aria-disabled="{{!sortable}}"\n      aria-sort="{{sortable && sortDir === \'asc\' ? \'ascending\': \'descending\'}}">\n\t<span class="header-text"\n          data-ng-bind-html="text"\n          data-ng-class="{\'svi-visually-hidden\': hideLabel}"></span>\n\t<span data-ng-if="sortable && sortDir"\n          aria-label="{{sortIconAriaLabel}}"\n          class="pad-left-10 sort-icon {{sortClass}}"></span>\n\t<span data-ng-if="sortable"\n\t\t  aria-live="polite"\n\t\t  class="sr-only">\n\t\t<span data-ng-if="sortable && sortDir" class="sr-only">{{labels.sorted}} {{sortDir === \'asc\' ? labels.ascending : labels.descending}}</span>\n\t</span>\n</span>')}]),angular.module("customView/customView.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("customView/customView.tpl.html",'<div class="svi-directive custom-view">\n\t<div class="row">\n\t\t<div class="well message"\n\t\t\t\t data-ng-show="message"\n\t\t\t\t data-ng-bind="message"></div>\n\t\t<div class="well spinner"\n\t\t\t\t data-ng-show="showSpinner">\n\t\t\t<i class="fa fa-2x fa-spinner fa-spin"></i>\n\t\t\t<span data-ng-bind="labels.saving"></span>...\n\t\t</div>\n\t</div>\n\t<div class="row">\n\t\t<div class="alert alert-danger"\n\t\t\t\t data-ng-show="error"\n\t\t\t\t data-ng-bind="error"></div>\n\t</div>\n\t<div class="row">\n\t\t<div class="alert alert-warning confirm-delete-section" data-ng-show="confirmDelete">\n\t\t\t<h4>{{labels.confirmDelete}}</h4>\n\t\t\t<button type="button"\n\t\t\t\t\t\t\tid="btnConfirm{{::id}}"\n\t\t\t\t\t\t\tclass="btn btn-danger btn-stretch-xs"\n\t\t\t\t\t\t\tdata-ng-click="remove()">\n\t\t\t\t{{labels.confirmDeleteBtn}}\n\t\t\t</button>\n\t\t\t<button type="button"\n\t\t\t\t\t\t\tclass="btn btn-default btn-stretch-xs"\n\t\t\t\t\t\t\tdata-ng-click="confirmDelete = false">\n\t\t\t\t{{labels.cancelDeleteBtn}}\n\t\t\t</button>\n\t\t</div>\n\t</div>\n\t<form>\n\t\t<div class="row form-group">\n\t\t\t<div class="col-md-4">\n\t\t\t\t<label for="name{{::id}}" data-ng-bind="labels.viewName"></label>\n\t\t\t\t<input type="text"\n\t\t\t\t\t\t\t class="form-control"\n\t\t\t\t\t\t\t name="name"\n\t\t\t\t\t\t\t id="name{{::id}}"\n\t\t\t\t\t\t\t data-ng-model="viewName"\n\t\t\t\t\t\t\t placeholder="{{labels.defaultViewName}}" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row form-group" data-ng-show="enableDefaultCustomView">\n\t\t\t<div class="col-md-4">\n\t\t\t\t<input id="defaultView{{::id}}"\n\t\t\t\t\t\t\t type="checkbox"\n\t\t\t\t\t\t\t data-ng-model="defaultView" />\n\t\t\t\t<label for="defaultView{{::id}}">\n\t\t\t\t\t{{labels.defaultView}}\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row form-group option-section">\n\t\t\t<div class="col-md-3"\n\t\t\t\t\t data-ng-repeat="(key, prop) in options track by key"\n\t\t\t\t\t data-ng-if="!lockedOptions[key]">\n\t\t\t\t<input data-ng-if="isBoolean(prop)"\n\t\t\t\t\t\t\t type="checkbox"\n\t\t\t\t\t\t\t id="{{key}}{{::id}}"\n\t\t\t\t\t\t\t name="{{key}}"\n\t\t\t\t\t\t\t data-ng-model="options[key]" />\n\t\t\t\t<label for="{{key}}{{::id}}"\n\t\t\t\t\t\t\t data-ng-if="prop.onlyForMultiAccount ? isMultiAccount : true">\n\t\t\t\t\t{{labels[key]}}\n\t\t\t\t</label>\n\t\t\t\t<div data-multiselect\n\t\t\t\t\t\t data-ng-if="isObject(prop) && prop.type == \'multiselect\'"\n\t\t\t\t\t\t style="display: block;"\n\t\t\t\t\t\t data-title="{{prop.title}}"\n\t\t\t\t\t\t data-selected-label="{{prop.selectedLabel}}"\n\t\t\t\t\t\t data-multiple="true"\n\t\t\t\t\t\t data-filter="false"\n\t\t\t\t\t\t data-select-all="false"\n\t\t\t\t\t\t data-event-id="{{key}}"\n\t\t\t\t\t\t data-ng-model="options[key].value"\n\t\t\t\t\t\t data-options="choice.display for choice in prop.options"></div>\n\t\t\t\t<div data-svi-filter-dropdown\n\t\t\t\t\t\t data-ng-if="isObject(prop) && prop.type == \'dropdown\' && (prop.onlyForMultiAccount ? isMultiAccount : true)"\n\t\t\t\t\t\t style="display: block;"\n\t\t\t\t\t\t data-title="{{prop.title}}"\n\t\t\t\t\t\t data-ng-model="options[key].value"\n\t\t\t\t\t\t data-event-id="{{key}}"\n\t\t\t\t\t\t data-options="{{prop.options|json:false}}"></div>\n\t\t\t\t<input data-ng-if="!isBoolean(prop) && !isObject(prop)"\n\t\t\t\t\t\t\t id="{{key}}{{::id}}"\n\t\t\t\t\t\t\t type="text"\n\t\t\t\t\t\t\t class="form-control"\n\t\t\t\t\t\t\t name="{{key}}"\n\t\t\t\t\t\t\t data-ng-model="options[key]" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row col-md-3"\n\t\t\t\t style="font-weight: bold;"\n\t\t\t\t data-ng-bind="labels.columns"></div>\n\t\t<hr class="clear-left" />\n\t\t<div class="row form-group column-section">\n\t\t\t<div class="col-md-3"\n\t\t\t\t\t data-ng-repeat="column in columns track by column.key"\n\t\t\t\t\t data-ng-if="shouldShowColumnOption(column)">\n\t\t\t\t<label class="column-label" for="{{column.key}}{{::id}}">\n\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t name="{{column.key}}"\n\t\t\t\t\t\t\t\t id="{{column.key}}{{::id}}"\n\t\t\t\t\t\t\t\t data-ng-model="column.value"\n\t\t\t\t\t\t\t\t data-ng-disabled="lockedColumns[column.key]" />\n\t\t\t\t\t{{column.display}}\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-md-4 button-section">\n\t\t\t\t<button data-ng-click="save()"\n\t\t\t\t\t\t\t\tname="save"\n\t\t\t\t\t\t\t\tclass="btn btn-primary btn-stretch-xs">\n\t\t\t\t\t{{labels.save}}\n\t\t\t\t</button>\n\t\t\t\t<button data-ng-click="cancel()"\n\t\t\t\t\t\t\t\tdata-ng-show="viewId"\n\t\t\t\t\t\t\t\tname="cancel"\n\t\t\t\t\t\t\t\tclass="btn btn-default btn-stretch-xs">\n\t\t\t\t\t{{labels.cancel}}\n\t\t\t\t</button>\n\t\t\t\t<button data-ng-click="confirmDelete = true"\n\t\t\t\t\t\t\t\tdata-ng-show="viewId"\n\t\t\t\t\t\t\t\tname="delete"\n\t\t\t\t\t\t\t\tclass="btn btn-danger btn-stretch-xs">\n\t\t\t\t\t{{labels.delete}}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n</div>')}]),angular.module("templates-grouping",["accountGroupMgr/accountGroupMgr.tpl.html","groupAccountDropdown/groupAccountDropdown.tpl.html"]),angular.module("accountGroupMgr/accountGroupMgr.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("accountGroupMgr/accountGroupMgr.tpl.html",'<div class="svi-directive svi-account-group-mgr">\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div data-ng-show="!loader.showSpinner">\n\t\t<form id="createGroup" name="createGroupForm" data-ng-show="view === \'create\' || view === \'edit\'" data-ng-submit="createGroupForm.submitTheForm()">\n\t\t\t<div class="form-group col-sm-12" data-ng-class="{\'has-error\': createGroupForm[\'accountGroup.group.accountInfo.accounts\'].$dirty && createGroupForm[\'accountGroup.group.accountInfo.accounts\'].$invalid}">\n\t\t\t\t<label class="control-label" data-ng-bind="labels.accounts"></label>\n\t\t\t\t<span class="help-block" data-ng-bind="labels.noAccounts"></span>\n\t\t\t\t<ul>\n\t\t\t\t\t<li data-ng-repeat="account in accountGroup.group.accountInfo.accounts" class="checkbox">\n\t\t\t\t\t\t<label for="accountGroup-{{$index}}">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype="checkbox"\n\t\t\t\t\t\t\t\t\tid="accountGroup-{{$index}}"\n\t\t\t\t\t\t\t\t\tvalue="{{account.index}}"\n\t\t\t\t\t\t\t\t\tname="accountGroup.group.accountInfo.accounts"\n\t\t\t\t\t\t\t\t\tdata-ng-model="accountGroup.group.accountInfo.accounts[$index].selected"\n\t\t\t\t\t\t\t\t\tdata-ng-required="tmpAccountList.length == 0"\n\t\t\t\t\t\t\t\t\tdata-ng-click="handleAccountEvent($event,account)"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{{account.account}} {{account.nickname}}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<div class="form-group control-group col-sm-6" data-svi-show-input-errors>\n\t\t\t\t<label class="control-label" for="groupName" data-ng-bind="labels.groupNickName"></label>\n\t\t\t\t<div class="controls">\n\t\t\t\t\t<input type="text" id="groupName" data-ng-required="true" class="form-control" placeholder="Enter name of group" name="accountGroup.group.nickname" data-ng-model="accountGroup.group.nickname" data-ng-focus="focusSelect($event)">\n\t\t\t\t\t<span class="help-block" data-ng-bind="invalidGroupName"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="form-group button-group col-sm-6">\n\t\t\t\t<label class="control-label invisible" data-ng-bind="labels.groupButtons"></label>\n\t\t\t\t<div class="controls">\n\t\t\t\t\t<button type="submit" class="btn btn-primary btn-stretch-xs" data-ng-show="view === \'create\'" data-ng-disabled="createGroupForm.$invalid" data-ng-click="saveGroup()" data-ng-bind="labels.groupCreate"></button>\n\t\t\t\t\t<button type="submit" class="btn btn-primary btn-stretch-xs" data-ng-show="view === \'edit\'" data-ng-disabled="createGroupForm.$invalid" data-ng-click="saveGroup()" data-ng-bind="labels.groupSave"></button>\n\t\t\t\t\t<button type="button" class="btn btn-default btn-stretch-xs" data-ng-click="btnCancel()" data-ng-bind="labels.groupCancel"></button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\n\t\t<div id="listGroups" data-ng-show="view === \'list\'">\n\t\t\t<button type="button" class="btn btn-default btn-stretch-xs" data-ng-click="showView(\'create\')"><span class="glyphicon glyphicon-plus-sign"></span> {{labels.groupCreate}}</button>\n\t\t\t<div class="group-list">\n\t\t\t\t<div data-ng-repeat="group in groups" data-ng-model="groups" class="panel-group" id="{{group.id}}">\n\t\t\t\t\t<div class="panel panel-default">\n\t\t\t\t\t\t<div class="panel-heading">\n\t\t\t\t\t\t\t<h4 class="panel-title">\n\t\t\t\t\t\t\t\t<a data-toggle="collapse" data-parent="#{{group.id}}" data-target="#{{group.id}}-accounts" href="" class="collapsed">\n\t\t\t\t\t\t\t\t\t<span class="glyphicon"></span>\n\t\t\t\t\t\t\t\t\t<span data-ng-bind="group.nickname"></span>\n\t\t\t\t\t\t\t\t</a>\n                            <span class="panel-buttons">\n\t\t\t\t\t\t\t\t<span class="glyphicon" data-ng-click="handleDefaultGroupEvent($event,group.id)" data-bs-tooltip="labels.defaultGroup" aria-label="{{ labels.defaultGroup }}" data-ng-class="group.id === defaultGroup ? \'glyphicon-star\' : \'glyphicon-star-empty\'"></span>\n                                <span data-ng-if="group.isEditable" class="glyphicon glyphicon-pencil edit" data-ng-click="editGroup(group.id)" data-bs-tooltip="labels.groupEdit" aria-label="{{ labels.groupEdit }}"></span>\n                                <span data-ng-if="group.isEditable" class="glyphicon glyphicon-trash remove" data-ng-click="confirmDeleteGroup($index,group.id)" data-bs-tooltip="labels.groupDelete" aria-label="{{labels.groupDelete }}"></span>\n                            </span>\n\t\t\t\t\t\t\t</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id="{{group.id}}-accounts" class="panel-collapse collapse">\n\t\t\t\t\t\t\t<div class="panel-body">\n\t\t\t\t\t\t\t\t<div class="alert alert-block" data-ng-show="showConfirm[$index] === true">\n\t\t\t\t\t\t\t\t\t<h5 data-ng-bind="labels.groupRemoveConfirm"></h5>\n\t\t\t\t\t\t\t\t\t<button class="btn btn-danger btn-stretch-xs" data-ng-click="removeGroup(group.id)" data-ng-bind="labels.groupRemoveConfirmYes"></button>\n\t\t\t\t\t\t\t\t\t<button class="btn btn-default btn-stretch-xs" data-ng-click="resetConfirm($index,group.id)" data-ng-bind="labels.groupRemoveConfirmNo"></button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<ul class="list-striped">\n\t\t\t\t\t\t\t\t\t<li data-ng-if="group.numAccounts == 0" class="well" data-ng-bind="labels.groupNoAccounts"></li>\n\t\t\t\t\t\t\t\t\t<li data-ng-repeat="account in group.accounts">\n\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="account.account"></span> <span data-ng-bind="getAccountName(account.account)"></span>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="form-group col-sm-12 button-group">\n\t\t\t\t<button type="button" class="btn btn-primary btn-stretch-xs" data-ng-click="btnCancel(true)" data-ng-bind="labels.groupClose"></button>\n\t\t\t</div>\n\t\t</div>\n\t\t<p class="disclaimer" data-ng-bind="labels.manageGroupsDisclaimer"></p>\n\t</div>\n</div>')}]),angular.module("groupAccountDropdown/groupAccountDropdown.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("groupAccountDropdown/groupAccountDropdown.tpl.html",'<div class="svi-directive svi-group-account-dropdown">\n\t<div class="dropdown">\n\t\t<label class="control-label" for="{{::id}}-account" data-ng-bind="labels.account"></label>\n\t\t<button type="button" id="{{::id}}-account" class="btn btn-default dropdown-toggle {{dropdownClasses}}" data-ng-class="buttonClass" data-toggle="dropdown" aria-expanded="false" data-ng-click="onDropdown($event)" aria-label="group account dropdown, current selection {{selectLabel}}">\n\t\t\t{{selectLabel}} <span class="caret"></span>\n\t\t</button>\n\t\t<ul class="dropdown-menu" role="menu">\n\t\t\t<li data-ng-repeat="account in accountList" class="account">\n\t\t\t\t<a role="menuitem" href="" data-ng-click="selectAccount(account.index)" data-ng-bind="account|sviAccount" class="{{dropdownClasses}}"></a>\n\t\t\t</li>\n\t\t\t<li data-ng-if="hasGroupAccounts" role="presentation" class="divider"></li>\n\t\t\t<li data-ng-if="hasGroupAccounts" role="presentation" class="dropdown-header">\n\t\t\t\t<h4>\n\t\t\t\t\t<span class="groupsHeader" data-ng-bind="labels.groupsHeader"></span>\n\t\t\t\t\t<span data-ng-if="::(!viewMode)" role="button" class="manageGroupButton glyphicon glyphicon-pencil" title="{{labels.manageAccountGroups}}" aria-label="{{labels.manageAccountGroups}}" data-ng-click="showGroupMgr()"></span>\n\t\t\t\t</h4>\n\t\t\t</li>\n\t\t\t<li data-ng-if="showAllAccounts" class="allAccountSelect">\n\t\t\t\t<a role="menuitem" href="" data-ng-click="selectAll()" data-ng-bind="labels.selectAllAccounts"></a>\n\t\t\t</li>\n\t\t\t<li data-ng-repeat="group in groups" class="group"  data-ng-show="group.numAccounts > 0">\n\t\t\t\t<a role="menuitem" href="" data-ng-click="selectGroup(group.id)" data-ng-bind="displayGroup(group)"></a>\n\t\t\t</li>\n\t\t</ul>\n\t\t<div class="inline" svi-product-type-badge></div>\n\t\t<div class="svi-visually-hidden" aria-live="polite">{{ labels.ariaAccountSelection }} {{ selectLabel }}</div>\n\t</div>\n\n\t<div class="modal fade" id="svi-account-group-mgr-modal" tabindex="-1" role="dialog" aria-labelledby="{{::id}}sviAccountGroupMgtModal">\n\t\t<div class="modal-dialog modal-md" role="document">\n\t\t\t<div class="modal-content">\n\t\t\t\t<div class="modal-header">\n\t\t\t\t\t<h1 class="modal-title" id="{{::id}}sviAccountGroupMgtModal" data-ng-bind="labels.manageAccountGroups"></h1>\n\t\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="hideGroupMgr()" aria-label="Close"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="modal-body">\n\t\t\t\t\t<div id="svi-account-group-mgr"\n\t\t\t\t\t\t data-svi-account-group-mgr data-filter-boid-from-groups="{{filterBoidFromGroups}}"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("templates-hello",["helloChart/helloChart.tpl.html","helloEventListener/helloEventListener.tpl.html","helloGridContainer/helloGridContainer.tpl.html","helloModal/helloModal.tpl.html","helloMultiTemplate/alternate.tpl.html","helloMultiTemplate/default.tpl.html","helloMultiTemplate/shared.tpl.html","helloWidget/helloWidget.tpl.html","helloWorld/helloWorld.tpl.html"]),angular.module("helloChart/helloChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloChart/helloChart.tpl.html",'<div class="svi-directive svi-hello-chart" id="{{::id}}">\n\t<div data-svi-loader data-callback="setLoader" class="loader-floating"></div>\n\t<div class="chart-wrapper">\n\t\t<div class="chart-inner">\n\t\t\t<a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n\t\t\t<div class="chart"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("helloEventListener/helloEventListener.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloEventListener/helloEventListener.tpl.html",'<div class="svi-directive svi-hello-event-listener">\n\t\x3c!-- the first thing in a directive should be a div with the classes svi-directive and the directive name in snake case --\x3e\n\t\x3c!-- you should keep this line with the loader --\x3e\n\t<div data-svi-loader></div>\n\t\x3c!-- you can replace the following with your content --\x3e\n\t<div data-ng-show="symbol">\n\t\t<h3 data-ng-bind="symbol"></h3>\n\t\t<label data-ng-bind="labels.helloWorldLastPrice"></label>\n\t\t<span class="lastPrice" data-ng-bind="quote.lastPrice|sviCurrency"></span>\n\t</div>\n</div>')}]),angular.module("helloGridContainer/helloGridContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloGridContainer/helloGridContainer.tpl.html",'<div class="svi-directive svi-hello-grid-container row">\n\t<div class="col-md-12" data-svi-loader></div>\n\t<div class="col-md-12" data-ng-show="holdings">\n\t\t<div class="row paging-top" data-ng-show="pageSize && showPaging">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="HELLO_GRID" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-md-12" data-svi-hello-grid-grid\n\t\t\t\t data-columns="columns"\n\t\t\t\t data-column-priority="columnPriority"\n\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t data-holdings="holdings.positions"\n\t\t\t\t data-sort-field="sortField"\n\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t data-sortable="sortable"></div>\n\t\t</div>\n\t\t<div class="row paging-botom" data-ng-show="pageSize && showPaging">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="HELLO_GRID" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("helloModal/helloModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloModal/helloModal.tpl.html",'<div class="svi-directive svi-hello-modal" data-svi-modal data-title="{{labels.helloWorldTitle}}" data-event-name="HELLO_MODAL">\n\t\x3c!-- the first thing in a directive should be a div with the classes svi-directive and the directive name in snake case --\x3e\n\t<svi:modal-body>\n\t\t\x3c!-- you should keep this line with the loader --\x3e\n\t\t<div data-svi-loader></div>\n\t\t\x3c!-- you can replace the following with your content --\x3e\n\t\t<div data-ng-show="data">\n\t\t\t<label data-ng-bind="labels.helloWorldLabel"></label>\n\t\t\t<span class="action" data-ng-bind="data.action"></span>\n\t\t</div>\n\t</svi:modal-body>\n</div>')}]),angular.module("helloMultiTemplate/alternate.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloMultiTemplate/alternate.tpl.html",'<div class="svi-directive svi-hello-multi-template">\n\t<div data-ng-show="data">\n\t\t<label class="route" data-ng-bind="labels.helloWorldRoute"></label>\n\t\t<span class="route" data-ng-bind="data.routeName"></span>\n\t\t<label class="action" data-ng-bind="labels.helloWorldLabel"></label>\n\t\t<span class="action" data-ng-bind="data.action"></span>\n\t</div>\n\t\x3c!-- this next line will be replaced with the html from shared.tpl.html by the link method in the directive --\x3e\n\t%SHARED_TPL%\n</div>')}]),angular.module("helloMultiTemplate/default.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloMultiTemplate/default.tpl.html",'<div class="svi-directive svi-hello-multi-template">\n\t\x3c!-- this next line will be replaced with the html from shared.tpl.html by the link method in the directive --\x3e\n\t%SHARED_TPL%\n\t<div data-ng-show="data">\n\t\t<label data-ng-bind="labels.helloWorldLabel"></label>\n\t\t<span class="action" data-ng-bind="data.action"></span>\n\t</div>\n</div>')}]),angular.module("helloMultiTemplate/shared.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloMultiTemplate/shared.tpl.html",'<div data-svi-loader data-callback="api.setLoader"></div>\n<h3 data-ng-bind="labels.helloWorldTitle"></h3>')}]),angular.module("helloWidget/helloWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloWidget/helloWidget.tpl.html",'<div class="svi-directive svi-hello-widget" data-svi-widget data-title="labels.helloWorldTitle" data-include-loader="false">\n\t\x3c!-- the first thing in a directive should be a div with the classes svi-directive and the directive name in snake case --\x3e\n\t\x3c!-- widget based directives require a specific html structure in them --\x3e\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t\x3c!-- you can replace the contents here with one or more <li class="list-group-item"> elements --\x3e\n\t\t\t\t<li class="list-group-item alert alert-info" data-ng-if="!loader.showSpinner && (!preference || preference.symbol === \'\')" data-ng-bind="labels.helloWorldSetupMsg"></li>\n\t\t\t\t<li class="list-group-item" data-ng-if="preference && preference.symbol !== \'\'" data-svi-price-history-chart\n\t\t\t\t\tdata-symbol="{{preference.symbol}}"\n\t\t\t\t\tdata-ignore-events="true"\n\t\t\t\t\tdata-timespan="{{preference.timespan}}"\n\t\t\t\t\tdata-show-volume="true"\n\t\t\t\t\tdata-show-title="false"\n\t\t\t\t\tdata-show-symbol="true"\n\t\t\t\t\tdata-use-gradient="true"\n\t\t\t\t\tdata-chart-color-begin="#f3f4f6"></li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n\t<svi:widget-back>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader" data-ignore-invisible="true"></div>\n\t\t\t\t\t<form name="comm.helloWidgetSettings" data-ng-submit="api.savePreferences()" novalidate>\n\t\t\t\t\t\t<div class="form-group" data-svi-show-input-errors="symbol">\n\t\t\t\t\t\t\t<label class="control-label" for="{{::id}}-symbol" data-ng-bind="labels.symbol"></label>\n\t\t\t\t\t\t\t<div data-svi-input-symbol\n\t\t\t\t\t\t\t\t data-comm="comm"\n\t\t\t\t\t\t\t\t data-input-cls="form-control"\n\t\t\t\t\t\t\t\t data-ng-required\n\t\t\t\t\t\t\t\t data-ng-model="preference.symbol"\n\t\t\t\t\t\t\t\t data-ng-model-options="{allowInvalid: true}"\n\t\t\t\t\t\t\t\t data-debounce-delay="1000"\n\t\t\t\t\t\t\t\t data-lookup-placement="bottom"\n\t\t\t\t\t\t\t\t data-enable-replacement="false"\n\t\t\t\t\t\t\t\t data-capitalize="true"></div>\n\t\t\t\t\t\t\t<span class="on-error lookup-enabled glyphicon glyphicon-ban-circle form-control-feedback"></span>\n\t\t\t\t\t\t\t<div class="on-error help-block" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div class="form-group">\n\t\t\t\t\t\t\t<label class="control-label" for="{{::id}}-timespan" data-ng-bind="labels.timespan"></label>\n\t\t\t\t\t\t\t<select class="form-control" id="{{::id}}-timespan" name="timespan" data-ng-model="preference.timespan" data-ng-required="true"\n\t\t\t\t\t\t\t\t\tdata-ng-options="o.value as o.label for o in options.timespan"></select>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class="btn btn-primary preference-save-button" type="submit" data-ng-bind="labels.helloWorldSave"></button>\n\t\t\t\t\t\t<button class="btn btn-default preference-cancel-button" type="button" data-ng-click="api.toggleSettings()" data-ng-bind="labels.helloWorldCancel"></button>\n\t\t\t\t\t</form>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-back>\n\t<svi:widget-shortcuts>\n\t\t<span data-ng-if="::(moreUrl)" class="more-icon fas fa-external-link-alt" data-ng-click="api.more()" title="{{labels.moreTooltip}}" role="button" aria-label="{{labels.moreTooltip}}"></span>\n\t\t<span data-ng-if="::(api.canToggleSettings())" class="settingsButton settings-icon glyphicon glyphicon-cog" data-ng-click="api.toggleSettings()" title="{{labels.toggleSettings}}" role="button" aria-label="{{labels.toggleSettings}}"></span>\n\t</svi:widget-shortcuts>\n</div>')}]),angular.module("helloWorld/helloWorld.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("helloWorld/helloWorld.tpl.html",'<div class="svi-directive svi-hello-world">\n\t\x3c!-- the first thing in a directive should be a div with the classes svi-directive and the directive name in snake case --\x3e\n\t\x3c!-- you should keep this line with the loader --\x3e\n\t<div data-svi-loader></div>\n\t\x3c!-- you can replace the following with your content --\x3e\n\t<h3 data-ng-bind="labels.helloWorldTitle"></h3>\n\t<div data-ng-show="data">\n\t\t<label data-ng-bind="labels.helloWorldLabel"></label>\n\t\t<span class="action" data-ng-bind="data.action"></span>\n\t</div>\n</div>')}]),angular.module("templates-history",["historicalValueContainer/historicalValueContainer.tpl.html","historyContainer/historyContainer.tpl.html"]),angular.module("historicalValueContainer/historicalValueContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("historicalValueContainer/historicalValueContainer.tpl.html",'<div class="row svi-directive svi-historical-value-container">\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<div class="col-md-12" data-ng-show="historicalValue">\n\t\t<div class="row">\n\t\t\t<div class="col-md-12" data-svi-historical-value-grid\n\t\t\t\tdata-columns="columns"\n\t\t\t\tdata-column-priority="columnPriority"\n\t\t\t\tdata-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\tdata-historical-value="historicalValue"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("historyContainer/historyContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("historyContainer/historyContainer.tpl.html",'<div class="row svi-directive svi-history-container history-container">\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<div class="col-md-12" data-ng-show="history">\n\t\t<div class="row paging-top" data-ng-show="pageSize">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="HISTORY" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-md-12" data-svi-history-grid\n\t\t\t\t data-columns="columns"\n\t\t\t\t data-column-priority="columnPriority"\n\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t data-history="history"\n\t\t\t\t data-sort-field="sortField"\n\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t data-is-multi-account="isMultiAccount"\n         data-grouped="isMultiAccount && grouped"></div>\n\t\t</div>\n\t\t<div class="row paging-bottom" data-ng-show="pageSize">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="HISTORY" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("templates-holdings",["holdingMarketValue/holdingMarketValue.tpl.html","holdingsContainer/holdingsContainer.tpl.html","holdingsContainer/holdingsContainerWidget.tpl.html","holdingsList/holdingsList.tpl.html","holdingsList/holdingsListWidget.tpl.html","holdingZoom/holdingZoom.tpl.html"]),angular.module("holdingMarketValue/holdingMarketValue.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("holdingMarketValue/holdingMarketValue.tpl.html",'<div class="svi-directive svi-holding-market-value">\n    <div data-svi-loader data-callback="setLoader"></div>\n    <div data-ng-show="loaded">\n        <div class="row symbol-name-and-watchlist-block">\n            <div class="col-md-6 col-md-offset-0 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 text-xs-center flex-align">\n                <h2 class="symbol-id" data-ng-bind="symbol"></h2>\n                <span class="symbol-name-divider">|</span>\n                <h3 data-ng-bind="instrument.desc || \'Symbol\'"></h3>\n            </div>\n            <div class="col-md-6 col-md-offset-0 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 flex-end">\n                <div class="last-price">\n                    <div class="title">Last Price</div>\n                    <div class="value">{{ quote.lastPrice|sviCurrency }}</div>\n                </div>\n                <div class="day-change" data-ng-show="quote.change !== null">\n                    <div class="title">Day Change</div>\n                    <div class="value">\n                        <span data-ng-bind-html="quote.change|currencyChange"></span>\n                        <span class="parenChangePercent" data-ng-bind-html="quote.pctChange|percentChange:2:true"></span>\n                    </div>\n                </div>\n                <div data-svi-action-menu class="action-menu" data-ng-if="actionMenuItems.length"\n                     data-menu-class="dropdown-menu-right" data-items="actionMenuItems" data-aria-label="{{instrument.symbol}}"></div>\n            </div>\n        </div>\n        <div class="row mb-10 " data-ng-show="currentAccount">\n            <div class="col-xs-12">\n                <b>Account: </b><span ng-bind="currentAccount" class="{{accountClasses}}"></span>\n                <span class="quoteTime" data-ng-show="quote.lastTradeTime">\n                    {{quote.lastTradeTime|sviDate:"MMM d, yyyy h:mm a \'ET\'"}}\n                </span>\n            </div>\n        </div>\n        <div class="row">\n            <div class="col-md-4 col-md-offset-0 col-xs-10 col-xs-offset-1">\n                <div class="datapoint-box text-center">\n                    <div class="data-label" data-ng-bind="labels.qty"></div>\n                    <div class="data-value" data-ng-bind="qty|sviNumber"></div>\n                </div>\n            </div>\n            <div class="col-md-4 col-md-offset-0 col-xs-10 col-xs-offset-1">\n                <div class="datapoint-box text-center">\n                    <div class="data-label" data-ng-bind="labels.marketValue"></div>\n                    <div class="data-value" data-ng-bind="marketValue|sviCurrency"></div>\n                </div>\n            </div>\n            <div class="col-md-4 col-md-offset-0 col-xs-10 col-xs-offset-1">\n                <div class="datapoint-box text-center">\n                    <div class="data-label" data-ng-bind="labels.dayChange"></div>\n                    <span class="data-value" data-ng-class="{positive: marketValueChange.change > 0, negative: marketValueChange.change < 0}"\n                          data-ng-bind-html="marketValueChange|currencyChange"></span>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n')}]),angular.module("holdingsContainer/holdingsContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("holdingsContainer/holdingsContainer.tpl.html",'<div class="row svi-directive svi-holdings-container">\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<div class="col-md-12" data-ng-show="holdings">\n\t\t<div class="row">\n\t\t\t<h5 class="col-md-4 pull-right currency totalMarketValue" data-ng-show="holdings.grandTotals.marketValue" data-ng-if="showTotalMarketValue">\n\t\t\t\t<span data-ng-bind="labels.totalMarketValue"></span>: <span class="securitiesValue" data-ng-bind="holdings.grandTotals.marketValue|sviCurrency"></span>\n\t\t\t</h5>\n\t\t\t<h5 class="col-md-4 pull-right currency totalMarketValueChange" data-ng-if="showTotalMarketValueChange">\n\t\t\t\t<span data-ng-bind="labels.totalMarketValueChange"></span>:\n\t\t\t\t\t<span class="securitiesValue" data-ng-bind-html="holdings.grandTotals.marketValueChange|currencyChange"></span>\n\t\t\t</h5>\n\t\t\t<h5 class="col-md-4 pull-right currency totalSecurities" data-ng-show="holdings.grandTotals.securities" data-ng-if="showTotalSecurities">\n\t\t\t\t<span data-ng-bind="labels.totalSecurities"></span>: <span class="securitiesValue" data-ng-bind="holdings.grandTotals.securities|sviCurrency"></span>\n\t\t\t</h5>\n\t\t</div>\n\t\t<div class="row paging-top" data-ng-show="pageSize && showPaging">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="HOLDINGS" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t\t<div class="row" data-ng-if="!assetView">\n\t\t\t<div class="col-md-12" data-svi-holdings-grid\n\t\t\t\t id="holdings-container-no-assetview"\n\t\t\t\t data-columns="columns"\n\t\t\t\t data-multi-columns="multiColumns"\n\t\t\t\t data-totals-config="totalsConfig"\n\t\t\t\t data-column-priority="columnPriority"\n\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t data-holdings="holdings.positions"\n\t\t\t\t data-classification-type-colors="{{holdings.classificationTypeColors.assetCategoryMulti}}"\n\t\t\t\t data-asset-classification-enabled="{{assetClassificationEnabled}}"\n\t\t\t\t data-sort-field="sortField"\n\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t data-sortable="sortable"\n\t\t\t\t data-show-totals="showTotals"\n\t\t\t\t data-is-multi-account="isMultiAccount"\n\t\t\t\t data-multi-account-gain-loss="{{multiAccountGainLoss}}"\n\t\t\t\t data-holdings-label-set="holdingsLabelSet"></div>\n\t\t</div>\n\t\t<div class="row" data-ng-if="assetView" data-ng-repeat="assetType in holdings.assetTypes">\n\t\t\t<div data-ng-if="assetType && holdings.positions[assetType]" class="col-md-12" data-svi-holdings-grid\n\t\t\t\t id="holdings-container-assetview"\n\t\t\t\t data-columns="columns"\n\t\t\t\t data-multi-columns="multiColumns"\n\t\t\t\t data-totals-config="totalsConfig"\n\t\t\t\t data-column-priority="columnPriority"\n\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t data-holdings="holdings.positions[assetType]"\n\t\t\t\t data-classification-type-colors="{{holdings.classificationTypeColors.assetCategoryMulti}}"\n\t\t\t\t data-asset-type="{{assetType}}"\n\t\t\t\t data-title="{{assetType}}"\n\t\t\t\t data-sort-field="sortField"\n\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t data-sortable="sortable"\n\t\t\t\t data-show-totals="showTotals"\n\t\t\t\t data-is-multi-account="isMultiAccount"\n\t\t\t\t data-multi-account-gain-loss="{{multiAccountGainLoss}}"\n\t\t\t\t data-asset-classification-enabled="{{assetClassificationEnabled}}"\n\t\t\t\t data-holdings-label-set="holdingsLabelSet"></div>\n\t\t</div>\n\t\t<div class="row paging-botom" data-ng-show="pageSize && showPaging">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="HOLDINGS" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("holdingsContainer/holdingsContainerWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("holdingsContainer/holdingsContainerWidget.tpl.html",'<div class="svi-directive svi-holdings-container" data-svi-widget data-title="labels.holdingsTitle" data-include-loader="false" data-min-size="8">\n\t<svi:widget-front>\n\t\t<div class="list-body" data-ng-controller="AccountDataCtrl">\n\t\t\t<ul class="list-group">\n\t\t\t\t<div data-ng-if="heldAwayConfig && heldAwayConfig.includeHeldAwayFilterEnabled" class="list-group-item filters"\n\t\t\t\t\t data-ng-show="accountData && accountData.hasHeldAwayAssets">\n\t\t\t\t\t<div data-ng-if="accountData && accountData.hasHeldAwayAssets" data-svi-filter-dropdown\n\t\t\t\t\t\t data-event-id="HOLDINGS.INCLUDE_HELDAWAY"\n\t\t\t\t\t\t data-options="{{ heldAwayConfig.includeHeldAwayFilter }}"\n\t\t\t\t\t\t data-state-id="holdings-includeHeldAway"\n\t\t\t\t\t\t data-selected="{{ heldAwayConfig.includeHeldAwayDefault }}"\n\t\t\t\t\t\t data-title="{{ heldAwayConfig.includeHeldAwayLabel }}"\n\t\t\t\t\t\t data-selected-label="{{ heldAwayConfig.includeHeldAwayLabelUnit }}"\n\t\t\t\t\t\t data-filter=false\n\t\t\t\t\t\t data-select-all="true"\n\t\t\t\t\t\t class="pad-right-15 heldaway-dropdown"></div>\n\t\t\t\t\t<div data-ng-if="accountData && !accountData.hasHeldAwayAssets" data-svi-fire-event\n\t\t\t\t\t\t data-event-id="HOLDINGS.INCLUDE_HELDAWAY.FILTER.CHANGED"\n\t\t\t\t\t\t data-value="{{ heldAwayConfig.includeHeldAwayDefault }}"\n\t\t\t\t\t\t data-delay="0"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="list-group-item" data-ng-show="loader.showSpinner || loader.shouldShowMessages()">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="setLoader" data-ignore-invisible="true"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="list-group-item" data-ng-show="holdings.positions.length">\n\t\t\t\t\t<div data-svi-holdings-grid\n\t\t\t\t\t\t data-template="Widget"\n\t\t\t\t\t\t data-columns="isMultiAccount && multiColumns ? multiColumns : columns"\n\t\t\t\t\t\t data-totals-config="totalsConfig"\n\t\t\t\t\t\t data-column-priority="columnPriority"\n\t\t\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t\t\t data-holdings="holdings.positions"\n\t\t\t\t\t\t data-sort-field="sortField"\n\t\t\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t\t\t data-sortable="sortable"\n\t\t\t\t\t\t data-show-totals="showTotals"\n\t\t\t\t\t\t data-is-multi-account="isMultiAccount"\n\t\t\t\t\t\t data-holdings-label-set="holdingsLabelSet"></div>\n\t\t\t\t\t<div class="paging-botom" data-ng-show="pageSize && showPaging">\n\t\t\t\t\t\t<div data-svi-paging-control data-event-id="HOLDINGS" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p class="list-group-item disclaimer"\n\t\t\t\t\t\tdata-ng-bind="labels.holdingsWidgetHeldAwayDisclaimer"\n\t\t\t\t\t\tdata-ng-if="accountData && accountData.hasHeldAwayAssets && labels.holdingsWidgetHeldAwayDisclaimer"></p>\n\t\t\t\t</div>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n\t<svi:widget-shortcuts>\n\t\t<span class="more-icon fas fa-external-link-alt" data-ng-click="api.more()" title="{{labels.moreTooltip}}" role="button" aria-label="{{labels.holdingsTitle}} {{labels.moreTooltip}}"></span>\n\t</svi:widget-shortcuts>\n</div>')}]),angular.module("holdingsList/holdingsList.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("holdingsList/holdingsList.tpl.html",'<div class="svi-directive svi-holdings-list">\n\t<h3 class="title" data-ng-bind="labels.holdingsListTitle" data-ng-show="titleEnabled"></h3>\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div data-ng-show="loaded">\n\t\t<div data-svi-filter-dropdown data-ng-model="filters.filterBy" data-options="[]" data-comm="{options: filterOptions}"></div>\n\t\t<div class="table-container">\n\t\t\t<table class="table table-striped svi-holdings-grid-table">\n\t\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-ng-bind-html="labels.holdingListSymbol"></th>\n\t\t\t\t\t<th data-ng-bind-html="labels.marketValueChange"></th>\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t<tr  data-ng-click="changeSymbol($event,position)" data-ng-repeat="position in positions" data-svi-repeat-complete data-callback="rendered" data-ng-if="!assetType || assetType == position.instrument.investmentType" data-ng-show="position.inFilter">\n\t\t\t\t\t<td><a data-ng-bind-html="position.instrument.symbol"></a></td>\n\t\t\t\t\t<td data-ng-bind-html="position.quote.pctChange|percentChange:2:true" class="parenChangePercent"></td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("holdingsList/holdingsListWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("holdingsList/holdingsListWidget.tpl.html",'<div class="svi-directive svi-holdings-list-widget" data-svi-widget data-title="labels.holdingsListTitle" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div class="loader" data-svi-loader data-callback="setLoader"></div>\n                    <div data-ng-show="loaded">\n                        <div data-svi-filter-dropdown data-ng-model="filters.filterBy" data-options="[]" data-comm="{options: filterOptions}"></div>\n                        <div class="table-container" ng-style="{\'overflow-y\': scrollable ? \'auto\' : \'hidden\', \'height\' : isScrollableList ? \'900px\' : \'100%\'}">\n                            <table class="table table-striped svi-holdings-grid-table">\n                                <thead>\n                                <tr>\n                                    <th data-ng-bind-html="labels.holdingListSymbol"></th>\n                                    <th data-ng-bind-html="labels.marketValueChange"></th>\n                                </tr>\n                                </thead>\n                                <tbody>\n                                <tr data-ng-click="changeSymbol($event,position)" data-ng-repeat="position in positions" data-svi-repeat-complete data-callback="rendered"\n                                    data-ng-if="!assetType || assetType == position.instrument.investmentType" data-ng-show="position.inFilter">\n                                    <td><a data-ng-bind-html="position.instrument.symbol"></a></td>\n                                    <td data-ng-bind-html="position.quote.pctChange|percentChange:2:true" class="parenChangePercent"></td>\n                                </tr>\n                                </tbody>\n                            </table>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n')}]),angular.module("holdingZoom/holdingZoom.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("holdingZoom/holdingZoom.tpl.html",'<div data-ng-controller="HoldingZoomCtrl" class="svi-directive svi-holding-zoom">\n    <div data-ng-class="((symbol !== null && symbol !== \'\') ? \'col-md-3 col-lg-3\' : \'col-md-12\')" data-ng-if="showHoldingsList" class="col-sm-12 pagebreak">\n        <div data-svi-holdings-list\n             data-template="Widget"\n             data-use-parent-data="true"\n             data-event-name="{{ eventName }}"\n             data-title-enabled="false"\n             data-exclude-cusip="true"\n             data-exclude-fixed-income="true"\n             data-exclude-cash="true"></div>\n    </div>\n\t<span class="print-breaker-before"></span>\n    <div data-ng-show="((symbol !== null && symbol !== \'\') || isMobile)" data-ng-class="(showHoldingsList ? \'col-md-9 col-lg-9 border-0\' : \'col-md-12\')" class="col-sm-12 pagebreak">\n        <div data-svi-holding-market-value class="directive pagebreak"\n             data-use-parent-data="{{useParentData}}"\n             data-event-name="{{ eventName }}"\n             data-accounts="accounts"\n             data-symbol="{{symbol}}"\n             data-enable-trading="{{enableTrading}}"\n             data-urls="{{urls}}"\n             data-show-gainloss="{{showGainloss}}"\n             data-delayed-quote="{{delayedQuote}}"></div>\n        <ul class="nav nav-tabs sub-pages svi-directive pagebreak" role="tablist">\n            <li class="active" role="presentation">\n                <a role="tab"\n                   data-ng-bind="labels.basics"\n                   class="default-tab"\n                   href="#{{::id}}-basics"\n                   data-toggle="tab"\n                   aria-selected="true"\n                   aria-controls="{{::id}}-basics"></a></li>\n            <li role="presentation" data-ng-show="showNews">\n                <a role="tab"\n                   data-ng-bind="labels.news"\n                   href="#{{::id}}-news"\n                   data-toggle="tab"\n                   aria-selected="false"\n                   aria-controls="{{::id}}-news">{{labels.news}}</a></li>\n        </ul>\n        <div class="tab-content">\n            <div class="tab-pane fade in active" id="{{::id}}-basics" role="tabpanel">\n                <div class="col-md-6 col-sm-12 pagebreak-after">\n                    <div data-svi-symbol-holdings\n                         data-template="Widget"\n                         id="svi-symbol-holdings"\n                         class="directive"\n                         data-use-parent-data="{{useParentData}}"\n                         data-event-name="{{ eventName }}"\n                         data-accounts="accounts"\n                         data-symbol="{{symbol}}"\n                         data-show-acct-type="{{showAcctType}}"\n                         data-columns="{{::columnsSymbolHoldings}}"\n                         data-column-priority="{{::columnPrioritySymbolHoldings}}"\n                         data-responsive-columns="{{::responsiveColumns}}"\n                         data-show-title="false"></div>\n                    <div data-svi-symbol-ugl\n                         data-template="Widget"\n                         id="svi-symbol-ugl"\n                         class="directive pagebreak"\n                         data-use-parent-data="false"\n                         data-event-name="{{ eventName }}"\n                         data-accounts="accounts"\n                         data-symbol="{{symbol}}"\n                         data-underlying="{{underlying}}"\n                         data-investment-type="{{investmentType}}"\n                         data-show-event="{{showEvent}}"\n                         data-show-acct-type="{{showAcctType}}"\n                         data-columns="{{::columnsSymbolUgl}}"\n                         data-column-priority="{{::columnPrioritySymbolUgl}}"\n                         data-responsive-columns="{{::responsiveColumns}}"\n                         data-show-title="false"></div>\n                    <div data-svi-symbol-order-status\n                         data-template="Widget"\n                         id="svi-symbol-order-status"\n                         class="directive pagebreak"\n                         data-use-parent-data="false"\n                         data-event-name="{{ eventName }}"\n                         data-accounts="accounts"\n                         data-symbol="{{symbol}}"\n                         data-show-acct-type="{{showAcctType}}"\n                         data-show-title="false"></div>\n                </div>\n                <div class="col-md-6 col-sm-12 pagebreak">\n                    <div data-svi-detailed-quote\n                         data-template="detailedWidget"\n                         id="svi-detailed-quote"\n                         data-symbol="{{symbol}}"\n                         data-event-name="{{eventName}}"\n                         data-show-title="false"\n                         data-delayed="{{delayedQuote}}"\n                         class="directive pagebreak"></div>\n\n                    <div data-svi-price-history-chart\n                         data-template="Widget"\n                         id="svi-price-history-chart"\n                         class="directive pagebreak"\n                         data-event-name="{{ eventName }}"\n                         data-show-volume="true"\n                         data-investment-type="{{investmentType}}"\n                         data-reload-every="{{(investmentType == \'MutualFund\' ? \'0\' : \'60\')}}"\n                         data-show-frequency="false"\n                         data-show-navigator="false"\n                         data-show-price-info="true"\n                         data-line-width="2"\n                         data-symbol="{{(investmentType === \'Option\' ? underlying : symbol)}}"\n                         data-chart-color-begin="{{chartColorBegin}}"\n                         data-use-gradient="{{useGradient}}"\n                         data-y-axis-font-color="{{yAxisFontColor}}"\n                         data-range-button-width="{{rangeButtonWidth}}"\n                         data-market-hours-only="true"\n                         data-show-title="false"></div>\n                </div>\n            </div>\n            <div class="tab-pane" id="{{::id}}-news" role="tabpanel">\n                <div class="col-md-12 col-sm-12 pagebreak">\n                    <div data-svi-symbol-news\n                         data-ng-if="labels.symbolNewsTitle"\n                         id="svi-symbol-news-HZ"\n                         data-use-modal="{{useModal}}"\n                         data-show-only-news-text="{{showOnlyNewsText}}"\n                         data-template="Widget"\n                         data-title="{{labels.symbolNewsTitle}}"\n                         data-symbol="{{newsSymbol}}"\n                         data-event-name="{{eventName}}"\n                         data-show-title="false"\n                         data-news-types="[\'Headlines\', \'PressReleases\']"\n                         data-limit="10"\n                         data-limit-display="5"\n                         data-event-id="{{ ::id }}"\n                         data-show-source-filter="true"\n                         class="directive"></div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n')}]),angular.module("templates-household",[]),angular.module("templates-idc",["marketIndicesChart/marketIndicesChart.tpl.html"]),angular.module("marketIndicesChart/marketIndicesChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("marketIndicesChart/marketIndicesChart.tpl.html",'<div class="svi-directive svi-market-indices-chart" data-svi-widget data-title="labels.marketIndicesTitle" data-min-size="{{widgetSize}}" data-max-size="{{widgetSize}}">\n\t<svi:widget-front>\n\t\t<div class="list-body" data-ng-show="config">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="marketIndices">\n\t\t\t\t\t\t<div class="chartContainer">\n\t\t\t\t\t\t\t<span id="marketIndicesHtml" data-svi-dynamic-html="marketIndicesHtml"></span>\n\t\t\t\t\t\t\t<div class="marketDisclaimerText" data-ng-bind="labels.disclaimer"></div>\n\t\t\t\t\t\t\t<div class="marketDisclaimerText" data-ng-bind="labels.poweredBy"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("templates-morningstar",["morningstar/morningstar.tpl.html","morningstar/morningstarWidget.tpl.html","morningstarGla/morningstarGla.tpl.html","morningstarGla/morningstarGlaWidget.tpl.html","morningstarScreener/morningstarScreener.tpl.html","morningstarScreener/morningstarScreenerWidget.tpl.html","morningstarScreener/popover.tpl.html","morningstarTinyChart/morningstarTinyChart.tpl.html","morningstarTinyChart/morningstarTinyChartWidget.tpl.html"]),angular.module("morningstar/morningstar.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstar/morningstar.tpl.html",'<div class="svi-directive svi-morningstar" data-ng-style="style">\n\t<div data-svi-loader></div>\n\t<div data-ng-if="!isAngular" data-ng-show="shouldShow()" class="morningstar-component" data-ng-class="type" id="{{ id }}" data-ng-style="style"></div>\n\t<div data-ng-if="isAngular" data-ng-show="shouldShow()" class="morningstar-component-placeholder" data-ng-class="type" id="{{ id }}-placeholder" data-ng-style="style"></div>\n</div>')}]),angular.module("morningstar/morningstarWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstar/morningstarWidget.tpl.html",'<div class="svi-directive svi-morningstar" data-svi-widget data-observe-changes="true" data-mode="wrapper" data-title="title">\n\t<svi:widget-front>\n\t\t<div data-ng-if="!isAngular" data-ng-show="shouldShow()" class="morningstar-component" data-ng-class="type" id="{{ id }}" data-ng-style="style"></div>\n\t\t<div data-ng-if="isAngular" data-ng-show="shouldShow()" class="morningstar-component-placeholder" data-ng-class="type" id="{{ id }}-placeholder" data-ng-style="style"></div>\n\t</svi:widget-front>\n</div>')}]),angular.module("morningstarGla/morningstarGla.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstarGla/morningstarGla.tpl.html",'<div class="svi-directive svi-morningstar-gla">\n\t<ul class="nav nav-tabs" role="tablist">\n\t\t<li role="presentation"\n\t\t\tng-class="{\'active\':isActive(\'gainers\')}"\n\t\t\tdata-ng-click="mode = \'gainers\'">\n\t\t\t<a role="tab" href="" data-ng-bind="labels.glaGainers" aria-selected="{{ isActive(\'gainers\') ? \'true\' : \'false\' }}" aria-controls="{{::id}}gainers"></a>\n\t\t</li>\n\t\t<li role="presentation"\n\t\t\tng-class="{\'active\':isActive(\'losers\')}"\n\t\t\tdata-ng-click="mode = \'losers\'">\n\t\t\t<a role="tab" href="" data-ng-bind="labels.glaLosers" aria-selected="{{ isActive(\'losers\') ? \'true\' : \'false\' }}" aria-controls="{{::id}}losers"></a>\n\t\t</li>\n\t\t<li role="presentation"\n\t\t\tng-class="{\'active\':isActive(\'actives\')}"\n\t\t\tdata-ng-click="mode = \'actives\'">\n\t\t\t<a role="tab" href="" data-ng-bind="labels.glaActives" aria-selected="{{ isActive(\'actives\') ? \'true\' : \'false\' }}" aria-controls="{{::id}}actives"></a>\n\t\t</li>\n\t</ul>\n\t<div data-ng-show="mode == \'gainers\'" class="gainers" id="{{::id}}gainers" role="tabpanel">\n\t\t<div data-svi-morningstar\n\t\t\t data-type="markets-components-gla"\n\t\t\t data-name="marketsComponentsGlaGainers"\n\t\t\t data-version="{{ version }}"\n\t\t\t data-height="{{ height }}"\n\t\t\t data-settings="{{ settings }}"\n\t\t\t data-tokens="D2158"\n\t\t></div>\n\t</div>\n\t<div data-ng-show="mode == \'losers\'" class="losers" id="{{::id}}losers" role="tabpanel">\n\t\t<div data-svi-morningstar\n\t\t\t data-type="markets-components-gla"\n\t\t\t data-name="marketsComponentsGlaLosers"\n\t\t\t data-version="{{ version }}"\n\t\t\t data-height="{{ height }}"\n\t\t\t data-settings="{{ settings }}"\n\t\t\t data-tokens="D2159"\n\t\t></div>\n\t</div>\n\t<div data-ng-show="mode == \'actives\'" class="actives" id="{{::id}}actives" role="tabpanel">\n\t\t<div data-svi-morningstar\n\t\t\t data-type="markets-components-gla"\n\t\t\t data-name="marketsComponentsGlaActives"\n\t\t\t data-version="{{ version }}"\n\t\t\t data-height="{{ height }}"\n\t\t\t data-settings="{{ settings }}"\n\t\t\t data-tokens="D2160"\n\t\t></div>\n\t</div>\n</div>')}]),angular.module("morningstarGla/morningstarGlaWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstarGla/morningstarGlaWidget.tpl.html",'<div class="svi-directive svi-morningstar-gla" data-svi-widget data-mode="wrapper" data-title="title">\n\t<svi:widget-front>\n\t\t<div data-svi-morningstar-gla\n\t\t\t data-type="markets-components-gla"\n\t\t\t data-version="{{ version }}"\n\t\t\t data-height="{{ height }}"\n\t\t\t data-settings="{{ settings }}"\n\t\t></div>\n\t</svi:widget-front>\n</div>')}]),angular.module("morningstarScreener/morningstarScreener.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstarScreener/morningstarScreener.tpl.html",'<div class="svi-directive svi-morningstar-screener screener">\n    <div class="col-md-12" data-svi-morningstar\n        data-type="ecScreenerLoader"\n        data-version="{{ version }}"\n        data-height="{{ height }}"\n    ></div>\n</div>')}]),angular.module("morningstarScreener/morningstarScreenerWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstarScreener/morningstarScreenerWidget.tpl.html",'<div class="svi-directive svi-morningstar-screener screener" data-svi-widget data-mode="wrapper" data-title="title">\n    <svi:widget-front>\n        <div class="col-md-12" data-svi-morningstar\n             data-type="ecScreenerLoader"\n             data-version="{{ version }}"\n             data-height="{{ height }}"\n        ></div>\n    </svi:widget-front>\n</div>')}]),angular.module("morningstarScreener/popover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstarScreener/popover.tpl.html",'<div class="svi-directive action-menu-popover dropdown">\n\t<ul class="action-menu dropdown-menu">\n\t\t<li data-ng-if="::(actionMenuData.length == 0)"><a href="">No actions available</a></li>\n\t\t<li data-ng-repeat="item in ::actionMenuData" data-ng-class="item.type == \'dropdown\' ? \'dropdown-submenu\' : \'\'">\n\t\t\t<a data-ng-if="::item.type != \'dropdown\'" data-ng-href="{{::item.url}}" data-ng-bind="::item.label" data-ng-click="onClickMenuItem(item, $event)"></a>\n\t\t\t<a data-ng-if="::item.type == \'dropdown\'" href="">\n\t\t\t\t{{::item.label}} <span class="pull-right glyphicon glyphicon-chevron-right"></span>\n\t\t\t</a>\n\t\t\t<ul data-ng-if="::item.type == \'dropdown\'" class="dropdown-menu">\n\t\t\t\t<li data-ng-repeat="dropdownItem in ::item.items">\n\t\t\t\t\t<a data-ng-href="{{::dropdownItem.url}}" data-ng-bind="::dropdownItem.label" data-ng-click="onClickMenuItem(dropdownItem, $event)"></a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</li>\n\t</ul>\n</div>\n')}]),angular.module("morningstarTinyChart/morningstarTinyChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstarTinyChart/morningstarTinyChart.tpl.html",'<div class="svi-directive svi-morningstar-tiny-chart">\n\t<div data-svi-morningstar\n\t\t data-type="markets-components-svgchart"\n\t\t data-name="marketsSvgchartTiny"\n\t\t data-version="{{ version }}"\n\t\t data-height="{{ height }}"\n\t\t data-width="{{ width }}"\n\t\t data-settings="{{ settings | json }}"\n\t\t data-symbol="{{ symbol }}"\n\t></div>\n</div>')}]),angular.module("morningstarTinyChart/morningstarTinyChartWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("morningstarTinyChart/morningstarTinyChartWidget.tpl.html",'<div class="svi-directive svi-morningstar-tiny-chart" data-svi-widget data-mode="wrapper" data-title="title">\n\t<svi:widget-front>\n\t\t<div data-svi-morningstar\n\t\t\t data-type="markets-components-svgchart"\n\t\t\t data-name="marketsSvgchartTiny"\n\t\t\t data-version="{{ version }}"\n\t\t\t data-height="{{ height }}"\n\t\t\t data-width="{{ width }}"\n\t\t\t data-settings="{{ settings | json }}"\n\t\t\t data-symbol="{{ symbol }}"\n\t\t></div>\n\t</svi:widget-front>\n</div>')}]),angular.module("templates-navigation",["dock/dock.tpl.html","fastFind/fastFind.tpl.html","loginTips/loginTips.tpl.html","messageCenterBadge/messageCenterBadge.tpl.html","navigation/bootstrapNav.tpl.html","navigation/fastFindNav.tpl.html","navigation/legacyNav.tpl.html","sessionReminder/sessionReminder.tpl.html","sessionReminder/sessionReminderUIDialog.tpl.html","subPageNav/subPageNav.tpl.html","welcomeMessage/welcomeMessage.tpl.html"]),angular.module("dock/dock.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("dock/dock.tpl.html",'<nav class="svi-directive svi-dock no-print draggable navbar navbar-default navbar-fixed-bottom" data-ng-class="{\'dock-expanded\': expanded, \'dock-collapsed\': !expanded, \'editing\': editing}">\n\t<div class="container-fluid">\n\t\t<ul data-ng-show="!editing" class="expand-collapse-section nav navbar-nav">\n\t\t\t<li>\n\t\t\t\t<a href="" class="glyphicon pointer"\n\t\t\t\t   data-ng-class="expanded ? \'glyphicon-chevron-left\' : \'glyphicon-chevron-right\'"\n\t\t\t\t   data-ng-click="api.toggleExpand()"\n\t\t\t\t   role="button"\n\t\t\t\t   aria-label="{{ labels.dockToggle }}"\n\t\t\t\t   aria-expanded="{{ expanded ? \'true\' : \'false\'}}"></a>\n\t\t\t</li>\n\t\t</ul>\n\n\t\t<div class="dock-loader" data-svi-loader data-ignore-invisible="true" data-ng-show="expanded && !config.resource.layout.length"></div>\n\n\t\t<ul class="nav navbar-nav dock-sortable-container" data-ng-if="config.resource.layout.length" data-ui-sortable="sortableConfig" data-ng-model="config.resource.layout">\n\t\t\t<li data-ng-show="expanded" data-ng-repeat="item in config.resource.layout track by $index"\n\t\t\t\tclass="dock-item {{config.sections[item].class}}"\n\t\t\t\tdata-ng-class="{\'dropdown dropdown-hover\':config.sections[item].children, \'navbar-right\':config.sections[item].right}"\n\t\t\t\tdata-section="{{item}}">\n\t\t\t\t<div data-ng-show="editing" class="drag-handle overlay-text well well-sm" data-section="{{item}}">\n\t\t\t\t\t{{ labels.dockDrag }}\n\t\t\t\t\t<span class="svi-visually-hidden" data-ng-bind="item|sviWords"></span>\n\t\t\t\t</div>\n\t\t\t\t<div data-ng-show="editing" class="overlay"></div>\n\t\t\t\t<p class="navbar-text" data-svi-dynamic-html="config.sections[item].html"></p>\n\t\t\t</li>\n\t\t</ul>\n\n\t\t<ul class="edit-section nav navbar-nav" data-ng-show="expanded">\n\t\t\t<li data-ng-if="editEnabled" data-ng-show="!editing && config.resource.layout.length > 1" data-bs-tooltip data-title="{{labels.dockEdit}}">\n\t\t\t\t<a href="" class="editButton glyphicon glyphicon-edit pointer"\n\t\t\t\t   data-ng-click="api.toggleEdit(true)"\n\t\t\t\t   role="button" aria-label="{{labels.dockEdit}}"\n\t\t\t\t   aria-expanded="{{ editing ? \'true\' : \'false\'}}"></a>\n\t\t\t</li>\n\t\t\t<li data-ng-show="editing" data-bs-tooltip data-title="{{labels.dockReset}}">\n\t\t\t\t<a href="" class="glyphicon glyphicon-share pointer" data-ng-click="api.resetDock()" role="button" aria-label="{{labels.dockReset}}"></a>\n\t\t\t</li>\n\t\t\t<li data-ng-show="editing" data-bs-tooltip data-title="{{labels.dockEditFinished}}">\n\t\t\t\t<a href="" class="glyphicon glyphicon-check pointer"\n\t\t\t\t   data-ng-click="api.toggleEdit(false)"\n\t\t\t\t   role="button" aria-label="{{labels.dockEditFinished}}"\n\t\t\t\t   aria-expanded="{{ editing ? \'true\' : \'false\'}}"></a>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n\t<div class="dock-scroll-buttons hiddenDesktop" data-ng-show="expanded">\n\t\t<div class="scroll-button pull-left pointer" data-ng-click="api.scrollLeft()" role="button" aria-label="scroll dock left">\n\t\t\t<span class="glyphicon glyphicon-backward"></span>\n\t\t</div>\n\t\t<div class="scroll-button pull-right pointer" data-ng-click="api.scrollRight()" role="button" aria-label="scroll dock right">\n\t\t\t<span class="glyphicon glyphicon-forward"></span>\n\t\t</div>\n\t</div>\n\t<div class="svi-visually-hidden" aria-live="polite" data-ng-bind="ariaMsg"></div>\n</nav>')}]),angular.module("fastFind/fastFind.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fastFind/fastFind.tpl.html",'<div class="svi-directive svi-fast-find modal" data-backdrop-limit="1" tabindex="-1" role="dialog" aria-labelledby="{{::id}}-modalTitle">\n\t<div class="modal-dialog modal-{{::size}}" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 id="{{::id}}-modalTitle" class="modal-title" data-ng-bind="::title"></h1>\n\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="api.hideModal()" aria-label="Close"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-body">\n\t\t\t\t<div data-ng-if="active" id="fastFind" class="col-md-12" data-svi-navigation data-template="fastFind"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("loginTips/loginTips.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("loginTips/loginTips.tpl.html",'<div class="svi-directive svi-login-tips-modal modal fade" tabindex="-1" role="dialog" aria-labelledby="loginTipsModal">\n\t<div class="modal-dialog modal-lg" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 class="modal-title" id="loginTipsModal" data-ng-bind="labels.tipsTitle"></h1>\n\t\t\t\t<nav>\n\t\t\t\t\t<ul class="pagination">\n\t\t\t\t\t\t<li data-ng-class="{disabled: !hasPreviousTip()}" data-ng-click="showPreviousTip()"><a data-ng-bind="labels.previousPage"></a></li>\n\t\t\t\t\t\t<li class="disabled"><span>{{ getCurrentTipNum() }} of {{ getTotalTips() }}</span></li>\n\t\t\t\t\t\t<li data-ng-class="{disabled: !hasNextTip()}" data-ng-click="showNextTip()"><a data-ng-bind="labels.nextPage"></a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t</div>\n\t\t\t<div class="modal-body">\n\t\t\t\t<div data-ng-bind-html="getCurrentTipLabel()"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-footer">\n\t\t\t\t<button type="button" class="btn btn-primary btn-stretch" data-ng-click="hideModal()" data-ng-bind="labels.close"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("messageCenterBadge/messageCenterBadge.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("messageCenterBadge/messageCenterBadge.tpl.html",'<span class="svi-directive loader" data-ignore-invisible="true" data-hidden="true" data-svi-loader data-callback="setLoader"></span>\n<span data-ng-show="loader.showSpinner" class="fa fa-spinner fa-spin" data-callback="setLoader"></span>\n<a data-ng-href="{{badgeUrl}}" class="alert-button"><span class="glyphicon glyphicon-warning-sign messageCenterIcon"></span>{{alertsLabel}}<span class="badge" data-ng-bind="unreadMessages"></span></a>')}]),angular.module("navigation/bootstrapNav.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("navigation/bootstrapNav.tpl.html",'<div class="svi-directive svi-navigation bootstrap">\n\t<div data-ng-show="!loaded">\n\t\t<div data-svi-loader data-callback="setLoader" data-event-id="NAVIGATION" data-ignore-invisible="true"></div>\n\t</div>\n\t<div class="navbar-wrapper">\n\t\t<nav class="svi-navigation navbar navbar-default" data-ng-class="{\'navbar-fixed-top\': waypoints.status.down}" data-ng-show="loaded">\n\t\t\t<div class="container-fluid">\n\t\t\t\t<div class="navbar-header">\n\t\t\t\t\t<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#{{::id}}-collapse" aria-expanded="false">\n\t\t\t\t\t\t<span class="sr-only">Toggle navigation</span>\n\t\t\t\t\t\t<span class="icon-bar"></span>\n\t\t\t\t\t\t<span class="icon-bar"></span>\n\t\t\t\t\t\t<span class="icon-bar"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<img data-ng-if="brandLogo" class="navbar-brand-logo" data-ng-src="{{brandLogo}}" alt="brand logo"/>\n\t\t\t\t\t<span data-ng-if="brandLabel" class="navbar-brand" data-ng-bind="brandLabel"></span>\n\t\t\t\t\t<button type="button" class="navbar-dock-toggle" data-ng-click="toggleDock()">\n\t\t\t\t\t\t<span class="sr-only">Toggle dock</span>\n\t\t\t\t\t\t<span class="fa fa-tachometer"></span>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="collapse navbar-collapse" id="{{::id}}-collapse">\n\t\t\t\t\t<ul class="nav navbar-nav" data-ng-if="config" role="menubar">\n\t\t\t\t\t\t<li data-ng-repeat="item in config"\n\t\t\t\t\t\t\tclass="{{::getNavClass(item)}}"\n\t\t\t\t\t\t\trole="none"\n\t\t\t\t\t\t\tdata-ng-class="{\'dropdown dropdown-hover\':item.children, \'navbar-right\':item.right}">\n\t\t\t\t\t\t\t<a data-ng-if="item.children"\n\t\t\t\t\t\t\t   href="{{::getHref(item)}}"\n\t\t\t\t\t\t\t   class="dropdown-toggle"\n\t\t\t\t\t\t\t   data-toggle="dropdown"\n\t\t\t\t\t\t\t   data-ng-click="onClick(item, $event)"\n\t\t\t\t\t\t\t   data-ng-focus="onFocus(item, $event)"\n\t\t\t\t\t\t\t   role="menuitem"\n\t\t\t\t\t\t\t   aria-expanded="false"\n\t\t\t\t\t\t\t   data-ng-bind="item.label"></a>\n\t\t\t\t\t\t\t<ul data-ng-if="item.children" class="dropdown-menu" data-ng-class="{\'dropdown-submenu\': (item.navLevel.length > 1)}" role="menu">\n\t\t\t\t\t\t\t\t<li data-ng-repeat="subitem in item.children"\n\t\t\t\t\t\t\t\t\tclass="{{::getNavClass(subitem)}}"\n\t\t\t\t\t\t\t\t\tdata-ng-class="{\'navbar-right\':subitem.right}"\n\t\t\t\t\t\t\t\t\trole="none">\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t   href="{{::getHref(subitem)}}"\n\t\t\t\t\t\t\t\t\t   data-ng-click="onClick(subitem, $event)"\n\t\t\t\t\t\t\t\t\t   role="menuitem"\n\t\t\t\t\t\t\t\t\t   data-ng-bind="subitem.label"></a>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t<a data-ng-if="!item.children"\n\t\t\t\t\t\t\t   href="{{::getHref(item)}}"\n\t\t\t\t\t\t\t   data-ng-click="onClick(item, $event)"\n\t\t\t\t\t\t\t   role="link"\n\t\t\t\t\t\t\t   data-ng-bind="item.label"></a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</nav>\n\t</div>\n</div>')}]),angular.module("navigation/fastFindNav.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("navigation/fastFindNav.tpl.html",'<script type="text/ng-template" id="fastFindMenuItem.tpl">\n\t<a data-ng-href="{{item.url}}" data-ng-bind="item.label" data-ng-click="onClick(item, $event)"></a>\n\t<ul data-ng-if="item.children">\n\t\t<li data-ng-repeat="item in item.children" class="{{getNavClass(item)}}" data-ng-class="{\'pull-right\':item.right}" data-ng-include="\'fastFindMenuItem.tpl\'"></li>\n\t</ul>\n<\/script>\n\n<div data-ng-show="!loaded">\n\t<div data-svi-loader data-callback="setLoader" data-event-id="NAVIGATION" data-ignore-invisible="true"></div>\n</div>\n<div class="svi-directive svi-navigation fastFind" data-ng-show="loaded">\n\t<ul data-ng-if="config">\n\t\t<li data-ng-repeat="item in config" class="{{getNavClass(item)}}" data-ng-class="{\'pull-right\':item.right}" data-ng-include="\'fastFindMenuItem.tpl\'"></li>\n\t</ul>\n</div>')}]),angular.module("navigation/legacyNav.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("navigation/legacyNav.tpl.html",'<script type="text/ng-template" id="legacyMenuItem.tpl">\n\t<a data-ng-href="{{item.url}}" data-ng-click="onClick(item, $event)" tabindex="0">\n\t\t{{item.label}}\n\t\t<div data-ng-if="item.children && item.navLevel.length > 1" class="pull-right glyphicon glyphicon-chevron-right"></div>\n\t</a>\n\t<ul data-ng-if="item.children" data-ng-class="{\'dropdown-menu dropdown-submenu\': (item.navLevel.length > 1)}">\n\t\t<li data-ng-repeat="item in item.children"\n\t\t\tdata-ng-mouseenter="onMouseenter($event)"\n\t\t\tdata-ng-mouseleave="onMouseleave($event)"\n\t\t\tclass="{{getNavClass(item)}}"\n\t\t\tdata-ng-class="{\'pull-right\':item.right}"\n\t\t\tdata-ng-include="\'legacyMenuItem.tpl\'"></li>\n\t</ul>\n<\/script>\n\n<div data-ng-show="!loaded">\n\t<div data-svi-loader data-callback="setLoader" data-event-id="NAVIGATION" data-ignore-invisible="true"></div>\n</div>\n<div class="navbar-wrapper" data-ng-style="{height: navbarWrapperHeight}">\n\t<nav id="privateNav" class="svi-directive svi-navigation legacy" data-ng-class="{\'navbar-fixed-top\': waypoints.status.down}" data-ng-show="loaded">\n\t\t<ul id="mainNav" data-ng-if="config">\n\t\t\t<li data-ng-repeat="item in config"\n\t\t\t    data-ng-mouseenter="onMouseenter($event)"\n\t\t\t    data-ng-mouseleave="onMouseleave($event)"\n\t\t\t    class="{{getNavClass(item)}}"\n\t\t\t    data-ng-class="{\'pull-right\':item.right}"\n\t\t\t    data-ng-include="\'legacyMenuItem.tpl\'"></li>\n\t\t</ul>\n\t</nav>\n</div>\n')}]),angular.module("sessionReminder/sessionReminder.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("sessionReminder/sessionReminder.tpl.html",'<div class="svi-directive svi-session-reminder modal" data-backdrop-limit="1" tabindex="-1" role="dialog" aria-labelledby="{{::id}}-session_messageSub" aria-describedby="{{::id}}-session_timer">\n\t<div class="modal-dialog modal-{{::size}}" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 id="{{::id}}-modalTitle" class="modal-title" data-ng-bind="labels.sessionReminderTitle"></h1>\n\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="api.hideModal()" aria-label="Close"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-body">\n\t\t\t\t<h4 class="pre-line" data-ng-bind="labels.sessionReminderMessage|substitute:{\'%time%\':getTimeRemaining()}"></h4>\n\t\t\t</div>\n\t\t\t<div class="svi-visually-hidden">\n\t\t\t\t<h4 data-ng-bind="labels.sessionReminderMessageSub1|substitute:{\'%warnSeconds%\':warnCountDown}" id="{{::id}}-session_timer"></h4>\n\t\t\t\t<h4 data-ng-bind="labels.sessionReminderMessageSub2|substitute:{\'%warnMinute%\':warnCountMinute}" id="{{::id}}-session_messageSub" aria-live="polite"></h4>\n\t\t\t</div>\n\t\t\t<div class="modal-footer">\n\t\t\t\t<button type="button" class="btn btn-primary session-extend" data-dismiss="modal" data-ng-click="api.extendSession()" data-ng-bind="labels.sessionExtendButton"></button>\n\t\t\t\t<button type="button" class="btn btn-default session-logout" data-dismiss="modal" data-ng-click="api.logout()" data-ng-bind="labels.sessionLogoutButton"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("sessionReminder/sessionReminderUIDialog.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("sessionReminder/sessionReminderUIDialog.tpl.html",'<div class="svi-session-reminder">\n\t<div id="divtimeoutTemplate" data-ng-show="active">\n\t\t<span class="timeoutHeadline" data-ng-bind="labels.sessionReminderTitle"></span>\n\t\t<div class="timeoutDescription" data-ng-bind="labels.sessionReminderMessage|substitute:{\'%time%\':getTimeRemaining()}"></div>\n\t</div>\n</div>')}]),angular.module("subPageNav/subPageNav.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("subPageNav/subPageNav.tpl.html",'<ul class="svi-directive svi-sub-page-nav nav nav-tabs sub-pages" role="tablist">\n\t<li role="presentation" data-ng-repeat="tab in tabs" data-ng-class="{\'active\':$index == 0}">\n\t\t<a href="#{{::tab.id}}" aria-controls="{{::tab.id}}" role="tab" data-toggle="tab" data-ng-click="selectTab(tab.id, $event)" data-ng-bind-html="::tab.name"></a>\n\t</li>\n</ul>')}]),angular.module("welcomeMessage/welcomeMessage.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("welcomeMessage/welcomeMessage.tpl.html",'<div class="svi-directive svi-welcome-message modal" data-backdrop-limit="1" tabindex="-1" role="dialog" aria-labelledby="{{::id}}-modalTitle">\n\t<div class="modal-dialog modal-{{::size}}" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 id="{{::id}}-modalTitle" class="modal-title" data-ng-bind="::title"></h1>\n\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="api.hideModal()" aria-label="Close"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-body">\n\t\t\t\t<p class="pre-line" data-ng-bind="::message"></p>\n\t\t\t</div>\n\t\t\t<div class="modal-footer">\n\t\t\t\t<button type="button" class="btn btn-primary welcome-hide-forever" data-ng-click="api.hideForever()" data-ng-bind="::hideForeverBtn"></button>\n\t\t\t\t<button type="button" class="btn btn-default welcome-hide-session" data-ng-click="api.hideSession()" data-ng-bind="::hideSessionBtn"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("templates-orderStatus",["orderStatusContainer/orderStatusContainer.tpl.html","orderStatusContainer/orderStatusContainerWidget.tpl.html"]),angular.module("orderStatusContainer/orderStatusContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("orderStatusContainer/orderStatusContainer.tpl.html",'<div class="svi-directive row"><div class="col-md-12" data-svi-loader></div></div>\n<div class="row svi-order-status-container" data-ng-show="orderStatus">\n\t<div class="col-md-12">\n\t\t<div class="row paging-top" data-ng-show="pageSize && showPaging">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="ORDER_STATUS" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t\t<div class="row" data-ng-if="!bucketView">\n\t\t\t<div class="col-md-12" data-svi-order-status-grid\n\t\t\t\tdata-columns="columns"\n\t\t\t\tdata-column-priority="columnPriority"\n\t\t\t\tdata-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\tdata-order-status="orderStatus"\n\t\t\t\tdata-sort-field="sortField"\n\t\t\t\tdata-sort-dir="sortDir"\n\t\t\t\tdata-sortable="sortable"></div>\n\t\t</div>\n\t\t<div class="row" data-ng-if="bucketView" data-ng-repeat="statusType in orderStatus.statusTypes">\n\t\t\t<div class="col-md-12" data-svi-order-status-grid\n\t\t\t\tdata-columns="columns"\n\t\t\t\tdata-column-priority="columnPriority"\n\t\t\t\tdata-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\tdata-order-status="orderStatus"\n\t\t\t\tdata-status-type="{{statusType}}"\n\t\t\t\tdata-title="{{statusType}}"\n\t\t\t\tdata-sort-field="sortField"\n\t\t\t\tdata-sort-dir="sortDir"\n\t\t\t\tdata-sortable="sortable"></div>\n\t\t</div>\n\t\t<div class="row paging-botom" data-ng-show="pageSize && showPaging">\n\t\t\t<div class="col-md-12" data-svi-paging-control data-event-id="ORDER_STATUS" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("orderStatusContainer/orderStatusContainerWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("orderStatusContainer/orderStatusContainerWidget.tpl.html",'<div class="svi-directive svi-order-status-container" data-svi-widget data-title="labels.orderStatusTitle">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<div class="list-group-item" data-ng-show="orderStatus.orderStatus.length">\n\t\t\t\t\t<div data-svi-order-status-grid\n\t\t\t\t\t\t data-template="Widget"\n\t\t\t\t\t\t data-columns="columns"\n\t\t\t\t\t\t data-column-priority="columnPriority"\n\t\t\t\t\t\t data-responsive-columns="{{::responsiveColumns}}"\n\t\t\t\t\t\t data-order-status="orderStatus"\n\t\t\t\t\t\t data-sort-field="sortField"\n\t\t\t\t\t\t data-sort-dir="sortDir"\n\t\t\t\t\t\t data-sortable="sortable"></div>\n\t\t\t\t\t<div class="paging-botom" data-ng-show="pageSize && showPaging">\n\t\t\t\t\t\t<div data-svi-paging-control data-event-id="ORDER_STATUS" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n\t<svi:widget-shortcuts>\n\t\t<span class="more-icon fas fa-external-link-alt" data-ng-click="api.more()" title="{{labels.moreTooltip}}" role="button" aria-label="{{labels.orderStatusTitle}} {{labels.moreTooltip}}"></span>\n\t</svi:widget-shortcuts>\n</div>')}]),angular.module("templates-paLoans",["paLoan/paLoan.tpl.html","paLoanSummary/paLoanSummary.tpl.html"]),angular.module("paLoan/paLoan.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("paLoan/paLoan.tpl.html",'<div class="svi-directive pa-loan">\n\t<div class="form-group loan-account" data-ng-show="loanAccounts">\n\t\t<label class="control-label" for="loanAccount" data-ng-bind="labels.loanAccount"></label>\n\t\t<div class="dropdown" data-ng-show="loanAccounts">\n\t\t\t<button type="button" class="btn btn-default dropdown-toggle" data-ng-class="buttonClass" data-toggle="dropdown" aria-expanded="false">\n\t\t\t\t{{loanAccounts[loan].label}}\n\t\t\t\t<span class="caret"></span>\n\t\t\t</button>\n\t\t\t<ul class="dropdown-menu">\n\t\t\t\t<li data-ng-repeat="(key, value) in loanAccounts"><a data-ng-click="onLoanSelect($event)" data-loan-key="{{key}}" tabindex="-1" href="" data-ng-bind="value.label"></a></li>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div class="clearfix">&nbsp;</div>\n\t<div data-ng-show="selectedLoan">\n\t\t<dl class="dl-horizontal">\n\t\t\t<dt class="heading" data-ng-bind="labels.paLoanGeneralInfo"></dt>\n\t\t\t<dd class="heading">&nbsp;</dd>\n\t\t\t<dt data-ng-bind="labels.paLoanCurrentPrincipal"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.currPrinBal|sviCurrency"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanOriginationDate"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.loanOrigDt|sviDate:\'MM/dd/yyyy\'"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanMaturityDate"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.maturityDt|sviDate:\'MM/dd/yyyy\'"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanInterestRate"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.currIntRate|percent"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanRateType"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.rateType"></dd>\n\t\t\t<dt data-ng-if="showOriginalLoanAmount" data-ng-bind="labels.paLoanOriginalAmount"></dt>\n\t\t\t<dd data-ng-if="showOriginalLoanAmount" data-ng-bind="selectedLoan.origLoanAmt|sviCurrency"></dd>\n\t\t</dl>\n\t\t<div class="clearfix">&nbsp;</div>\n\t\t<dl class="dl-horizontal">\n\t\t\t<dt class="heading" data-ng-bind="labels.paLoanCreditAvailable"></dt>\n\t\t\t<dd class="heading">&nbsp;</dd>\n\t\t\t<dt data-ng-bind="labels.paLoanCreditLineAmount"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.creditLineAmt|sviCurrency"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanCreditRemaining"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.availLineRemain|sviCurrency"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanLastAdvanceDate"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.lastAdvanceDt|sviDate:\'MM/dd/yyyy\'"></dd>\n\t\t</dl>\n<div class="clearfix">&nbsp;</div>\n\t\t<dl class="dl-horizontal">\n\t\t\t<dt class="heading" data-ng-bind="labels.paLoanPaymentInfo"></dt>\n\t\t\t<dd class="heading">&nbsp;</dd>\n\t\t\t<dt data-ng-bind="labels.paLoanLastPaymentDate"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.lastPaymentDt|sviDate:\'MM/dd/yyyy\'"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanNextPaymentDt"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.nextPaymentDt|sviDate:\'MM/dd/yyyy\'"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanScheduledPayment"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.schedPayment|sviCurrency"></dd>\n\t\t</dl>\n\t\t<div class="clearfix">&nbsp;</div>\n\t\t<dl class="dl-horizontal">\n\t\t\t<dt class="heading" data-ng-bind="labels.paLoanYTDTotals"></dt>\n\t\t\t<dd class="heading">&nbsp;</dd>\n\t\t\t<dt data-ng-bind="labels.paLoanYTDPrincipal"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.ytdPrincipal|sviCurrency"></dd>\n\t\t\t<dt data-ng-bind="labels.paLoanYTDInterest"></dt>\n\t\t\t<dd data-ng-bind="selectedLoan.ytdInterest|sviCurrency"></dd>\n\t\t</dl>\n\t\t<p class="footnote"><span class="asOfLabel" data-ng-bind="labels.paLoanAsOfDt"></span> <span data-ng-bind="selectedLoan.asOfDt|sviDate:\'MM/dd/yyyy\'"></span></p>\n\t</div>\n</div>')}]),angular.module("paLoanSummary/paLoanSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("paLoanSummary/paLoanSummary.tpl.html",'<div class="svi-directive pa-loan-summary">\n\t<div data-svi-loader data-callback="setLoader" data-hidden="true"></div>\n\t<div data-ng-if="pledgeAcctLoans.length">\n\t\t<table class="dataTable table svi-pa-loan-summary-table" id="paLoanSummary">\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-ng-bind="labels.paLoanAccount"></th>\n\t\t\t\t<th data-ng-bind="labels.pledgedAccounts"></th>\n\t\t\t\t<th data-ng-bind="labels.paLoanName"></th>\n\t\t\t\t<th data-ng-bind="labels.paLoanCurrPrinBal"></th>\n\t\t\t\t<th data-ng-bind="labels.paLoanAvailLineRemain"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat="pledgeAcctLoan in pledgeAcctLoans">\n\t\t\t\t<td><a data-ng-href="{{paLoanUrl}}"\n\t\t\t\t\t   data-ng-click="onClick(pledgeAcctLoan)"\n\t\t\t\t\t   data-ng-bind="pledgeAcctLoan.pledgeAccountLoan[0].loanAcctNo"></a>\n\t\t\t\t</td>\n\t\t\t\t<td data-ng-bind="pledgeAcctLoan.pledgeAccountLoan[0].invAcctNo"></td>\n\t\t\t\t<td data-ng-bind="pledgeAcctLoan.pledgeAccountLoan[0].name"></td>\n\t\t\t\t<td\n\t\t\t\t\t\tdata-ng-bind="pledgeAcctLoan.pledgeAccountLoan[0].currPrinBal|sviCurrency"\n\t\t\t\t\t\tclass="currency"></td>\n\t\t\t\t<td\n\t\t\t\t\t\tdata-ng-bind="pledgeAcctLoan.pledgeAccountLoan[0].availLineRemain|sviCurrency"\n\t\t\t\t\t\tclass="currency"></td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t<tfoot>\n\t\t\t<tr class="totalRow" data-ng-show="false">\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class="total currency"\n\t\t\t\t\tdata-ng-bind="paSummary.aggCurrPrinBal|sviCurrency"></td>\n\t\t\t\t<td class="total currency"\n\t\t\t\t\tdata-ng-bind="paSummary.aggAvailLineRemain|sviCurrency"></td>\n\t\t\t</tr>\n\t\t\t</tfoot>\n\t\t</table>\n\t</div>\n\t<div class="dashboardDisclosure">\n\t\t<div data-ng-if="pledgeAcctLoans.length" data-ng-bind-html="disclaimerWithLoans"></div>\n\t\t<div data-ng-if="!pledgeAcctLoans.length" data-ng-bind-html="disclaimerNoLoans"></div>\n\t</div>\n</div>')}]),angular.module("templates-portfolio",["historicalAllocationChart/historicalAllocationChart.tpl.html","historicalAllocationChartContainer/historicalAllocationChartContainer.tpl.html","historicalAllocationChartContainer/historicalAllocationChartContainerWidget.tpl.html","historicalPerformanceChartReport/historicalPerformanceChartReport.tpl.html","performanceChart/performanceChart.tpl.html","periodReport/periodReport.tpl.html","portfolioSummary/portfolioSummary.tpl.html","portfolioSummary/portfolioSummaryTop.tpl.html","portfolioValueChart/portfolioValueChart.tpl.html","portfolioValueChart/portfolioValueChartModal.tpl.html","portfolioValueChart/portfolioValueChartWidget.tpl.html","targetedMarketingMessages/targetedMarketingMessages.tpl.html","topmovers/topmovers.tpl.html","topmovers/topmoversClassic.tpl.html","topmovers/topmoversClassicHover.tpl.html","topmovers/topmoversHover.tpl.html","topmovers/topmoversWidget.tpl.html","topMoversAndNewsContainer/topMoversAndNewsContainer.tpl.html"]),angular.module("historicalAllocationChart/historicalAllocationChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("historicalAllocationChart/historicalAllocationChart.tpl.html",'<div id="{{::id}}">\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n\t<div class="svi-historical-allocation-chart"></div>\n</div>\n')}]),angular.module("historicalAllocationChartContainer/historicalAllocationChartContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("historicalAllocationChartContainer/historicalAllocationChartContainer.tpl.html",'<div class="svi-historical-allocation-chart-container">\n\t<div data-ng-if="rangeDropdown" class="row controls">\n\t\t<div class="range" data-ng-if="rangeDropdown" data-svi-filter-dropdown\n\t\t\t data-dropdown-class="dropdown-menu historicalAllocation-chart-container-range-dropdown"\n\t\t\t data-event-id="HISTORICAL_ALLOCATION_CHART_CONTAINER.RANGE"\n\t\t\t data-selected="{{range}}"\n\t\t\t data-options="{{rangeDropdown}}"></div>\n\t\t<a href="" data-ng-click="launchInvestments()">Details...</a>\n\t</div>\n\t<div class="tabs" data-svi-tabs>\n\t\t<div class="item" data-tab-title="Performance">\n\t\t\t<div class="vertical" data-svi-historical-allocation-chart\n\t\t\t\t data-type="PERFORMANCE"\n\t\t\t\t data-range="range"\n\t\t\t\t data-chart-type="{{chartType}}"\n\t\t\t\t data-title="{{title}}"\n\t\t\t\t data-donut-inner-size="{{donutInnerSize}}"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="Risk">\n\t\t\t<div class="vertical" data-svi-historical-allocation-chart\n\t\t\t\t data-type="RISK"\n\t\t\t\t data-range="range"\n\t\t\t\t data-chart-type="{{chartType}}"\n\t\t\t\t data-title="{{title}}"\n\t\t\t\t data-donut-inner-size="{{donutInnerSize}}"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="Sector">\n\t\t\t<div class="vertical" data-svi-historical-allocation-chart\n\t\t\t\t data-type="SECTOR"\n\t\t\t\t data-range="range"\n\t\t\t\t data-chart-type="{{chartType}}"\n\t\t\t\t data-title="{{title}}"\n\t\t\t\t data-donut-inner-size="{{donutInnerSize}}"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="Asset Type">\n\t\t\t<div class="vertical" data-svi-historical-allocation-chart\n\t\t\t\t data-type="ASSET_TYPE"\n\t\t\t\t data-range="range"\n\t\t\t\t data-chart-type="{{chartType}}"\n\t\t\t\t data-title="{{title}}"\n\t\t\t\t data-donut-inner-size="{{donutInnerSize}}"></div>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("historicalAllocationChartContainer/historicalAllocationChartContainerWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("historicalAllocationChartContainer/historicalAllocationChartContainerWidget.tpl.html",'<div class="svi-directive svi-historical-allocation-chart-container-widget" data-svi-widget data-title="labels.allocationChartTitle" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n                    <div class="svi-historical-allocation-chart-container">\n                        <div data-ng-if="rangeDropdown" class="controls">\n                            <div class="range" data-ng-if="rangeDropdown" data-svi-filter-dropdown\n                                 data-dropdown-class="dropdown-menu historicalAllocation-chart-container-range-dropdown"\n                                 data-event-id="HISTORICAL_ALLOCATION_CHART_CONTAINER.RANGE"\n                                 data-selected="{{range}}"\n                                 data-options="{{rangeDropdown}}"></div>\n                            <a href="" class="details-link" data-ng-click="launchInvestments()">Details...</a>\n                        </div>\n                        <div class="tabs" data-svi-tabs>\n                            <div class="item" data-tab-title="Performance">\n                                <div class="vertical" data-svi-historical-allocation-chart\n                                     data-type="PERFORMANCE"\n                                     data-range="range"\n                                     data-chart-type="{{chartType}}"\n                                     data-title="{{title}}"\n                                     data-donut-inner-size="{{donutInnerSize}}"></div>\n                            </div>\n                            <div class="item" data-tab-title="Risk">\n                                <div class="vertical" data-svi-historical-allocation-chart\n                                     data-type="RISK"\n                                     data-range="range"\n                                     data-chart-type="{{chartType}}"\n                                     data-title="{{title}}"\n                                     data-donut-inner-size="{{donutInnerSize}}"></div>\n                            </div>\n                            <div class="item" data-tab-title="Sector">\n                                <div class="vertical" data-svi-historical-allocation-chart\n                                     data-type="SECTOR"\n                                     data-range="range"\n                                     data-chart-type="{{chartType}}"\n                                     data-title="{{title}}"\n                                     data-donut-inner-size="{{donutInnerSize}}"></div>\n                            </div>\n                            <div class="item" data-tab-title="Asset Type">\n                                <div class="vertical" data-svi-historical-allocation-chart\n                                     data-type="ASSET_TYPE"\n                                     data-range="range"\n                                     data-chart-type="{{chartType}}"\n                                     data-title="{{title}}"\n                                     data-donut-inner-size="{{donutInnerSize}}"></div>\n                            </div>\n                        </div>\n                    </div>\n\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("historicalPerformanceChartReport/historicalPerformanceChartReport.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("historicalPerformanceChartReport/historicalPerformanceChartReport.tpl.html",'<div class="svi-directive svi-historical-performance-chart-report" data-svi-widget data-title="labels.historicalPerformanceChartReportTitle" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div data-svi-performance-chart\n                         data-benchmark="{{ benchmark }}"\n                         data-benchmarks="{{ benchmarks }}"></div>\n                    <div data-svi-period-report></div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("performanceChart/performanceChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("performanceChart/performanceChart.tpl.html",'<div class="svi-directive svi-performance-chart" id="{{::id}}">\n\t<div class="row controls">\n\t\t<div class="col-md-6 col-xs-6">\n\t\t\t<span data-ng-if="rangeDropdown" data-svi-filter-dropdown\n\t\t\t\tdata-dropdown-class="dropdown-menu performance-chart-range-dropdown"\n\t\t\t\tdata-event-id="PERFORMANCE_CHART.RANGE"\n\t\t\t\tdata-selected="{{range}}"\n\t\t\t\tdata-options="{{rangeDropdown}}"></span>\n\t\t</div>\n\t\t<div class="col-md-6 legends col-xs-6" style="text-align: right;">\n\t\t\t<div class="account-indicator"></div>\n\t\t\t<div class="account-label">Account</div>\n\t\t\t<div class="benchmark-indicator"></div>\n\t\t\t<div data-ng-if="benchmarkDropdown" data-svi-filter-dropdown\n\t\t\t\tdata-dropdown-class="dropdown-menu-right benchmark-dropdown"\n\t\t\t\tdata-event-id="PERFORMANCE_CHART.BENCHMARK"\n\t\t\t\tdata-selected="{{benchmark}}"\n\t\t\t\tdata-options="{{benchmarkDropdown}}">\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n\t<div data-ng-show="loaded" class="svi-performance_chart"></div>\n</div>\n')}]),angular.module("periodReport/periodReport.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("periodReport/periodReport.tpl.html",'<div class="svi-period-report" id="svi-period-report">\n\t<div data-svi-loader data-callback="setLoader"></div>\n\n\t<div class="col-md-6 col-sm-12 hidden-sm hidden-xs">\n\t\t<dl class="dl-horizontal">\n\t\t\t<dt class="col-md-6" data-ng-bind="\'beginningPositionValue\'|labels:labels"></dt>\n\t\t\t<dd class="col-md-6" data-ng-bind="beginningMarketValue | sviCurrency:null:null:0"></dd>\n\t\t\t<dt class="col-md-6" data-ng-bind="\'endingPositionValue\'|labels:labels"></dt>\n\t\t\t<dd class="col-md-6" data-ng-bind="endingMarketValue | sviCurrency:null:null:0"></dd>\n\t\t\t<dt class="col-md-6" data-ng-bind="\'positionValueChange\'|labels:labels"></dt>\n\t\t\t<dd class="col-md-6" data-ng-bind-html="mvd | currencyChange:null:null:0"></dd>\n\t\t</dl>\n\t</div>\n\t<div class="col-md-6 col-sm-12 hidden-sm hidden-xs">\n\t\t<dl class="dl-horizontal">\n\t\t\t<dt class="col-md-6" data-ng-bind="\'positionInOutflows\'|labels:labels"></dt>\n\t\t\t<dd class="col-md-6" data-ng-bind="dnw | sviCurrency:null:null:0"></dd>\n\t\t\t<dt class="col-md-6" data-ng-bind="\'interest\'|labels:labels"></dt>\n\t\t\t<dd class="col-md-6" data-ng-bind="interest | sviCurrency:null:null:0"></dd>\n\t\t\t<dt class="col-md-6" data-ng-bind="\'dividends\'|labels:labels"></dt>\n\t\t\t<dd class="col-md-6" data-ng-bind="dividends | sviCurrency:null:null:0"></dd>\n\t\t</dl>\n\t</div>\n\n\t<div class="row hidden-md hidden-lg">\n\t\t<table class="table table-striped period-report-table">\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td class="labels-title" data-ng-bind="labels.beginningPositionValue"></td>\n\t\t\t\t<td class="reports-values" data-ng-bind="beginningMarketValue | sviCurrency:null:null:0"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class="labels-title" data-ng-bind="labels.endingPositionValue"></td>\n\t\t\t\t<td class="reports-values" data-ng-bind="endingMarketValue | sviCurrency:null:null:0"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class="labels-title" data-ng-bind="labels.positionValueChange"></td>\n\t\t\t\t<td class="reports-values" data-ng-bind-html="mvd | currencyChange:null:null:0"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class="labels-title" data-ng-bind="labels.positionInOutflows"></td>\n\t\t\t\t<td class="reports-values" data-ng-bind="dnw | sviCurrency:null:null:0"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class="labels-title" data-ng-bind="labels.interest"></td>\n\t\t\t\t<td class="reports-values" data-ng-bind="interest | sviCurrency:null:null:0"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class="labels-title" data-ng-bind="labels.dividends"></td>\n\t\t\t\t<td class="reports-values" data-ng-bind="dividends | sviCurrency:null:null:0"></td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n')}]),angular.module("portfolioSummary/portfolioSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("portfolioSummary/portfolioSummary.tpl.html",'<div class="svi-directive svi-portfolio-summary row" data-ng-class="{\'return-since-enabled\': showReturnSince, \'return-since-disabled\': !showReturnSince}">\n    <div data-svi-loader data-callback="setLoader"></div>\n    <div data-ng-show="loaded" class="portfolio-summary-container">\n        <div class="portfolio-summary-item">\n            <label data-ng-bind="labels.portfolioSummaryTotalPortfolioValue"></label>\n            <p class="marketValue" data-ng-bind="marketValue|sviCurrency"></p>\n        </div>\n        <div class="portfolio-summary-item portfolio-summary-day-change" data-ng-show="loaded">\n            <label data-ng-bind="labels.portfolioSummaryDayChange"></label>\n            <p class="{{{true: \'downtick\', false: \'uptick dropup\'}[isDowntick]}}">\n                <span class="caret"></span>\n                <span data-ng-bind-html="marketValueChange|currencyChange"></span>\n                <span class="dayChangePercent" data-ng-bind-html="percentChange|percentChange:2:true"></span>\n            </p>\n        </div>\n        <div class="portfolio-summary-item" data-ng-show="showReturnSince">\n            <label>Return Since Yesterday</label>\n            <p>\n                <span class="caret"></span>\n                TO DO\n            </p>\n        </div>\n        <div class="portfolio-summary-item portfolio-summary-cash">\n            <label data-ng-bind="labels.portfolioSummaryCash"></label>\n            <p data-ng-bind="cash|sviCurrency"></p>\n        </div>\n\t\t<div class="portfolio-summary-item" data-ng-if="buttonConfiguration">\n\t\t\t<button class="btn btn-info portfolio-summary-button" data-ng-click="triggerButtonEvent()" data-ng-bind="buttonConfiguration.label"></button>\n\t\t</div>\n    </div>\n</div>')}]),angular.module("portfolioSummary/portfolioSummaryTop.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("portfolioSummary/portfolioSummaryTop.tpl.html",'<div class="svi-directive svi-holding-market-value">\n    <div data-svi-loader data-callback="setLoader"></div>\n\n    <div class="row symbol-name-and-watchlist-block" data-ng-show="loaded">\n        <div class="col-md-6 col-sm-12 col-xs-12 flex-align portfolio-account-name-block">\n            <div class="account-nickname" data-ng-if="accountData.nickname" data-ng-bind-html="accountData.nickname|ellipsis:13:true:true"></div>\n            <span class="symbol-name-divider" data-ng-if="accountData.nickname">|</span>\n            <h3 data-ng-bind="accountData.number" data-ng-class="accountClasses" ></h3>\n        </div>\n        <div class="col-md-6 col-md-offset-0 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 flex-end">\n            <div class="last-price">\n                <div class="title" data-ng-bind="labels.portfolioSummaryTotalPortfolioValue"></div>\n                <div class="value" data-ng-bind="marketValue|sviCurrency"></div>\n            </div>\n            <div class="day-change">\n                <div class="title" data-ng-bind="labels.portfolioSummaryDayChange"></div>\n                <div class="value">\n                    <span data-ng-bind-html="marketValueChange|currencyChange"></span>\n                    <span class="parenChangePercent" data-ng-bind-html="percentChange|percentChange:2:true"></span>\n                </div>\n            </div>\n\n        </div>\n    </div>\n\n</div>\n')}]),angular.module("portfolioValueChart/portfolioValueChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("portfolioValueChart/portfolioValueChart.tpl.html",'<div class="svi-directive svi-portfolio-value-chart" id="{{::id}}">\n    <h3 class="title" data-ng-bind="labels.portfolioValueChartTitle"></h3>\n    <div data-svi-loader data-callback="setLoader"></div>\n    <div class="chart-wrapper ng-cloak" data-ng-cloak>\n        <div class="chart-inner">\n            <a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n            <div class="svi-visually-hidden" aria-live="polite">{{ rangeSelected }}</div>\n            <div class="value-chart"></div>\n        </div>\n    </div>\n\n    <div data-ng-style="activityTooltipStyle" data-ng-show="activityTooltipVisible" class="popover" data-ng-class="activityTooltipClass" tabindex="-1">\n        <div class="arrow" data-ng-style="activityTooltipArrowStyle"></div>\n        <h3 class="popover-title">\n            <b data-ng-bind="activity.date|sviDate:\'mediumDate\'"></b><br>\n            <b data-ng-bind="activity.balance|sviCurrency"></b>\n        </h3>\n        <div class="popover-content">\n            <p class="txn-unavail" data-ng-if="!activitySuccess" data-ng-bind="labels.transactionCategoriesUnavail"></p>\n            <table data-ng-if="activitySuccess">\n                <tbody>\n                <tr data-ng-repeat="item in activity.categories">\n                    <th data-ng-bind="item.name | labels:labels"></th>\n                    <td data-ng-bind="item.value | sviCurrency"></td>\n                </tr>\n                </tbody>\n            </table>\n\n            <a data-ng-if="activityUrl" data-ng-href="{{activityUrl}}">{{labels.viewAllActivityLink}}</a>\n        </div>\n    </div>\n</div>\n')}]),angular.module("portfolioValueChart/portfolioValueChartModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("portfolioValueChart/portfolioValueChartModal.tpl.html",'<div class="modal svi-directive svi-portfolio-value-chart" data-backdrop-limit="1" tabindex="-1" role="dialog" id="portfolioValueChartModal" aria-labelledby="portfolioValueChartModal">\n    <div class="modal-dialog modal-lg modal-dialog-centered" role="document">\n        <div class="modal-content">\n            <div class="modal-header">\n                <h1 id="portfolioValueChartModalTitle"\n                    class="modal-title"\n                    data-ng-bind-html="labels.portfolioValueChartTitle"></h1>\n                <button class="close dim glyphicon glyphicon-remove pointer"\n                     data-dismiss="modal"\n                     role="button"\n                     tabindex="0"\n                     aria-label="Close"></button>\n            </div>\n            <div class="modal-body" id="portfolioValueChartModalBody">\n                <div class="chart-wrapper">\n                    <div class="chart-inner">\n                        <a class="svi-visually-hidden"\n                           data-svi-skip-link="#portfolioValueChartModal .highcharts-contextbutton">\n                            {{labels.chartExportAccessible}}\n                        </a>\n                        <div class="svi-visually-hidden" aria-live="polite">{{ rangeSelected }}</div>\n                        <div class="value-chart-modal"></div>\n                    </div>\n                </div>\n                <div data-ng-attr-style="{{\'left:\'+ activityTooltipStyle.left+\'px!important;top:\'+activityTooltipStyle.top+\'px;position:absolute;display:block\'}}"\n                     data-ng-show="activityTooltipVisible"\n                     class="popover"\n                     data-ng-class="activityTooltipClass"\n                     tabindex="-1">\n                    <div class="arrow" data-ng-style="activityTooltipArrowStyle"></div>\n                    <h3 class="popover-title">\n                        <b data-ng-bind="activity.date|sviDate:\'mediumDate\'"></b><br>\n                        <b data-ng-bind="activity.balance|sviCurrency"></b>\n                    </h3>\n                    <div class="popover-content">\n                        <p class="txn-unavail"\n                           data-ng-if="!activitySuccess"\n                           data-ng-bind="labels.transactionCategoriesUnavail"></p>\n                        <table data-ng-if="activitySuccess">\n                            <tbody>\n                            <tr data-ng-repeat="item in activity.categories">\n                                <th data-ng-bind="item.name | labels:labels"></th>\n                                <td data-ng-bind="item.value | sviCurrency"></td>\n                            </tr>\n                            </tbody>\n                        </table>\n                        <a data-ng-if="activityUrl" data-ng-href="{{activityUrl}}">{{labels.viewAllActivityLink}}</a>\n                    </div>\n                </div>\n            </div>\n            <div class="modal-footer">\n                <button\n                        type="button"\n                        class="btn btn-primary"\n                        data-dismiss="modal"\n                        data-ng-bind="labels.close"></button>\n            </div>\n        </div>\n    </div>\n</div>\n')}]),angular.module("portfolioValueChart/portfolioValueChartWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("portfolioValueChart/portfolioValueChartWidget.tpl.html",'<div class="svi-directive svi-portfolio-value-chart" data-svi-widget data-title="labels.portfolioValueChartTitle" id="{{::id}}" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div class="loader" data-svi-loader data-callback="setLoader"></div>\n                    <div class="chart-wrapper">\n                        <div class="chart-inner">\n                            <a class="svi-visually-hidden"\n                               data-svi-skip-link="#{{::id}} .highcharts-contextbutton">\n                                {{labels.chartExportAccessible}}\n                            </a>\n                            <div class="svi-visually-hidden" aria-live="polite">{{ rangeSelected }}</div>\n                            <div class="value-chart"></div>\n                        </div>\n                    </div>\n                    <div data-ng-style="activityTooltipStyle"\n                         data-ng-show="activityTooltipVisible"\n                         class="popover"\n                         data-ng-class="activityTooltipClass"\n                         tabindex="-1">\n                        <div class="arrow" data-ng-style="activityTooltipArrowStyle"></div>\n                        <h3 class="popover-title">\n                            <b data-ng-bind="activity.date|sviDate:\'mediumDate\'"></b><br>\n                            <b data-ng-bind="activity.balance|sviCurrency"></b>\n                        </h3>\n                        <div class="popover-content">\n                            <p class="txn-unavail"\n                               data-ng-if="!activitySuccess"\n                               data-ng-bind="labels.transactionCategoriesUnavail"></p>\n                            <table data-ng-if="activitySuccess">\n                                <tbody>\n                                <tr data-ng-repeat="item in activity.categories">\n                                    <th data-ng-bind="item.name | labels:labels"></th>\n                                    <td data-ng-bind="item.value | sviCurrency"></td>\n                                </tr>\n                                </tbody>\n                            </table>\n                            <a data-ng-if="activityUrl" data-ng-href="{{activityUrl}}">{{labels.viewAllActivityLink}}</a>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n    <svi:widget-shortcuts>\n        <a class="expand-button"\n           href=""\n           data-toggle="modal"\n           data-target="#portfolioValueChartModal"\n           role="button"\n           data-ng-click="displayModal()"\n           data-backdrop="false"\n           aria-label="Portfolio Value panel zoomed in"\n           >\n            <i class="fas fa-expand-alt"\n               aria-hidden="true"></i>\n        </a>\n    </svi:widget-shortcuts>\n</div>\n')}]),angular.module("targetedMarketingMessages/targetedMarketingMessages.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("targetedMarketingMessages/targetedMarketingMessages.tpl.html",'<div class="svi-directive svi-targeted-marketing-messages" ng-class="{\'has-targeted-marketing-messages\': messages.length > 0}">\n    <div data-svi-loader data-callback="setLoader"></div>\n\t<div data-ng-if="messages.length > 0">\n\t\t<ul class="svi-tmm-box">\n\t\t\t<li data-ng-repeat="message in messages" data-ng-bind-html="message"></li>\n\t\t</ul>\n\t</div>\n</div>\n')}]),angular.module("topmovers/topmovers.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topmovers/topmovers.tpl.html",'<div class="svi-directive svi-topmovers box-row-style">\n\t<h3 class="title" data-ng-bind="labels.topmoversTitle" data-ng-show="showTitle"></h3>\n\t<div data-svi-loader></div>\n\t<div class="top-mover uptick dropup top-mover-winner col-lg-2 col-md-3 col-sm-3 col-xs-6"\n\t\t data-ng-repeat="uptick in upticks"\n\t\t data-ticker="{{uptick.instrument.symbol}}"\n\t\t data-ng-click="toggleTooltip($event)"\n\t\t aria-label="{{ uptick.instrument.symbol }} up {{ uptick.marketValueChange|sviCurrency }}"\n\t\t aria-expanded=\'false\'>\n\t\t<div class="top-mover-box">\n\t\t\t<div class="caret-container">\n\t\t\t\t<span class="caret"></span>\n\t\t\t</div>\n\t\t\t<div class="value-container">\n\t\t\t\t<span class="symbol" data-ng-bind-html="uptick.instrument.symbol|ellipsis:6"></span>\n\t\t\t\t<p data-ng-bind-html="uptick.marketValueChange|currencyChange"></p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class="top-mover downtick top-mover-loser col-lg-2 col-md-3 col-sm-3 col-xs-6"\n\t\t data-ng-repeat="downtick in downticks"\n\t\t data-ticker="{{downtick.instrument.symbol}}"\n\t\t data-ng-click="toggleTooltip($event)"\n\t\t aria-label="{{ downtick.instrument.symbol }} down {{ downtick.marketValueChange|sviCurrency }}"\n\t\t aria-expanded=\'false\'>\n\t\t<div class="top-mover-box">\n\t\t\t<div class="caret-container">\n\t\t\t\t<span class="caret"></span>\n\t\t\t</div>\n\t\t\t<div class="value-container">\n\t\t\t\t<span class="symbol" data-ng-bind-html="downtick.instrument.symbol|ellipsis:6"></span>\n\t\t\t\t<p data-ng-bind-html="downtick.marketValueChange|currencyChange"></p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div data-ng-include="\'topmovers/topmoversHover.tpl.html\'"></div>\n</div>')}]),angular.module("topmovers/topmoversClassic.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topmovers/topmoversClassic.tpl.html",'<div class="svi-directive svi-topmovers box-style">\n\t<h3 class="title" data-ng-bind="labels.topmoversTitle"></h3>\n\t<div data-svi-loader></div>\n\t<div class="top-mover {{uptick.classes}} uptick dropup" data-ng-repeat="uptick in upticks" data-ticker="{{uptick.instrument.symbol}}">\n\t\t<div>\n\t\t\t<span class="caret"></span>\n\t\t\t<p data-ng-bind-html="uptick.marketValueChange|currencyChange"></p>\n\t\t\t<span class="symbol" data-ng-bind="uptick.instrument.symbol"></span>\n\t\t</div>\n\t</div>\n\t<div class="top-mover {{downtick.classes}} downtick" data-ng-repeat="downtick in downticks" data-ticker="{{downtick.instrument.symbol}}">\n\t\t<div>\n\t\t\t<span class="caret"></span>\n\t\t\t<p data-ng-bind-html="downtick.marketValueChange|currencyChange"></p>\n\t\t\t<span class="symbol" data-ng-bind="downtick.instrument.symbol"></span>\n\t\t</div>\n\t</div>\n\t<div data-ng-include="\'topmovers/topmoversClassicHover.tpl.html\'"></div>\n</div>')}]),angular.module("topmovers/topmoversClassicHover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topmovers/topmoversClassicHover.tpl.html",'<div class="svi-directive svi-top-movers-hover hide">\n\t<p>{{labels.asOf}} {{topmover.asOfDate|sviDate:"MMM d, yyyy h:mm a \'ET\'"}}</p>\n\t<div class="row">\n\t\t<dl class="col-sm-1 col-xs-6">\n\t\t\t<dt class="quantity number" data-ng-bind="labels.topmoversQty"></dt>\n\t\t\t<dd class="quantity number" data-ng-bind="topmover.quantity|sviNumber:3"></dd>\n\t\t</dl>\n\t\t<dl class="col-sm-2 col-xs-6">\n\t\t\t<dt class="closingPrice currency" data-ng-bind="labels.topmoversPrice"></dt>\n\t\t\t<dd class="closingPrice currency" data-ng-bind="topmover.closingPrice|sviCurrency"></dd>\n\t\t</dl>\n\t\t<dl class="col-sm-3 col-xs-12">\n\t\t\t<dt class="dayChange number" data-ng-bind="labels.topmoversDayChange"></dt>\n\t\t\t<dd class="dayChange number">\n\t\t\t\t<span data-ng-bind-html="topmover.securityDayChange|currencyChange"></span>\n\t\t\t\t(<span data-ng-bind-html="topmover.securityPctDayChange|percentChange"></span>)\n\t\t\t</dd>\n\t\t</dl>\n\t\t<dl class="col-sm-3 col-xs-6">\n\t\t\t<dt class="marketValue currency" data-ng-bind="labels.topmoversMarketValue"></dt>\n\t\t\t<dd class="marketValue currency" data-ng-bind="topmover.marketValue|sviCurrency"></dd>\n\t\t</dl>\n\t\t<dl class="col-sm-3 col-xs-6">\n\t\t\t<dt class="marketValueChange number" data-ng-bind="labels.topmoversDayValueChange"></dt>\n\t\t\t<dd class="marketValueChange number" data-ng-bind-html="topmover.marketValueChange|currencyChange"></dd>\n\t\t</dl>\n\t</div>\n</div>')}]),angular.module("topmovers/topmoversHover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topmovers/topmoversHover.tpl.html",'<div class="svi-directive svi-top-movers-hover hide" aria-live="polite">\n\t<p class="symbol" data-ng-bind="topmover.symbol"></p>\n\t<p><span class="as-of">{{labels.asOf}} <span class="as-of-date">{{topmover.asOfDate|sviDate:"MMM d, yyyy h:mm a \'ET\'"}}</span></span></p>\n\t<div class="dl-grid">\n\t\t<dl class="row">\n\t\t\t<dt class="quantity number col-md-6 col-xs-6" data-ng-bind="labels.topmoversQty"></dt>\n\t\t\t<dd class="quantity number col-md-6 col-xs-6" data-ng-bind="topmover.quantity|sviNumber:3"></dd>\n\t\t</dl>\n\t\t<dl class="row">\n\t\t\t<dt class="closingPrice currency col-md-6 col-xs-6" data-ng-bind="labels.topmoversPrice"></dt>\n\t\t\t<dd class="closingPrice currency col-md-6 col-xs-6" data-ng-bind="topmover.closingPrice|sviCurrency"></dd>\n\t\t</dl>\n\t\t<dl class="row">\n\t\t\t<dt class="dayChange number col-md-6 col-xs-6" data-ng-bind="labels.topmoversDayChange"></dt>\n\t\t\t<dd class="dayChange number col-md-6 col-xs-6">\n\t\t\t\t<span data-ng-bind-html="topmover.securityDayChange|currencyChange"></span>\n\t\t\t\t(<span data-ng-bind-html="topmover.securityPctDayChange|percentChange"></span>)\n\t\t\t</dd>\n\t\t</dl>\n\t\t<dl class="row">\n\t\t\t<dt class="marketValue currency col-md-6 col-xs-6" data-ng-bind="labels.topmoversMarketValue"></dt>\n\t\t\t<dd class="marketValue currency col-md-6 col-xs-6" data-ng-bind="topmover.marketValue|sviCurrency"></dd>\n\t\t</dl>\n\t\t<dl class="row">\n\t\t\t<dt class="marketValueChange number col-md-6 col-xs-6" data-ng-bind="labels.topmoversDayValueChange"></dt>\n\t\t\t<dd class="marketValueChange number col-md-6 col-xs-6" data-ng-bind-html="topmover.marketValueChange|currencyChange"></dd>\n\t\t</dl>\n\t</div>\n</div>\n\n\n')}]),angular.module("topmovers/topmoversWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topmovers/topmoversWidget.tpl.html",'<div class="svi-directive svi-topmovers">\n\t<div data-svi-widget data-title="labels.topmoversWidgetTitle">\n\t\t<svi:widget-front>\n\t\t\t<div class="list-body">\n\t\t\t\t<ul class="list-group">\n\t\t\t\t\t<li class="list-group-item top-mover uptick" data-ng-repeat="item in upticks" data-ticker="{{item.instrument.symbol}}">\n\t\t\t\t\t\t<div class="color-bar" data-ng-class="item.classes"></div>\n\t\t\t\t\t\t<div class="symbol" data-ng-bind="item.instrument.symbol"></div>\n\t\t\t\t\t\t<div class="pct-change" data-ng-bind-html="item.percentChange|percentChange"></div>\n\t\t\t\t\t\t<div class="market-value-change" data-ng-bind-html="item.marketValueChange|currencyChange"></div>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class="list-group-item top-mover downtick" data-ng-repeat="item in downticks" data-ticker="{{item.instrument.symbol}}">\n\t\t\t\t\t\t<div class="color-bar" data-ng-class="item.classes"></div>\n\t\t\t\t\t\t<div class="symbol" data-ng-bind="item.instrument.symbol"></div>\n\t\t\t\t\t\t<div class="pct-change" data-ng-bind-html="item.percentChange|percentChange"></div>\n\t\t\t\t\t\t<div class="market-value-change" data-ng-bind-html="item.marketValueChange|currencyChange"></div>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</svi:widget-front>\n\t</div>\n\t<div data-ng-include="\'topmovers/topmoversHover.tpl.html\'"></div>\n</div>')}]),angular.module("topMoversAndNewsContainer/topMoversAndNewsContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topMoversAndNewsContainer/topMoversAndNewsContainer.tpl.html",'<div class="svi-directive svi-top-movers-and-news-container" data-svi-widget data-title="labels.topMoversAndNewsContainerTitle" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div data-svi-topmovers\n                         data-show-title="false"></div>\n                    <div data-svi-symbol-news\n                         data-ng-if="labels.newsTitle"\n                         class="clear-left"\n                         data-allow-overall="true"\n                         data-show-title="true"\n                         data-title="{{labels.newsTitle}}"\n                         data-event-name="{{newsEventName}}"\n                         data-limit="{{newsLimit}}"\n                         data-limit-display="{{newsLimitDisplay}}"\n                         data-use-modal="{{useModal}}"\n                         data-show-symbol="false"></div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n')}]),angular.module("templates-projectedIncome",["projectedIncomeContainer/projectedIncomeContainer.tpl.html","projectedMonthlyIncomeChart/projectedMonthlyIncomeChart.tpl.html"]),angular.module("projectedIncomeContainer/projectedIncomeContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("projectedIncomeContainer/projectedIncomeContainer.tpl.html",'<div class="svi-directive svi-projected-income-container row">\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<div class="col-md-12" data-ng-show="projectedIncome.sumRowData.length">\n\t\t<div data-svi-projected-income-grid\n\t\t\tdata-columns="columns"\n\t\t\tdata-column-priority="columnPriority"\n\t\t\tdata-responsive-columns="{{::responsiveColumns}}"\n\t\t\tdata-projected-income="projectedIncome"></div>\n\t</div>\n</div>')}]),angular.module("projectedMonthlyIncomeChart/projectedMonthlyIncomeChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("projectedMonthlyIncomeChart/projectedMonthlyIncomeChart.tpl.html",'<div class="row pad-right-20 svi-directive svi-projected-monthly-income" id="{{::id}}">\n\t<h3 class="title" data-ng-if="title" data-ng-bind="title"></h3>\n\t<div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n\t<div class="row chart-wrapper" id="chart-wrapper">\n\t\t<div class="chart-inner" data-ng-show="showChart">\n\t\t\t<a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n\t\t\t<div class="chart"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("templates-research",["addToWatchlist/addToWatchlist.tpl.html","analystConsensus/analystConsensus.tpl.html","averageAnnualReturns/averageAnnualReturns.tpl.html","companyOverview/companyOverview.tpl.html","dividendsEventsTable/dividendsEventsTable.tpl.html","earningsEventsTable/earningsEventsModal.tpl.html","earningsEventsTable/earningsEventsTable.tpl.html","economicEventsTable/economicEventsTable.tpl.html","etfDetails/etfDetails.tpl.html","etfSymbolName/etfSymbolName.tpl.html","eventsTableContainer/eventsTableContainer.tpl.html","fundAssetAllocation/fundAssetAllocation.tpl.html","fundDetails/fundDetails.tpl.html","fundDistribution/fundDistribution.tpl.html","fundEsgTable/fundEsgTable.tpl.html","fundExpenseRatios/fundExpenseRatios.tpl.html","fundExpenseRatioSummary/fundExpenseRatioSummary.tpl.html","fundGeographicExposure/fundGeographicExposure.tpl.html","fundGrowth/fundGrowth.tpl.html","fundGrowth/fundGrowthChart.tpl.html","fundHoldingsTable/fundHoldingsTable.tpl.html","fundLoadAndMinimums/fundLoadAndMinimums.tpl.html","fundMonthlyPriceHistory/fundMonthlyPriceHistory.tpl.html","fundOverview/fundOverview.tpl.html","fundPerformanceAAG/fundPerformanceAAG.tpl.html","fundRiskAnalysis/fundRiskAnalysis.tpl.html","fundSectorAllocation/fundSectorAllocation.tpl.html","fundStyleMap/fundStyleMap.tpl.html","fundSymbolName/fundSymbolName.tpl.html","globalIndicesGridContainer/globalIndicesGridContainer.tpl.html","globalIndicesMap/globalIndicesMap.tpl.html","globalIndicesTable/globalIndicesTable.tpl.html","indexTile/indexTile.tpl.html","ipoEventsTable/ipoEventsTable.tpl.html","lipperFundESGSummary/lipperFundESGSummary.tpl.html","lipperFundPerformanceAnalysis/lipperFundPerformanceAnalysis.tpl.html","lipperLeadersPerformance/lipperLeadersPerformance.tpl.html","lipperRatingsAAG/lipperRatingsAAG.tpl.html","marketClock/marketClock.tpl.html","marketEventsSummary/marketEventsSummary.tpl.html","marketIndices/marketIndices.tpl.html","marketMovers/marketMovers.tpl.html","priceHistoryAndFundGrowthContainer/priceHistoryAndFundGrowthContainer.tpl.html","sectorHeatmap/sectorHeatmap.tpl.html","sectorIndustriesChart/sectorIndustriesChart.tpl.html","sectorIndustriesContainer/sectorIndustriesContainer.tpl.html","sectorIndustriesGrid/sectorIndustriesGrid.tpl.html","stockBalanceSheet/stockBalanceSheet.tpl.html","stockCashFlow/stockCashFlow.tpl.html","stockCorporateEvents/stockCorporateEvents.tpl.html","stockDetails/stockDetails.tpl.html","stockDividendHistory/stockDividendHistory.tpl.html","stockEsgSummary/stockEsgSummary.tpl.html","stockIncomeStatement/stockIncomeStatement.tpl.html","stockKeyRatios/stockKeyRatios.tpl.html","stockOwnershipSummary/stockOwnershipSummary.tpl.html","stockOwnershipTopHolders/stockOwnershipTopHolders.tpl.html","stockPeers/stockPeers.tpl.html","stockPeers/stockPeersModal.tpl.html","stockSplitsEventsTable/stockSplitsEventsTable.tpl.html","stockSymbolName/stockSymbolName.tpl.html","topFundHoldings/topFundHoldings.tpl.html","topMoversContainer/topMoversContainer.tpl.html","topMoversTable/topMoversTable.tpl.html"]),angular.module("addToWatchlist/addToWatchlist.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("addToWatchlist/addToWatchlist.tpl.html",'<div class="svi-directive svi-add-to-watchlist">\n\t<div class="loader"\n\t     data-ignore-invisible="true"\n\t     data-hidden="true"\n\t     data-ng-class="{\'loader-hidden\': !shouldShowLoader}"\n\t     data-svi-loader\n\t     data-callback="getListLoader"></div>\n\t<span data-ng-show="listLoader.showSpinner" class="fa fa-spinner fa-spin"></span>\n\t<ul class="watchlist-wrapper">\n\t\t<li class="dropdown add-to-watchlist-dropdown">\n\t\t\t<div class="loader"\n\t\t\t     data-svi-loader\n\t\t\t     data-callback="addOrRemoveSymbolLoader"></div>\n\t\t\t<div class="alert-wrapper" data-ng-if="actionsDone">\n\t\t\t\t<div class="alert" role="status" aria-live="polite">\n\t\t\t\t\t<button type="button"\n\t\t\t\t\t        class="close"\n\t\t\t\t\t        autofocus\n\t\t\t\t\t        data-ng-click="closeAlert()"\n\t\t\t\t\t        aria-label="Close">\n\t\t\t\t\t\t<span aria-hidden="true">×</span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<i class="fa fa-exclamation-circle" aria-hidden="true"></i>\n\t\t\t\t\t<strong>{{symbol}}</strong>\n\t\t\t\t\t{{hasAdded === false ? labels.successfullyRemoved : labels.successfullyAdded }} {{watchlistName}}\n\t\t\t\t\t<a data-ng-if="viewWatchlistLink.length"\n\t\t\t\t\t   href="{{viewWatchlistLink}}"\n\t\t\t\t\t   class="alert-link"\n\t\t\t\t\t   data-ng-bind="labels.view"></a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<a data-ng-show="watchlists.length"\n\t\t\t   class="dropdown-toggle"\n\t\t\t   data-ng-class="selected.length ? \'disabled-link\' : \'\'"\n\t\t\t   data-toggle="dropdown"\n\t\t\t   data-ng-click="api.addSymbolToSingleWatchlist()"\n\t\t\t   href="javascript:void(0)"\n\t\t\t   role="button"\n\t\t\t   aria-haspopup="true"\n\t\t\t   aria-expanded="false">\n\t\t\t\t<span class="glyphicon glyphicon-plus-sign"></span>\n\t\t\t\t<span data-ng-if="selected.length && watchlists.length > 1"\n\t\t\t\t      data-ng-bind="labels.addedInWatchlist"></span>\n\t\t\t\t<span data-ng-if="!selected.length" data-ng-bind="labels.addToWatchlist"></span>\n\t\t\t\t<span data-ng-if="selected.length && watchlists.length === 1"\n\t\t\t\t      data-ng-bind="labels.removeFromWatchlist"></span>\n\t\t\t</a>\n\t\t\t<ul class="dropdown-menu add-to-watchlist-dropdown">\n\t\t\t\t<li data-ng-repeat="option in options">\n\t\t\t\t\t<div class="checkbox">\n\t\t\t\t\t\t<label for="checkbox{{option.display|convertSpaces}}">\n\t\t\t\t\t\t\t<input role="menuitemcheckbox"\n\t\t\t\t\t\t\t       type="checkbox"\n\t\t\t\t\t\t\t       data-ng-checked="option.isChecked"\n\t\t\t\t\t\t\t       class="checkbox"\n\t\t\t\t\t\t\t       data-ng-click="api.addOrRemoveFromWatchlist(option.display)"\n\t\t\t\t\t\t\t       name="checkbox{{option.display|convertSpaces}}"\n\t\t\t\t\t\t\t       id="checkbox{{option.display|convertSpaces}}"/>\n\t\t\t\t\t\t\t{{option.display}}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</li>\n\t</ul>\n</div>\n\n')}]),angular.module("analystConsensus/analystConsensus.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("analystConsensus/analystConsensus.tpl.html",'<div class="svi-directive data-svi-analyst-consensus" data-svi-widget\n\t data-title="labels.analystConsensusTitle" data-include-loader="false" data-hidden="analystData.length == 0">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="analyst-consensus-wrapper" data-ng-show="analystData">\n\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t<div class="col-md-7">\n\t\t\t\t\t\t\t\t<div class="consensus-block">\n\t\t\t\t\t\t\t\t\t<div class="consensus-title" data-ng-bind="labels.consensus"></div>\n\t\t\t\t\t\t\t\t\t<div class="gauge-chart-wrapper">\n\t\t\t\t\t\t\t\t\t\t<div class="gauge-chart"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="bar-table-block col-md-5">\n\t\t\t\t\t\t\t\t<div class="rating-title" data-ng-bind="labels.ratings"></div>\n\t\t\t\t\t\t\t\t<table class="table">\n\t\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<tr data-ng-repeat="sector in barChart">\n\t\t\t\t\t\t\t\t\t\t<td><span class="analyst-consensus-label" data-ng-bind="sector.name"></span></td>\n\t\t\t\t\t\t\t\t\t\t<td class="progress-bar-col">\n\t\t\t\t\t\t\t\t\t\t\t<div class="progress">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="progress-bar" role="progressbar"\n\t\t\t\t\t\t\t\t\t\t\t\t\t data-ng-attr-style="{{ \'background: \' + sector.color + \' !important; width:\' + sector.barWidth+ \' !important;\' }}"\n\t\t\t\t\t\t\t\t\t\t\t\t\t aria-valuenow="{{sector.value}}" aria-valuemin="0" aria-valuemax="{{maxValue}}" aria-label="{{sector.ariaLabel}}">\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<td class="analyst-consensus-value" data-ng-bind="sector.value"></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t<table class="table num-analysts-table">\n\t\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class="analyst-consensus-no-of-analysts" data-ng-bind="labels.noOfAnalysts"></td>\n\t\t\t\t\t\t\t\t\t\t<td class="analyst-consensus-value" data-ng-bind="analystData.numAnalysts"></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("averageAnnualReturns/averageAnnualReturns.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("averageAnnualReturns/averageAnnualReturns.tpl.html",'<div class="svi-directive svi-average-annual-returns" data-svi-widget data-title="labels.title"\n     data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n\t                <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t                <div class="loader" data-svi-loader data-callback="getFundGrowthLoader"></div>\n\t                <div class="row" data-ng-show="annualData">\n\t\t                <div class="col-md-12">\n\t\t\t                <div class="as-of" data-ng-if="asOfDate">\n\t\t\t\t                {{labels.asOf}} {{asOfDate | sviDate:"MM/dd/yyyy"}}\n\t\t\t                </div>\n\t\t\t                <div class="annotation">\n                            <span class="powered-by-lipper" data-ng-if="labels.poweredBy">\n\t\t\t\t\t\t\t\t<span data-ng-bind="labels.poweredBy"></span>\n\t\t\t\t\t\t\t\t<span data-svi-lipper-attribution\n\t\t\t\t\t\t\t\t      data-custom-class="lipper-leaders-performance-popover"\n\t\t\t\t\t\t\t\t      data-placement="bottom"\n\t\t\t\t\t\t\t\t      data-lipper-help-text="{{labels.disclosureText}}"></span>\n\t\t\t\t\t\t\t</span>\n\n\t\t\t                </div>\n\t\t                </div>\n\t\t                <div class="col-md-12">\n\t\t\t                <div class="chart"></div>\n\t\t                </div>\n\t\t                <div class="col-md-12">\n\t\t\t                <table data-svi-responsive-columns="responsiveColumnsSettings"\n\t\t\t                       class="table table-striped average-annual-returns-grid">\n\t\t\t\t                <thead>\n\t\t\t\t                <tr>\n\t\t\t\t\t                <th data-svi-column-header data-sortable="false" data-text=""></th>\n\t\t\t\t\t                <th ng-repeat="(key, annual) in annualTitles"\n\t\t\t\t\t                    data-svi-column-header data-sortable="false"\n\t\t\t\t\t                    data-text="annual" class="number" data-col-name="{{key}}"></th>\n\t\t\t\t                </tr>\n\t\t\t\t                </thead>\n\t\t\t\t                <tbody>\n\t\t\t\t                <tr ng-repeat="itemData in annualData"\n\t\t\t\t                    data-toggle-row="{{ ::$index }}"\n\t\t\t\t                    data-ng-class="{\'font-weight-bold\' : $index===0 }"\n\t\t\t\t                    data-svi-rc-toggle-row="rc">\n\t\t\t\t\t                <td data-ng-style="{ \'box-shadow\': \'6px 0 0 -1px \' + colors[$index] + \' inset\' }"\n\t\t\t\t\t                    data-ng-bind-html="::itemData.name"\n\t\t\t\t\t                    data-col-name="name"></td>\n\t\t\t\t\t                <td ng-repeat="(key, annual) in itemData.data"\n\t\t\t\t\t                    data-ng-bind-html="annual ? (annual|percent) : \'-\'"\n\t\t\t\t\t                    class="number"></td>\n\t\t\t\t                </tr>\n\t\t\t\t                </tbody>\n\t\t\t                </table>\n\t\t                </div>\n\t\t                <div class="col-md-12 lipper-footer" data-ng-if="labels.annualizedReturnsLabel">\n\t\t\t                <span data-ng-bind="labels.fundPerformanceDefinitions"></span>:\n\t\t\t                <span data-svi-lipper-attribution\n\t\t\t                      data-label="{{labels.annualizedReturnsLabel}}"\n\t\t\t                      data-custom-class="lipper-leaders-performance-popover" data-placement="bottom"\n\t\t\t                      data-lipper-help-text="{{labels.annualizedReturns}}"></span>\n\t\t                </div>\n\t                </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n\n\n')}]),angular.module("companyOverview/companyOverview.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("companyOverview/companyOverview.tpl.html",'<div class="svi-directive data-svi-company-overview" data-svi-widget data-title="labels.companyOverviewTitle" data-include-loader="false">\n\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="row" ng-if="info">\n\t\t\t\t\t\t<div class="col-md-6 companyOverview-wrapper">\n\t\t\t\t\t\t\t<div class="companyOverview-block">\n\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.companyOverviewBusinessDescription"></h4>\n\t\t\t\t\t\t\t\t<div class="info-block" data-ng-class="{\'strategy-text-expanded\': expanded, \'strategy-text\': !expanded}">\n\t\t\t\t\t\t\t\t\t{{info.businessDesc ? info.businessDesc : labels.companyOverviewBusinessDescriptionNotAvailable}}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-md-12 col-xs-12 more-less-banner-wrapper-responsive" ng-if="info.businessDesc && showMoreLess">\n\t\t\t\t\t\t\t<div class="more-less-banner">\n\t\t\t\t\t\t\t\t<button type="button" class="btn btn-lg btn-link" aria-expanded="{{ expanded ? \'true\' : \'false\'}}" data-ng-click="api.toggle()">\n\t\t\t\t\t\t\t\t\t{{ expanded ? labels.less : labels.more }} <span class="glyphicon" data-ng-class="{\'glyphicon-chevron-up\': expanded, \'glyphicon-chevron-down\': !expanded}"></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-md-6 companyOverview-wrapper">\n\t\t\t\t\t\t\t<div class="companyOverview-block">\n\t\t\t\t\t\t\t\t<span class="border-bottom overflow-hidden" ng-if="info.ceoLastName || info.ceoPreferredName">\n\t\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.companyOverviewCEO"></h4>\n\t\t\t\t\t\t\t\t\t<span class="fund-manager-name border-bottom">\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t{{info.ceoPreferredName + \' \' + info.ceoLastName}}\n\t\t\t\t\t\t\t\t\t\t\t<span class="ceo-start-year" ng-if="info.ceoStartYear">({{info.ceoStartYear}})</span>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class="border-bottom overflow-hidden" ng-if="!info.ceoLastName && !info.ceoPreferredName">\n\t\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.companyOverviewCEO"></h4>\n\t\t\t\t\t\t\t\t\t<span class="fund-manager-name">\n\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="labels.companyOverviewCEONotAvailable"></span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class="companyOverview-block">\n\t\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.companyOverviewContactInfo"></h4>\n\t\t\t\t\t\t\t\t\t<div class="info-block">\n\t\t\t\t\t\t\t\t\t\t<p ng-if="info.address"><span data-ng-repeat="street in info.address.street" data-ng-bind="street"></span></p>\n\t\t\t\t\t\t\t\t\t\t<p ng-if="info.address"><span ng-if="info.address.city">{{info.address.city}},</span> {{info.address.stateOrRegion}} {{info.address.postalCode}}</p>\n\t\t\t\t\t\t\t\t\t\t<p ng-if="info.phone">T: {{info.phone}}</p>\n\t\t\t\t\t\t\t\t\t\t<p ng-if="info.email">{{info.email}}</p>\n\t\t\t\t\t\t\t\t\t\t<p class="border-bottom" ng-if="info.website">{{info.website}}</p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span class="info-block" ng-if="!info.address && !info.phone && !info.email && !info.website"\n\t\t\t\t\t\t\t\t\t\t  data-ng-bind="labels.companyOverviewContactInfoNotAvailable"></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="companyOverview-block" data-ng-if="info.indexMemberships && (info.indexMemberships | filter: api.indexFilter).length > 0">\n\t\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" data-ng-bind="labels.listedIndexes"></h4>\n\t\t\t\t\t\t\t\t\t<ul class="indexMemberships">\n\t\t\t\t\t\t\t\t\t\t<li data-ng-repeat="index in info.indexMemberships | filter: api.indexFilter" data-ng-bind="index.desc"></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-md-12 col-xs-12 more-less-banner-wrapper" ng-if="info.businessDesc && showMoreLess">\n\t\t\t\t\t\t\t<div class="more-less-banner">\n\t\t\t\t\t\t\t\t<button type="button" class="btn btn-lg btn-link" aria-expanded="{{ expanded ? \'true\' : \'false\'}}" data-ng-click="api.toggle()">\n\t\t\t\t\t\t\t\t\t{{ expanded ? labels.less : labels.more }} <span class="glyphicon" data-ng-class="{\'glyphicon-chevron-up\': expanded, \'glyphicon-chevron-down\': !expanded}"></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\n\t</svi:widget-front>\n</div>')}]),angular.module("dividendsEventsTable/dividendsEventsTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("dividendsEventsTable/dividendsEventsTable.tpl.html",'<div class="svi-directive svi-dividends-events-table" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div class="row paging-top" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n\t\t<div class="col-md-12" data-svi-paging-control data-event-id="{{::pageEventId}}" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t</div>\n\t<div class="svi-dividends-events-grid" data-ng-if="companies.length > 0" data-ng-class="rc.getCollapsedCols()">\n\t\t<table data-svi-responsive-columns="responsiveColumnsSettings" class="table table-striped" data-ng-model="companies" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="exDate" data-text="labels.exDate" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="exDate"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="company" data-text="labels.company" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="company"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="symbol" data-text="labels.symbol" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="symbol"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="dividendAmount" data-text="labels.amount" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" class="number" data-col-name="dividendAmount"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="recordDate" data-text="labels.record" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="recordDate"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="paymentDate" data-text="labels.payableDate" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="paymentDate"></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat-start="item in companies" data-toggle-row="{{ ::$index }}" data-svi-rc-toggle-row="rc">\n\t\t\t\t\t<td data-col-name="exDate" data-ng-bind="item.exDate|sviDate: \'MM/dd/yyyy\'"></td>\n\t\t\t\t\t<td data-col-name="company" data-ng-bind="item.company"></td>\n\t\t\t\t\t<td data-col-name="symbol" data-svi-symbol data-symbol-string="{{::item.symbol}}"></td>\n\t\t\t\t\t<td data-col-name="dividendAmount" class="number" data-ng-bind="item.dividendAmount|sviNumber:2:true:true"></td>\n\t\t\t\t\t<td data-col-name="recordDate" data-ng-bind="item.recordDate|sviDate: \'MM/dd/yyyy\'"></td>\n\t\t\t\t\t<td data-col-name="paymentDate" data-ng-bind="item.paymentDate|sviDate: \'MM/dd/yyyy\'"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t\t<td colspan="5">\n\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t<td ng-bind-html="::detail.value"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\t<div class="row paging-bottom" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n\t\t<div class="col-md-12" data-svi-paging-control data-event-id="{{::pageEventId}}" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t</div>\n</div>')}]),angular.module("earningsEventsTable/earningsEventsModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("earningsEventsTable/earningsEventsModal.tpl.html",'<div class="modal svi-earnings-events-modal" data-backdrop-limit="1" tabindex="-1" role="dialog" id="{{::id}}-earnings-events-modal" aria-labelledby="{{::id}}-modalTitle">\n    <div class="modal-dialog modal-lg" role="document">\n        <div class="modal-content">\n            <div class="modal-header">\n                <h1 class="modal-title" data-ng-bind="title" id="{{::id}}-modalTitle"></h1>\n                <div class="close dim glyphicon glyphicon-remove pointer"\n                     data-ng-click="hide()"\n                     data-dismiss="modal"\n                     role="button"\n                     tabindex="0"\n                     aria-label="Close"></div>\n            </div>\n            <div class="modal-body">\n                <div data-svi-column-chart\n                     data-chart-data="{{chartData}}"\n                     data-title="{{labels.chartTitle}}"\n                     data-subtitle="{{labels.chartSubTitle}}"\n                     data-legend="chartLegend"></div>\n                <div class="row">\n                    <div class="col-sm-4">\n                        <dl class="dl-vertical">\n                            <dt class="data-label" data-ng-bind="labels.mostRecentReport"></dt>\n                            <dd class="data-value" data-ng-bind="callInfo.recentReport"></dd>\n                        </dl>\n                    </div>\n                    <div class="col-sm-3">\n                        <dl class="dl-vertical">\n                            <dt class="data-label" data-ng-bind="labels.upcomingEarningsCall"></dt>\n                            <dd class="data-value" data-ng-if="callInfo.start" data-ng-bind="callInfo.start | sviDate: \'MM/dd/yyyy\'"></dd>\n                            <dd class="data-value" data-ng-if="callInfo.start && callInfo.end">\n                                {{callInfo.start | sviDate:"h:mm a \'ET\'"}} - {{callInfo.end | sviDate:"h:mm a \'ET\'"}}\n                            </dd>\n                            <dd class="data-value" data-ng-if="!callInfo.start" data-ng-bind="labels.noWebcastUrl"></dd>\n                        </dl>\n                    </div>\n                    <div class="col-sm-3" data-ng-if="callInfo.url">\n                        <dl class="dl-vertical">\n                            <dt class="data-label">&nbsp;</dt>\n                            <dt class="data-label">&nbsp;</dt>\n                            <dd class="data-value" data-ng-if="callInfo.url">\n                                <a href="{{callInfo.url}}" target="_blank">{{labels.webcastLink}}</a>\n                            </dd>\n                        </dl>\n                    </div>\n                </div>\n            </div>\n            <div class="modal-footer">\n                <button type="button"\n                        class="btn btn-primary close-modal"\n                        data-dismiss="modal"\n                        tabindex="0"\n                        data-ng-click="hide()"\n                        data-ng-bind="labels.close"></button>\n            </div>\n        </div>\n    </div>\n</div>')}]),angular.module("earningsEventsTable/earningsEventsTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("earningsEventsTable/earningsEventsTable.tpl.html",'<div class="svi-directive svi-earnings-events-table" data-include-loader="false">\n    <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n    <div class="loader" data-svi-loader data-callback="setEarningsCAPDLoader"></div>\n    <div class="row paging-top" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n        <div class="col-md-12"\n             data-svi-paging-control\n             data-event-id="{{::pageEventId}}"\n             data-current-page="currentPage"\n             data-total-pages="totalPages"></div>\n    </div>\n    <div class="svi-earnings-events-grid" data-ng-if="companies.length > 0" data-ng-class="rc.getCollapsedCols()">\n        <table data-svi-responsive-columns="responsiveColumnsSettings"\n               class="table table-striped"`\n               data-ng-model="companies"\n               data-float-thead="floatTheadOptions">\n            <thead>\n                <tr>\n                    <th data-svi-column-header\n                        data-event-id="{{::api.eventName}}"\n                        data-sortable="{{::sortable}}"\n                        data-sort-field="releaseDate"\n                        data-text="labels.date"\n                        data-sorted-field="sortField"\n                        data-sorted-dir="sortDir"\n                        data-col-name="releaseDate"></th>\n                    <th data-svi-column-header\n                        data-event-id="{{::api.eventName}}"\n                        data-sortable="{{::sortable}}"\n                        data-sort-field="company"\n                        data-text="labels.company"\n                        data-sorted-field="sortField"\n                        data-sorted-dir="sortDir"\n                        data-col-name="company"></th>\n                    <th data-svi-column-header\n                        data-event-id="{{::api.eventName}}"\n                        data-sortable="{{::sortable}}"\n                        data-sort-field="symbol"\n                        data-text="labels.symbol"\n                        data-sorted-field="sortField"\n                        data-sorted-dir="sortDir"\n                        data-col-name="symbol"></th>\n                    <th data-svi-column-header\n                        data-event-id="{{::api.eventName}}"\n                        data-sortable="false"\n                        data-sort-field="calendarYear"\n                        data-text="labels.periodEnding"\n                        data-sorted-field="sortField"\n                        data-sort-dir="sortDir"\n                        data-col-name="periodEnding"></th>\n                    <th data-svi-column-header\n                        data-event-id="{{::api.eventName}}"\n                        data-sortable="false"\n                        data-sort-field="expectedEps"\n                        data-text="labels.estimatedEps"\n                        data-sorted-field="sortField"\n                        data-sorted-dir="sortDir"\n                        class="number"\n                        data-col-name="expectedEps"></th>\n                    <th data-svi-column-header\n                        data-event-id="{{::api.eventName}}"\n                        data-sortable="false"\n                        data-sort-field="actualEps"\n                        data-text="labels.reportedEps"\n                        data-sorted-field="sortField"\n                        data-sorted-dir="sortDir"\n                        class="number"\n                        data-col-name="actualEps"></th>\n                    <th data-svi-column-header\n                        data-event-id="{{::api.eventName}}"\n                        data-sortable="false"\n                        data-sort-field="variance"\n                        data-text="labels.variance"\n                        data-sorted-field="sortField"\n                        data-sorted-dir="sortDir"\n                        class="number"\n                        data-col-name="variance"></th>\n                    <th data-svi-column-header\n                        data-event-id="{{::api.eventName}}"\n                        data-sortable="false"\n                        data-text="labels.earningsCallHistory"\n                        data-col-name="earningsCallHistory"></th>\n                </tr>\n            </thead>\n            <tbody>\n            <tr data-ng-repeat-start="item in companies"\n                data-toggle-row="{{ ::$index }}"\n                data-svi-rc-toggle-row="rc"\n                data-ng-if="item.type === \'EarningsReleases\'">\n                <td data-col-name="releaseDate" data-ng-bind="item.releaseDate|sviDate: \'MM/dd/yyyy\'"></td>\n                <td data-col-name="company" data-ng-bind="item.company"></td>\n                <td data-col-name="symbol" data-svi-symbol data-symbol-string="{{::item.symbol}}"></td>\n                <td data-col-name="periodEnding" data-ng-bind="item.periodEnding|sviDate: \'MM-yyyy\'"></td>\n                <td class="number" data-col-name="expectedEps" data-ng-bind="item.expectedEps|sviNumber:2:true:false"></td>\n                <td class="number" data-col-name="actualEps" data-ng-bind="item.actualEps|sviNumber:2:true:false"></td>\n                <td class="number" data-col-name="variance" data-ng-bind="item.variance|percent:2"></td>\n                <td data-col-name="earningsCallHistory">\n                    <a role="button"\n                       data-ng-if="item.callAndPresentation"\n                       href=""\n                       data-toggle="modal"\n                       data-ng-click="displayModal(item)">\n                        {{labels.details}}\n                    </a>\n                    <span data-ng-if="!item.callAndPresentation">-</span>\n                </td>\n            <tr class="hide"><td>&nbsp;</td></tr>\n            <tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n                <td colspan="5">\n                    <table class="table svi-detail-table">\n                        <tr data-ng-repeat="detail in rc.getRowDetails($index)">\n                            <th data-ng-bind="::detail.label"></th>\n                            <td data-ng-if="detail.value.trim() !== labels.details" data-ng-bind-html="::detail.value"></td>\n                            <td data-ng-if="detail.value.trim() === labels.details">\n                                <a role="button"\n                                   data-ng-if="item.callAndPresentation"\n                                   href=""\n                                   data-toggle="modal"\n                                   data-ng-click="displayModal(item)">\n                                    {{labels.details}}\n                                </a>\n                            </td>\n                        </tr>\n                    </table>\n                </td>\n            </tr>\n            </tbody>\n        </table>\n    </div>\n    <div class="row paging-bottom" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n        <div class="col-md-12"\n             data-svi-paging-control\n             data-event-id="{{::pageEventId}}"\n             data-current-page="currentPage"\n             data-total-pages="totalPages"></div>\n    </div>\n</div>')}]),angular.module("economicEventsTable/economicEventsTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("economicEventsTable/economicEventsTable.tpl.html",'<div class="svi-directive svi-economic-events-table" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div class="row paging-top" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n\t\t<div class="col-md-12" data-svi-paging-control data-event-id="{{::pageEventId}}" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t</div>\n\t<div class="svi-economic-events-grid" data-ng-if="companies.length > 0" data-ng-class="rc.getCollapsedCols()">\n\t\t<table data-svi-responsive-columns="responsiveColumnsSettings" class="table table-striped" data-ng-model="companies" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="date" data-text="labels.when" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="date"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="name" data-text="labels.name" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="name"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="classification" data-text="labels.classification" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="classification"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="country" data-text="labels.country" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="country"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="period" data-text="labels.period" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="period"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="actual" data-text="labels.actual" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="actual"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="expected" class="number" data-text="labels.expected" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="expected"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="previous" class="number" data-text="labels.previous" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="previous"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="change" class="number" data-text="labels.change" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="change"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="false"\n\t\t\t\t\t\tdata-sort-field="lastUpdate" data-text="labels.lastUpdate" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="lastUpdate"></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat-start="item in companies" data-toggle-row="{{ ::$index }}" data-svi-rc-toggle-row="rc">\n\t\t\t\t\t<td data-col-name="date" data-ng-bind="item.date|sviDate: \'MM/dd/yyyy\'"></td>\n\t\t\t\t\t<td data-col-name="name" data-ng-bind="item.name"></td>\n\t\t\t\t\t<td data-col-name="classification" data-ng-bind="item.classification"></td>\n\t\t\t\t\t<td data-col-name="country" data-ng-bind="item.country"></td>\n\t\t\t\t\t<td data-col-name="period" data-ng-bind="item.period"></td>\n\t\t\t\t\t<td data-col-name="actual" data-ng-bind="item.actual|sviNumber:2:true:true"></td>\n\t\t\t\t\t<td data-col-name="expected" class="number" data-ng-bind="item.expected|sviNumber:2:true:true"></td>\n\t\t\t\t\t<td data-col-name="previous" class="number" data-ng-bind="item.previous|sviNumber:2:true:true"></td>\n\t\t\t\t\t<td data-col-name="change" class="number"\n\t\t\t\t\t\tdata-ng-class="{positive: item.change > 0, negative: item.change < 0}"\n\t\t\t\t\t\tdata-ng-bind="item.change|sviNumber:2:true:true"></td>\n\t\t\t\t\t<td data-col-name="lastUpdate" data-ng-bind="item.lastUpdate|sviDate: \'MM/dd/yyyy\'"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t\t<td colspan="5">\n\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t<td ng-bind-html="::detail.value"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\t<div class="row paging-bottom" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n\t\t<div class="col-md-12" data-svi-paging-control data-event-id="{{::pageEventId}}" data-current-page="currentPage" data-total-pages="totalPages"></div>\n\t</div>\n</div>')}]),angular.module("etfDetails/etfDetails.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("etfDetails/etfDetails.tpl.html",'<div class="svi-directive svi-details svi-etf-details" data-svi-widget data-title="labels.etfDetailsTitle"\n\t data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="row" data-ng-show="data">\n\t\t\t\t\t\t<div class="col-sm-6">\n\t\t\t\t\t\t\t<dl class="dl-vertical">\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.netAssetValue"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.nav | sviNumber:2:true:true"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.sharesOutstanding"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.sharesOutstanding | sviNumber:2:true:true"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="data.premiumOrDiscountPct >= 0 ? labels.premium : labels.discount"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.premiumOrDiscountPctAbsValue | percent : 2"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.totalNetAssets"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.totalNetAssets * 1000000 | sviNumber:2:true:true"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.volume"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.volume | sviNumber:2:true:true"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.dayVolume"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.avgVolume10D | sviNumber:2:true:true"></dd>\n\t\t\t\t\t\t\t</dl>\n\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t<div class="col-sm-6">\n\t\t\t\t\t\t\t<dl class="dl-vertical">\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.distributionYield"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.dividend.yield | percent : 2"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.distributions"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.dividend.amt | sviNumber:2:true:true"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.exDate"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.dividend.exDate | date"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.distributionDate"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.dividend.payDate | date"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.benchmark"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.benchmarkPeer"></dd>\n\n\t\t\t\t\t\t\t\t<dt class="data-label" data-ng-bind="labels.expenseRatio"></dt>\n\t\t\t\t\t\t\t\t<dd class="data-value" data-ng-bind="data.totalExpenseRatio | percent:3"></dd>\n\t\t\t\t\t\t\t</dl>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>\n')}]),angular.module("etfSymbolName/etfSymbolName.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("etfSymbolName/etfSymbolName.tpl.html",'<div class="svi-directive svi-symbol-name svi-fund-symbol-name" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div class="data-display" data-ng-show="data">\n\t\t<span class="symbol-id" data-ng-bind="symbol | uppercase"></span>\n\t\t<span class="symbol-name-divider">|</span>\n\t\t<span class="symbol-name" data-ng-bind="data.name ? data.name.replace(\';\', \' - \') : labels.fundSymbolNameNoData"></span>\n\t\t<div class="symbol-attributes">\n\t\t\t<span class="badge label-empty-background symbol-outline-badge" data-ng-bind="data.fundSector || labels.fundSymbolNameNoData"></span>\n\t\t\t<span class="badge label-empty-background symbol-outline-badge" data-ng-bind="data.legalStructure"></span>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("eventsTableContainer/eventsTableContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("eventsTableContainer/eventsTableContainer.tpl.html",'<div class="svi-directive svi-events-table-container" data-include-loader="false">\n\t<div data-svi-filter-date-range class="form-inline"\n\t\t data-event-id="EVENTS.DATE_RANGE"\n\t\t data-state-id="EVENTS.DATE_RANGE"\n\t\t data-label-class="*EMPTY*"\n\t\t data-from-label="{{ labels.from }}"\n\t\t data-to-label="{{ labels.to }}"\n\t\t data-from-date="{{ dateRange.start }}"\n\t\t data-to-date="{{ dateRange.end }}"></div>\n\t<div data-svi-filter-dropdown class="form-inline"\n\t\t data-ng-if="labels.dropDownLabel"\n\t\t data-event-id="EVENTS.QUICK_DATE_RANGE" data-state-id="EVENTS.QUICK_DATE_RANGE"\n\t\t data-title="{{ labels.dateRange }}"\n\t\t data-aria-label="{{ labels.dateRange }}"\n\t\t data-label-text="{{labels.dropDownLabel}}"\n\t\t data-options="{{dropdownOptions}}"\n\t\t data-comm="{title: labels.dateRange, ariaLabel: labels.dateRange, options: dropdownOptions}"></div>\n\t<div data-svi-tabs data-arrows-enabled="false" class="events-tables">\n\t\t<div class="item" data-tab-title="{{labels.earnings}}" data-tab-id="earnings">\n\t\t\t<div data-svi-earnings-events-table data-date-range="{{dateRange}}" data-event-id="EVENTS" data-page-event-id="EARNINGS_PAGING"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="{{labels.dividends}}" data-tab-id="dividends">\n\t\t\t<div data-svi-dividends-events-table data-date-range="{{dateRange}}" data-event-id="EVENTS" data-page-event-id="DIVIDENDS_PAGING"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="{{labels.ipo}}" data-tab-id="ipo">\n\t\t\t<div data-svi-ipo-events-table data-date-range="{{dateRange}}" data-event-id="EVENTS" data-page-event-id="IPOS_PAGING"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="{{labels.splits}}" data-tab-id="splits">\n\t\t\t<div data-svi-stock-splits-events-table data-date-range="{{dateRange}}" data-event-id="EVENTS" data-page-event-id="STOCKS_PAGING"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="{{labels.economic}}" data-tab-id="economic">\n\t\t\t<div data-svi-economic-events-table data-date-range="{{dateRange}}" data-event-id="EVENTS" data-page-event-id="ECONOMIC_PAGING"></div>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("fundAssetAllocation/fundAssetAllocation.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundAssetAllocation/fundAssetAllocation.tpl.html",'<div class="svi-widget svi-fund-asset-allocation" data-svi-widget data-title="labels.fundAssetAllocationTitle" id="{{::id}}" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="asOf-date" data-ng-if="chart">{{labels.asOf}} {{date|sviDate:"MM/dd/yyyy"}}</div>\n\t\t\t\t\t<div class="asset-allocation" data-ng-show="funds">\n\t\t\t\t\t\t<div class="asset-allocation-pie"></div>\n\t\t\t\t\t\t<table class="table table-striped" data-ng-if="chart">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th></th>\n\t\t\t\t\t\t\t\t\t<th data-ng-bind="labels.categoryNames"></th>\n\t\t\t\t\t\t\t\t\t<th class="number" data-ng-bind="labels.fund"></th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr data-ng-repeat="fund in funds">\n\t\t\t\t\t\t\t\t\t<td data-ng-style="{\'background\': fund.color}"></td>\n\t\t\t\t\t\t\t\t\t<td data-ng-bind="fund.name"></td>\n\t\t\t\t\t\t\t\t\t<td class="number" data-ng-bind="fund.y|percent:2"></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>\n')}]),angular.module("fundDetails/fundDetails.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundDetails/fundDetails.tpl.html",'<div class="svi-directive svi-details svi-fund-details" data-svi-widget data-title="labels.fundDetailsTitle"\n     data-include-loader="false">\n    <svi:widget-front>\n        <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item svi-top-fund-holdings-grid" data-ng-show="data">\n                    <div class="row">\n                        <div class="col-sm-6">\n                            <dl class="dl-vertical">\n                                <dt class="data-label" data-ng-bind="labels.socialResponsibility"></dt>\n                                <dd class="data-value socially-responsible"\n                                    data-ng-bind="data.tags.sociallyResponsible | sviBoolean"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.openToNewInvestors"></dt>\n                                <dd class="data-value" data-ng-bind="!data.closedToNewInv | sviBoolean"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.turnoverRate"></dt>\n                                <dd class="data-value" data-ng-bind="data.turnoverRatio | percent: 2"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.maxFrontEndSalesCharge"></dt>\n                                <dd class="data-value" data-ng-bind="data.maxFESalesCharge | percent: 2"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.benchmarkTitle"></dt>\n                                <dd class="data-value" data-ng-bind="data.benchmarkPeer"></dd>\n                            </dl>\n                        </div>\n\n                        <div class="col-sm-6">\n                            <dl class="dl-vertical">\n                                <dt class="data-label" data-ng-bind="labels.fundDetailsLoad"></dt>\n                                <dd class="data-value" data-ng-bind="data.load"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.totalNetAssets"></dt>\n                                <dd class="data-value" data-ng-bind="data.totalNetAssets | sviNumber : 2"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.shareClassNetAssets"></dt>\n                                <dd class="data-value" data-ng-bind="data.shareClassAssets | sviNumber : 2"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.fundDetailsExpenseRatio"></dt>\n                                <dd class="data-value">\n                                    {{data.grossExpenseRatio | percent: 2}} / {{data.netExpenseRatio | percent: 2}}\n                                </dd>\n                                <dt class="data-label" data-ng-bind="labels.minimumInitialInvestment"></dt>\n                                <dd class="data-value" data-ng-bind="data.minimumInitialInvestment | sviNumber : 2:true:false"></dd>\n                            </dl>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n')}]),angular.module("fundDistribution/fundDistribution.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundDistribution/fundDistribution.tpl.html",'<div class="svi-widget svi-fund-distribution" data-svi-widget data-title="labels.fundDistributionTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<table class="table table-striped" data-ng-if="dividends">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr><th class="distribution-types" colspan="3" data-ng-bind="labels.dividends"></th></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th data-ng-bind="labels.date"></th>\n\t\t\t\t\t\t\t<th class="number" data-ng-bind="labels.amount"></th>\n\t\t\t\t\t\t\t<th class="number" data-ng-bind="labels.price"></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr data-ng-repeat="dividend in dividends">\n\t\t\t\t\t\t\t<td data-ng-bind="dividend.date|sviDate: \'MM/dd/yyyy\'"></td>\n\t\t\t\t\t\t\t<td class="number" data-ng-bind="dividend.value|sviNumber:2:true:true"></td>\n\t\t\t\t\t\t\t<td class="number" data-ng-bind="dividend.distributionValue|sviNumber:2:true:true"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>\n')}]),angular.module("fundEsgTable/fundEsgTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundEsgTable/fundEsgTable.tpl.html",'<div class="svi-directive svi-fund-esg-table">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\n\t<div class="svi-fund-esg-grid" data-ng-show="esgData" data-ng-class="rc.getCollapsedCols()">\n\t\t<table class="table table-striped"\n\t\t\t   data-svi-responsive-columns="responsiveColumnsSettings"\n\t\t\t   data-ng-model="esgData"\n\t\t\t   data-float-thead="floatTheadOptions"\n\t\t>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-svi-column-header data-text="labels.scoringMeasures" data-col-name="scoringMeasures" data-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header class="number" data-ng-repeat="item in esgTableHeader" data-col-name="M{{$index+1}}" data-sortable="{{::sortable}}" data-text="item"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat-start="(key, esgItem) in esgData" data-ng-class="{\'header-esg-row\': esgItem.isHeader, \'nested-esg-row\': !esgItem.isHeader}" data-svi-rc-toggle-row="rc" data-toggle-row="{{key}}">\n\t\t\t\t<td data-col-name="scoringMeasures"  data-ng-bind="key"></td>\n\t\t\t\t<td class="number" data-col-name="M{{$index+1}}" data-ng-repeat="item in esgItem.data track by $index" data-ng-bind="item"></td>\n\t\t\t</tr>\n\t\t\t<tr data-ng-if="esgItem.isLast && !rc.rowExpanded(key)" class="empty-row"><td colspan="{{colspan}}"></td></tr>\n\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t<tr class="detail" data-ng-repeat-end data-ng-show="rc.rowExpanded(key)">\n\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(key)">\n\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<div class="row">\n\t\t\t<div class="col-md-12">\n\t\t\t\t<div class="disclaimer" data-ng-if="labels.lipperHelpText">\n\t\t\t\t\t{{labels.poweredBy}}\n\t\t\t\t\t<span data-svi-lipper-attribution data-custom-class="fund-esg-popover" data-lipper-help-text="{{labels.lipperHelpText}}"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("fundExpenseRatios/fundExpenseRatios.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundExpenseRatios/fundExpenseRatios.tpl.html",'<div class="svi-directive svi-fund-expense-ratios" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div data-ng-if="funds" data-ng-class="rc.getCollapsedCols()" class="svi-fund-expense-ratios-grid">\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="funds">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header data-col-name="name" data-sortable="{{::sortable}}" data-text="labels.name"></th>\n\t\t\t\t\t<th data-svi-column-header data-col-name="Y{{$index+1}}" data-sortable="{{::sortable}}" class="number" data-text="year" data-ng-repeat="year in header track by $index"></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat-start="(name, fund) in funds" data-svi-rc-toggle-row="rc" data-toggle-row="{{name}}">\n\t\t\t\t\t<td data-col-name="name" data-ng-bind="name" data-ng-class="{\'total-expense-ratio\': (fund.isLast || fund.isBold) }"></td>\n\t\t\t\t\t<td data-col-name="Y{{$index+1}}" class="number" data-ng-class="{\'total-expense-ratio\': (fund.isLast || fund.isBold)}" data-ng-repeat="item in fund.data track by $index" data-ng-bind="item"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr data-ng-if="fund.isLast && !rc.rowExpanded(name)" class="empty-row"> <td colspan="{{colspan}}"></td></tr>\n\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded(name)">\n\t\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(name)">\n\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>')}]),angular.module("fundExpenseRatioSummary/fundExpenseRatioSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundExpenseRatioSummary/fundExpenseRatioSummary.tpl.html",'<div class="svi-directive svi-details svi-fund-expense-ratio-summary" data-svi-widget data-title="labels.fundExpenseRatioSummaryTitle"\n\t data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item" data-ng-show="funds">\n\t\t\t\t\t<div data-ng-class="rc.getCollapsedCols()" class="svi-fund-expense-ratios-summary-grid">\n\t\t\t\t\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="fund">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th data-svi-column-header data-col-name="name" data-sortable="{{::sortable}}" data-text="labels.expenseRatio"></th>\n\t\t\t\t\t\t\t\t<th data-svi-column-header data-col-name="Y{{$index+1}}" data-sortable="{{::sortable}}" class="number" data-text="year" data-ng-repeat="year in header track by $index"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr data-ng-repeat-start="(name, fund) in funds" data-svi-rc-toggle-row="rc" data-toggle-row="{{name}}">\n\t\t\t\t\t\t\t\t<td data-col-name="name" data-ng-bind="name"></td>\n\t\t\t\t\t\t\t\t<td data-col-name="Y{{$index+1}}" class="number" data-ng-repeat="item in fund track by $index" data-ng-bind="item"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded(name)">\n\t\t\t\t\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(name)">\n\t\t\t\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t<div class="col-sm-12">\n\t\t\t\t\t\t\t\t<div class="disclaimer" data-ng-bind="labels.disclaimer"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>\n')}]),angular.module("fundGeographicExposure/fundGeographicExposure.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundGeographicExposure/fundGeographicExposure.tpl.html",'<div class="svi-directive svi-fund-geographic-exposure" data-svi-widget data-title="labels.fundGeographicExposureTitle" id="{{::id}}" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="item" data-tab-title="{{labels.countryView}}" data-ng-show="countries.length > 0">\n\t\t\t\t\t\t<div class="asOf-date" data-ng-if="countries.length > 0">{{labels.asOf}} {{asOf|sviDate:"MM/dd/yyyy"}}</div>\n\t\t\t\t\t\t<div class="country-view-map"></div>\n\t\t\t\t\t\t<table class="table table-striped" data-ng-show="countries && countries.length">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th data-ng-bind="labels.country"></th>\n\t\t\t\t\t\t\t\t\t<th class="number">\n\t\t\t\t\t\t\t\t\t\t<span data-ng-if="labels.percentHelpText" class="percent-tooltip"\n\t\t\t\t\t\t\t\t\t\t\tdata-trigger="click" data-auto-close="1" data-container=".svi-bs"\n\t\t\t\t\t\t\t\t\t\t\tdata-placement="bottom" data-bs-popover\n\t\t\t\t\t\t\t\t\t\t\tdata-content="{{labels.percentHelpText}}">\n\t\t\t\t\t\t\t\t\t\t\t{{labels.percent}}</span>\n\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr data-ng-repeat="country in countries | limitTo: countriesLimit">\n\t\t\t\t\t\t\t\t\t<td data-ng-bind="country.code"></td>\n\t\t\t\t\t\t\t\t\t<td class="number" data-ng-bind="country.z|percent:2"></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("fundGrowth/fundGrowth.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundGrowth/fundGrowth.tpl.html",'<div class="svi-directive svi-fund-growth" data-svi-widget data-title="labels.fundGrowthTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="fund-growth-chart"></div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("fundGrowth/fundGrowthChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundGrowth/fundGrowthChart.tpl.html",'<div class="svi-directive svi-fund-growth-chart">\n    <div class="chart-wrapper">\n        <div class="chart-inner">\n            <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n            <div class="fund-growth-chart"></div>\n        </div>\n    </div>\n</div>')}]),angular.module("fundHoldingsTable/fundHoldingsTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundHoldingsTable/fundHoldingsTable.tpl.html",'<div class="svi-directive svi-fund-holdings-table">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div class="svi-fund-holdings-grid" data-ng-show="fundHoldings && fundHoldings.length > 0" data-ng-class="rc.getCollapsedCols()">\n\t\t<table data-svi-responsive-columns="responsiveColumnsSettings"\n\t\t\t   class="table table-striped"\n\t\t>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-svi-column-header data-text="labels.holding" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="holding" data-sort-field="fundHoldings.desc"\n\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header  data-text="api.getTicker()" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="ticker" data-sort-field="fundHoldings.symbol"\n\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-text="labels.portfolioWeight" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" class="number" data-sort-field="fundHoldings.value"\n\t\t\t\t\tdata-col-name="portfolioWeight" data-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-text="labels.currency" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" class="number" data-col-name="currency" data-sort-field="fundHoldings.quote.currency"\n\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-text="labels.price" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" class="number" data-col-name="price" data-sort-field="fundHoldings.quote.lastPrice"\n\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-text="labels.dayChange" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" class="currency" data-col-name="dayChange" data-sort-field="fundHoldings.quote.change"\n\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-text="labels.dayChangePercent" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" class="number" data-sort-field="fundHoldings.quote.pctChange"\n\t\t\t\t\tdata-col-name="dayChangePercent" data-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-text="labels.dayHighLow" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" class="currency" data-col-name="dayHighLow" data-sort-field="fundHoldings.quote.extendedQuote.highPrice"\n\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-text="labels.volume" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" class="number" data-col-name="volume" data-sort-field="fundHoldings.quote.extendedQuote.volume"\n\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-text="labels.weekHighLow52" data-event-id="{{::api.eventName}}"  data-sorted-field="sortField"\n\t\t\t\t\tdata-sorted-dir="sortDir" class="currency" data-sort-field="fundHoldings.quote.extendedQuote.high52Price"\n\t\t\t\t\tdata-col-name="weekHighLow52" data-sortable="{{::sortable}}"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat-start="fundHolding in fundHoldings" data-svi-rc-toggle-row="rc"\n\t\t\t\tdata-toggle-row="{{$index}}">\n\t\t\t\t<td data-col-name="holding" data-ng-bind="fundHolding.desc"></td>\n\t\t\t\t<td data-col-name="ticker">\n\t\t\t\t\t<div data-svi-symbol data-ng-if="fundHolding.symbol" data-symbol-string="{{::fundHolding.symbol}}"></div>\n\t\t\t\t\t<div data-ng-if="!fundHolding.symbol">{{naValue}}</div>\n\t\t\t\t</td>\n\t\t\t\t<td data-col-name="portfolioWeight" class="number" data-ng-bind="fundHolding.value|percent:2:true"></td>\n\t\t\t\t<td data-col-name="currency" class="number" data-ng-bind="fundHolding.quote.currency"></td>\n\t\t\t\t<td data-col-name="price" class="number">\n\t\t\t\t\t{{fundHolding.quote.lastPrice | sviNumber:2:true:true}}\n\t\t\t\t</td>\n\t\t\t\t<td data-col-name="dayChange" class="currency"\n\t\t\t\t\tdata-ng-class="{positive: fundHolding.quote.change > 0, negative: fundHolding.quote.change < 0}">\n\t\t\t\t\t{{fundHolding.quote.change | sviNumber:2:true:true}}\n\t\t\t\t</td>\n\t\t\t\t<td data-col-name="dayChangePercent" class="number"\n\t\t\t\t\tdata-ng-class="{positive: fundHolding.quote.pctChange > 0, negative: fundHolding.quote.pctChange < 0}"\n\t\t\t\t\tdata-ng-bind="fundHolding.quote.pctChange|percent:2:true"></td>\n\t\t\t\t<td data-col-name="dayHighLow" class="currency">\n\t\t\t\t\t{{fundHolding.quote.extendedQuote.highPrice | sviNumber:2:true:true}} -\n\t\t\t\t\t{{fundHolding.quote.extendedQuote.lowPrice | sviNumber:2:true:true}}\n\t\t\t\t</td>\n\t\t\t\t<td data-col-name="volume" class="number"\n\t\t\t\t\tdata-ng-bind="fundHolding.quote.extendedQuote.volume|sviNumber:2:true:true"></td>\n\t\t\t\t<td data-col-name="weekHighLow52" class="currency">\n\t\t\t\t\t{{fundHolding.quote.extendedQuote.high52Price | sviNumber:2:true:true}} -\n\t\t\t\t\t{{fundHolding.quote.extendedQuote.low52Price | sviNumber:2:true:true}}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class="hide">\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t<td\n'+"\t\t\t\t\t\t\t\t\tclass=\"{{(detail.label.indexOf(labels.dayChange) > -1 && detail.value.replace('%', '') < 0) ? 'negative'\n\t\t\t\t\t\t\t: (detail.label.indexOf(labels.dayChange) > -1 && detail.value.replace('%', '') > 0) ? 'positive'\n\t\t\t\t\t\t\t: ''}}\"\n\t\t\t\t\t\t\t\t\tdata-ng-bind-html=\"::detail.value\"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t<span class=\"disclaimer\">\n\t\t\t<span>1 -</span><span data-ng-bind=\"labels.disclaimer\"></span>\n\t\t</span>\n\t</div>\n\n\n</div>")}]),angular.module("fundLoadAndMinimums/fundLoadAndMinimums.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundLoadAndMinimums/fundLoadAndMinimums.tpl.html",'<div class="svi-directive svi-fund-load-and-minimums" data-svi-widget data-title="labels.fundLoadAndMinimumsTitle" data-include-loader="false">\n    <svi:widget-front>\n        <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n        <div class="list-body">\n            <ul class="list-group" data-ng-if="minimums">\n                <li class="list-group-item">\n                    <div class="svi-fund-minimums">\n                        <div class="row">\n                            <div class="col-sm-6">\n                                <dl class="dl-vertical">\n                                    <dt class="data-label" data-ng-bind="labels.load"></dt>\n                                    <dd class="data-value">\n                                        <span class="caps-title" data-ng-bind="load" data-ng-if="load !== null"></span>\n                                    </dd>\n                                    <dt class="data-label" data-ng-bind="labels.minimumRegularInvestment"></dt>\n                                    <dd class="data-value" data-ng-bind="minimums.minimumRegularInvestment|sviCurrency:null:null:0"></dd>\n\n                                    <dt class="data-label" data-ng-bind="labels.minimumIRAInvestment"></dt>\n                                    <dd class="data-value" data-ng-bind="minimums.minimumIRAInvestment|sviCurrency:null:null:0"></dd>\n                                </dl>\n                            </div>\n                            <div class="col-sm-6">\n                                <dl class="dl-vertical">\n                                    <dt class="data-label" data-ng-bind="labels.minimumInitialInvestment"></dt>\n                                    <dd class="data-value" data-ng-bind="minimums.minimumInitialInvestment|sviCurrency:null:null:0"></dd>\n                                    <dt class="data-label" data-ng-bind="labels.minimumIrregularInvestment"></dt>\n                                    <dd class="data-value" data-ng-bind="minimums.minimumIrregularInvestment|sviCurrency:null:null:0"></dd>\n                                </dl>\n                            </div>\n                        </div>\n                    </div>\n                </li>\n                <li class="list-group-item">\n                    <div class="svi-fund-load-schedule" data-title="labels.loadScheduleTitle">\n                        <div class="row">\n                            <div class="category-name caps-item">\n                                <span class="caps-title" data-ng-if="load !== null">{{ load }} %</span>\n                                <span class="caps-value" data-ng-bind="maxLoad|percent:2" data-ng-if="maxLoad >= 0"></span>\n                            </div>\n                            <div class="category-name load-schedule" data-ng-if="load !== null">{{load}} {{labels.schedule}}</div>\n                            <div class="caps" data-ng-if="loads">\n                                <div class="caps-item" data-ng-repeat="load in loads track by $index">\n                                    <span class="caps-title" data-ng-if="load.to">{{load.from|sviCurrency}} - {{load.to|sviCurrency}}</span>\n                                    <span class="caps-title" data-ng-if="!load.to && loads.length > 1">{{labels.over}} {{load.from|sviCurrency}}</span>\n                                    <span class="caps-value" data-ng-if="loads.length > 1">{{load.value|percent:2}}</span>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("fundMonthlyPriceHistory/fundMonthlyPriceHistory.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundMonthlyPriceHistory/fundMonthlyPriceHistory.tpl.html",'<div class="svi-directive svi-fund-monthly-price-history" data-svi-widget\n\t data-title="labels.fundMonthlyPriceHistoryTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="svi-fund-monthly-price-history-grid" data-ng-show="fundMonthlyPriceHistory"\n\t\t\t\t\t\t data-ng-class="rc.getCollapsedCols()">\n\t\t\t\t\t\t<div class="actualValues" data-ng-if="fundMonthlyPriceHistory.length">\n\t\t\t\t\t\t\t{{labels.actualValues}} {{fundMonthlyPriceHistory[0].quoteTime |sviDate:\'MMM yyyy\'}} {{labels.to}} {{fundMonthlyPriceHistory[fundMonthlyPriceHistory.length-1].quoteTime |sviDate:\'MMM yyyy\'}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<table data-svi-responsive-columns="responsiveColumnsSettings"\n\t\t\t\t\t\t\t   class="table table-striped"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}"\n\t\t\t\t\t\t\t\t\tdata-sorted-field="sortField" data-text="labels.name"\n\t\t\t\t\t\t\t\t\tdata-hide-label="true"\n\t\t\t\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="name"\n\t\t\t\t\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t\t\t\t\t<th data-svi-column-header data-text="labels.open" data-event-id="{{::api.eventName}}"\n\t\t\t\t\t\t\t\t\tdata-sorted-field="sortField" class="currency"\n\t\t\t\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="open"\n\t\t\t\t\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t\t\t\t\t<th data-svi-column-header data-text="labels.close" data-event-id="{{::api.eventName}}"\n\t\t\t\t\t\t\t\t\tdata-sorted-field="sortField" class="currency"\n\t\t\t\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="close"\n\t\t\t\t\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t\t\t\t\t<th data-svi-column-header data-text="labels.low" data-event-id="{{::api.eventName}}"\n\t\t\t\t\t\t\t\t\tdata-sorted-field="sortField"\n\t\t\t\t\t\t\t\t\tdata-sorted-dir="sortDir" class="currency"\n\t\t\t\t\t\t\t\t\tdata-col-name="low" data-sortable="{{::sortable}}"></th>\n\t\t\t\t\t\t\t\t<th data-svi-column-header data-text="labels.high" data-event-id="{{::api.eventName}}"\n\t\t\t\t\t\t\t\t\tdata-sorted-field="sortField"\n\t\t\t\t\t\t\t\t\tdata-sorted-dir="sortDir" class="currency" data-col-name="high"\n\t\t\t\t\t\t\t\t\tdata-sortable="{{::sortable}}"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr data-ng-repeat-start="item in fundMonthlyPriceHistory" data-svi-rc-toggle-row="rc"\n\t\t\t\t\t\t\t\tdata-toggle-row="{{$index}}">\n\t\t\t\t\t\t\t\t<td data-col-name="name" data-ng-bind="item.quoteTime |sviDate:\'MMM\'"></td>\n\t\t\t\t\t\t\t\t<td data-col-name="open" class="currency" data-ng-bind="item.extendedQuote.openPrice|sviCurrency:null:\'\'"></td>\n\t\t\t\t\t\t\t\t<td data-col-name="close" class="currency" data-ng-bind="item.extendedQuote.prevClose|sviCurrency:null:\'\'"></td>\n\t\t\t\t\t\t\t\t<td data-col-name="low" class="currency" data-ng-bind="item.extendedQuote.lowPrice|sviCurrency:null:\'\'"></td>\n\t\t\t\t\t\t\t\t<td data-col-name="high" class="currency" data-ng-bind="item.extendedQuote.highPrice|sviCurrency:null:\'\'"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr class="hide">\n\t\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t\t\t\t<td data-ng-bind-html="::detail.value"></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("fundOverview/fundOverview.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundOverview/fundOverview.tpl.html",'<div class="svi-directive data-svi-fund-overview" data-svi-widget data-title="labels.fundOverviewTitle" data-include-loader="false">\n\n    <svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="row" ng-if="overview">\n\t\t\t\t\t<div class="col-md-6 fundOverview-wrapper">\n\t\t\t\t\t\t<div class="fundOverview-block">\n\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.fundOverviewStrategy"></h4>\n\t\t\t\t\t\t\t<div class="info-block" data-ng-class="{\'strategy-text-expanded\': expanded, \'strategy-text\': !expanded}">\n\t\t\t\t\t\t\t\t{{overview.objective ? overview.objective : labels.fundOverviewStrategyNotAvailable}}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-md-12 col-xs-12 more-less-banner-wrapper-responsive" ng-if="overview.objective && showMoreLess">\n\t\t\t\t\t\t<div class="more-less-banner">\n\t\t\t\t\t\t\t<button type="button" class="btn btn-lg btn-link"\n\t\t\t\t\t\t\t\t\taria-expanded="{{ expanded ? \'true\' : \'false\'}}" data-ng-click="api.toggle()">\n\t\t\t\t\t\t\t\t{{ expanded ? labels.less : labels.more }} <span class="glyphicon"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   data-ng-class="{\'glyphicon-chevron-up\': expanded, \'glyphicon-chevron-down\': !expanded}"></span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-md-6 fundOverview-wrapper">\n\t\t\t\t\t\t<div class="fundOverview-block">\n\t\t\t\t\t\t\t<span class="overflow-hidden" ng-if="overview.fundManagers && overview.fundManagers.length">\n\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.fundOverviewFundManager"></h4>\n\t\t\t\t\t\t\t\t<span class="fund-manager-name border-bottom">\n\t\t\t\t\t\t\t\t\t<span ng-repeat="fundManager in overview.fundManagers">\n\t\t\t\t\t\t\t\t\t\t{{fundManager.fullName ? fundManager.fullName : labels.fundOverviewFundManagerNameNotAvailable}}\n\t\t\t\t\t\t\t\t\t\t<span ng-if="fundManager.fullName && fundManager.date">\n\t\t\t\t\t\t\t\t\t\t\t({{fundManager.date | date:\'y\'}})\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t</span>\n                        \t\t</span>\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<span class="border-bottom overflow-hidden" ng-if="!overview.fundManagers || (overview.fundManagers && !overview.fundManagers.length)">\n\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.fundOverviewFundManager"></h4>\n\t\t\t\t\t\t\t\t<span class="fund-manager-name border-bottom" ng-bind="labels.fundOverviewFundManagerNameNotAvailable"></span>\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<div class="fundOverview-block">\n\t\t\t\t\t\t\t\t<span ng-if="overview.inceptionDate">\n\t\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.fundOverviewFundInception"></h4>\n\t\t\t\t\t\t\t\t\t\t<div class="info-block">\n\t\t\t\t\t\t\t\t\t\t<p class="border-bottom" id="inception-date">{{overview.inceptionDate | date:\'MMMM y\'}}</p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class="fundOverview-block">\n\t\t\t\t\t\t\t\t<h4 aria-level="3" class="title" ng-bind="labels.fundOverviewFundCompany"></h4>\n\t\t\t\t\t\t\t\t<div class="info-block" ng-if="overview.managementCompany">\n\t\t\t\t\t\t\t\t\t<p>{{overview.managementCompany.name}}</p>\n\t\t\t\t\t\t\t\t\t<p>{{overview.managementCompany.addressLine1}}</p>\n\t\t\t\t\t\t\t\t\t<p>{{overview.managementCompany.city}} {{overview.managementCompany.postalCode}}</p>\n\t\t\t\t\t\t\t\t\t<p class="border-bottom">{{overview.managementCompany.telephone}}</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<span class="info-block" ng-if="!overview.managementCompany">\n\t\t\t\t\t\t\t\t\t{{labels.fundOverviewFundManagementCompanyNotAvailable}}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-md-12 col-xs-12 more-less-banner-wrapper" ng-if="overview.objective && showMoreLess">\n\t\t\t\t\t\t<div class="more-less-banner">\n\t\t\t\t\t\t\t<button type="button" class="btn btn-lg btn-link" aria-expanded="{{ expanded ? \'true\' : \'false\'}}" data-ng-click="api.toggle()">\n\t\t\t\t\t\t\t\t{{ expanded ? labels.less : labels.more }} <span class="glyphicon" data-ng-class="{\'glyphicon-chevron-up\': expanded, \'glyphicon-chevron-down\': !expanded}"></span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\n    </svi:widget-front>\n</div>')}]),angular.module("fundPerformanceAAG/fundPerformanceAAG.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundPerformanceAAG/fundPerformanceAAG.tpl.html",'<div class="svi-directive svi-fund-performance-a-a-g" data-svi-widget data-title="labels.fundPerformanceTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="row" ng-if="performance">\n\t\t\t\t\t\t<div class="col-md-3 text-center">\n\t\t\t\t\t\t\t<div class="fundPerformanceAAG-block">\n\t\t\t\t\t\t\t\t<div class="inner-top" data-ng-bind="labels.summaryDataPointsYTD"></div>\n\t\t\t\t\t\t\t\t<span class="black-line"></span>\n\t\t\t\t\t\t\t\t<div class="inner-bottom" data-ng-bind="performance.cumulative.ytd|percent"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-md-3 text-center">\n\t\t\t\t\t\t\t<div class="fundPerformanceAAG-block">\n\t\t\t\t\t\t\t\t<div class="inner-top"  data-ng-bind="labels.summaryDataPoints1Y"></div>\n\t\t\t\t\t\t\t\t<span class="black-line"></span>\n\t\t\t\t\t\t\t\t<div class="inner-bottom"  data-ng-bind="performance.cumulative[\'1y\']|percent"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-md-3 text-center">\n\t\t\t\t\t\t\t<div class="fundPerformanceAAG-block">\n\t\t\t\t\t\t\t\t<div class="inner-top"  data-ng-bind="labels.summaryDataPoints3Y"></div>\n\t\t\t\t\t\t\t\t<span class="black-line"></span>\n\t\t\t\t\t\t\t\t<div class="inner-bottom"  data-ng-bind="performance.cumulative[\'3y\']|percent"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-md-3 text-center">\n\t\t\t\t\t\t\t<div class="fundPerformanceAAG-block">\n\t\t\t\t\t\t\t\t<div class="inner-top"  data-ng-bind="labels.summaryDataPoints5Y"></div>\n\t\t\t\t\t\t\t\t<span class="black-line"></span>\n\t\t\t\t\t\t\t\t<div class="inner-bottom"  data-ng-bind="performance.cumulative[\'5y\']|percent"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("fundRiskAnalysis/fundRiskAnalysis.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundRiskAnalysis/fundRiskAnalysis.tpl.html",'<div class="svi-directive svi-fund-risk-analysis" data-svi-widget data-title="labels.fundRiskAnalysisTitle">\n    <svi:widget-front>\n        <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n        <div class="list-body" data-ng-show="data">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <span data-ng-bind="labels.asOf + \' \'"></span>\n                    <span data-ng-bind="data.risk.asOf | sviDate:\'MM/dd/yyyy\'"></span>\n                    <span>{{\' | \'}}</span>\n                    <span data-ng-bind="labels.poweredByLipper"></span>\n                </li>\n                <li class="list-group-item">\n                    <div class="row">\n                        <div data-ng-repeat="risk in risks" class="col-xs-6 col-md-3">\n                            <div class="datapoint-box text-center">\n                                <div class="data-label" data-ng-bind="labels[risk]"></div>\n\t\t\t\t\t\t\t\t<div class="vertical-aligned-values">\n\t\t\t\t\t\t\t\t\t<span class="data-value ng-binding" data-ng-bind="data.risk[\'3y\'][risk] | sviNumber : 2"></span>\n\t\t\t\t\t\t\t\t</div>\n                            </div>\n                        </div>\n                    </div>\n                    <div class="footnote-asterisk" data-ng-bind="labels.asterisk"></div>\n                </li>\n\n                <li class="list-group-item">\n                    <table class="table table-striped" data-ng-model="data.table">\n                        <thead>\n                        <tr>\n                            <th data-svi-column-header data-sortable="false" data-text="labels.firstColumnAriaLabel" data-hide-label="true" data-col-name="name"></th>\n                            <th class="number" data-ng-repeat="year in years">\n                                <span data-ng-bind="labels[year]" class="risk-table-header"></span>\n                            </th>\n                        </tr>\n                        </thead>\n                        <tbody>\n                        <tr data-ng-repeat="row in config.rows" data-toggle-row="{{ $index }}" class="popover-bind-{{$index}}">\n                            <td>\n                                <a  class="risk-item-title"\n                                    data-trigger="click"\n                                    data-container=".svi-fund-risk-analysis .popover-bind-{{$index}}"\n                                    data-auto-close="1"\n                                    data-bs-popover\n                                    data-toggle="tooltip"\n                                    data-placement="right"\n                                    href=""\n                                    data-content="{{row.helpText}}">{{row.title}}</a>\n\n                            </td>\n                            <td class="number" data-ng-repeat="year in years">\n                                <span data-ng-bind="data.risk[year][row.name] | sviNumber : 2"\n                                     data-col-name="performance"></span>\n                            </td>\n                        </tr>\n                        </tbody>\n                    </table>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n')}]),angular.module("fundSectorAllocation/fundSectorAllocation.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundSectorAllocation/fundSectorAllocation.tpl.html",'<div class="svi-directive svi-fund-sector-allocation" data-svi-widget data-title="labels.fundSectorAllocationTitle" id="{{::id}}" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<table class="table" data-ng-if="sectors.length > 0">\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr data-ng-repeat="sector in sectors">\n\t\t\t\t\t\t\t\t<td class="progress-bar-col">\n\t\t\t\t\t\t\t\t\t<div class="progress">\n\t\t\t\t\t\t\t\t\t\t<div class="progress-bar"\n\t\t\t\t\t\t\t\t\t\t\t role="progressbar"\n\t\t\t\t\t\t\t\t\t\t\t aria-label="{{sector.name}}"\n\t\t\t\t\t\t\t\t\t\t\t data-ng-style="{\'width\': sector.barWidth}"\n\t\t\t\t\t\t\t\t\t\t\t data-ng-attr-style="{{ \'background: \' + sector.color + \' !important\' }}"\n\t\t\t\t\t\t\t\t\t\t\t aria-valuenow="{{sector.value}}"\n\t\t\t\t\t\t\t\t\t\t\t aria-valuemin="0"\n\t\t\t\t\t\t\t\t\t\t\t aria-valuemax="{{maxValue}}">\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td><span class="sector-allocation-value" data-ng-bind="sector.value|percent:1"></span></td>\n\t\t\t\t\t\t\t\t<td><span data-ng-bind="sector.name"></span></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("fundStyleMap/fundStyleMap.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundStyleMap/fundStyleMap.tpl.html",'<div class="svi-directive svi-fund-style-map" data-svi-widget data-title="labels.fundStyleMapTitle" data-include-loader="false" data-hidden="data.length === 0">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader" data-ignore-invisible="true"></div>\n\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t<div class="col-md-12 provided-by">{{labels.providedBy}}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="row" data-ng-show="data">\n\t\t\t\t\t\t<div class="col-md-7 col-sm-12">\n\t\t\t\t\t\t\t<div class="content-wrapper" data-ng-class="{\'content-wrapper-global\' : shortContentWrapper}">\n\t\t\t\t\t\t\t\t<div class="axis-wrapper">\n\t\t\t\t\t\t\t\t\t<div class="axis-top-title" data-ng-bind="labels.capitalization"></div>\n\t\t\t\t\t\t\t\t\t<div class="map-wrapper">\n\t\t\t\t\t\t\t\t\t\t<div class="square-container">\n\t\t\t\t\t\t\t\t\t\t\t<div class="square-row">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="square borderless" data-ng-repeat="header in headers">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="content" data-ng-bind="header"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class="square-row" data-ng-repeat="itemArray in data">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="square" data-ng-repeat="item in itemArray track by $index" data-ng-class="{\'active\': item === true, \'borderless\': $index == 0}" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div data-ng-if="$index == 0" class="content" data-ng-bind="item"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="axis-bottom-title" data-ng-bind="labels.style"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="value-text-bottom" data-ng-bind="titleText"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-md-5 col-sm-12">\n\t\t\t\t\t\t\t<div class="content-wrapper" data-ng-class="{\'content-wrapper-global\' : shortContentWrapper}">\n\t\t\t\t\t\t\t\t<div class="value-style-wrapper">\n\t\t\t\t\t\t\t\t\t<div class="value-circle">\n\t\t\t\t\t\t\t\t\t\t<div class="value-circle-text" data-ng-bind="bubbleText"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="value-text" data-ng-bind="helpText"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>\n')}]),angular.module("fundSymbolName/fundSymbolName.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("fundSymbolName/fundSymbolName.tpl.html",'<div class="svi-directive svi-symbol-name svi-fund-symbol-name" data-include-loader="false">\n    <div class="loader" data-svi-loader></div>\n    <div class="data-display" data-ng-if="data">\n        <span class="symbol-id" data-ng-bind="symbol | uppercase"></span>\n\t\t<span class="symbol-name-divider">|</span>\n        <span class="symbol-name" data-ng-bind="data.name"></span>\n        <div class="symbol-attributes">\n            <span class="badge label-empty-background symbol-outline-badge" data-ng-bind="data.fundSector"></span>\n            <span class="badge label-empty-background symbol-outline-badge" data-ng-if="data.showLoad" ng-bind="data.load"></span>\n        </div>\n    </div>\n</div>\n')}]),angular.module("globalIndicesGridContainer/globalIndicesGridContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("globalIndicesGridContainer/globalIndicesGridContainer.tpl.html",'<div class="svi-directive svi-global-indices-grid-container" data-include-loader="false">\n    <h2 class="title-text global-indices-title" data-ng-bind="labels.globalIndicesTitle"></h2>\n    <div data-svi-tabs data-arrows-enabled="false" class="global-indices-tabs">\n        <div class="item" data-tab-title="{{labels.mapView}}" data-tab-id="mapView">\n            <div data-svi-global-indices-map\n                 data-global-indices="{{globalIndices}}"\n                 data-symbol="symbol"></div>\n\n        </div>\n        <div class="item" data-tab-title="{{labels.tableView}}" data-tab-id="tableView">\n            <div svi-global-indices-table\n                 data-global-indices="{{globalIndices}}"\n                 data-symbol="symbol"></div>\n        </div>\n    </div>\n    <div class="global-indices-footer">\n        <span class="global-indices-annotation" data-ng-if="labels.annotationHelpText">\n\t\t\t\t\t\t\t\t\t<span data-ng-bind="labels.indicesDefinition"></span>\n\t\t\t\t\t\t\t\t\t<span data-svi-lipper-attribution\n                                          data-label="{{labels.globalIndicesTitle}}"\n                                          data-placement="top"\n                                          data-container=".global-indices-footer"\n                                          data-lipper-help-text="{{labels.annotationHelpText}}"></span>\n    </span>\n    </div>\n    <div data-svi-symbol-news\n         data-ng-if="shouldShowNews && !symbol"\n         data-template="TwoColumns"\n         data-show-source-filter="true"\n         data-news-types="[\'FrontPage\', \'USCompanies\']"\n         data-allow-overall="true"\n         data-limit="8"\n         data-limit-display="4"\n         data-use-modal="true"\n         class="pagebreak"\n    ></div>\n\t<div data-svi-symbol-news\n\t     data-ng-if="shouldShowNews && symbol"\n\t     data-template="TwoColumns"\n\t     data-news-types="[\'Headlines\', \'PressReleases\']"\n\t     data-limit="8"\n\t     data-limit-display="4"\n\t     data-show-source-filter="true"\n\t     data-use-modal="true"\n\t     class="pagebreak"\n\t     data-symbol="{{ symbol }}"></div>\n</div>')}]),angular.module("globalIndicesMap/globalIndicesMap.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("globalIndicesMap/globalIndicesMap.tpl.html",'<div class="svi-directive svi-global-indices-map" data-include-loader="false">\n    <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n    <div class="chart-wrapper">\n        <div class="chart-inner">\n            <a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n            <div class="indices-map"></div>\n            <div class="legend" data-ng-if="indices.length > 0">\n                {{labels.high}}\n                <div class="swatches large-gain"></div>\n                <div class="swatches small-gain"></div>\n                <div class="swatches small-loss"></div>\n                <div class="swatches large-loss"></div>\n                {{labels.low}}\n            </div>\n        </div>\n    </div>\n</div>')}]),angular.module("globalIndicesTable/globalIndicesTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("globalIndicesTable/globalIndicesTable.tpl.html",'<div class="svi-directive svi-global-indices-table" data-include-loader="false">\n    <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n    <div class="controls col-md-4">\n        <div data-svi-filter-dropdown\n             class="form-inline"\n             data-event-id="REGION"\n             data-state-id="REGION"\n             data-title="{{ labels.all }}"\n             data-dropdown-class="dropdown-menu-right"\n             data-aria-label="{{ labels.all }}"\n             data-options="{{ dropdownOptions }}"></div>\n    </div>\n    <div class="svi-global-indices-grid" data-ng-class="rc.getCollapsedCols()" data-ng-if="indices.length > 0">\n        <table data-svi-responsive-columns="responsiveColumnsSettings"\n               class="table table-striped"\n               data-ng-model="indices">\n            <thead>\n            <tr>\n                <th data-svi-column-header\n                    data-event-id="{{::api.eventName}}"\n                    data-sortable="{{::sortable}}"\n                    data-sorted-field="sortField"\n                    data-sorted-dir="sortDir"\n                    data-text="labels.country"\n                    data-col-name="country"></th>\n                <th data-svi-column-header\n                    data-event-id="{{::api.eventName}}"\n                    data-sortable="{{::sortable}}"\n                    data-sorted-field="sortField"\n                    data-sorted-dir="sortDir"\n                    data-text="labels.indexName"\n                    data-col-name="commonName"></th>\n                <th data-svi-column-header\n                    class="number"\n                    data-event-id="{{::api.eventName}}"\n                    data-sortable="{{::sortable}}"\n                    data-sorted-field="sortField"\n                    data-sorted-dir="sortDir"\n                    data-text="labels.lastPrice"\n                    data-col-name="lastPrice"></th>\n                <th data-svi-column-header\n                    class="number"\n                    data-event-id="{{::api.eventName}}"\n                    data-sortable="{{::sortable}}"\n                    data-sorted-field="sortField"\n                    data-sorted-dir="sortDir"\n                    data-text="labels.dayChange"\n                    data-col-name="dayChange"></th>\n                <th data-svi-column-header\n                    class="number"\n                    data-event-id="{{::api.eventName}}"\n                    data-sortable="{{::sortable}}"\n                    data-sorted-field="sortField"\n                    data-sorted-dir="sortDir"\n                    data-text="labels.dayChangePct"\n                    data-col-name="dayChangePct"></th>\n                <th data-svi-column-header\n                    class="number"\n                    data-event-id="{{::api.eventName}}"\n                    data-sortable="{{::sortable}}"\n                    data-sorted-field="sortField"\n                    data-sorted-dir="sortDir"\n                    data-text="labels.intradayRange"\n                    data-col-name="intradayRange"></th>\n            </tr>\n            </thead>\n            <tbody>\n            <tr data-ng-repeat-start="index in indices"\n                data-toggle-row="{{::$index}}"\n                data-svi-rc-toggle-row="rc">\n                <td data-col-name="country" data-ng-bind="index.countryLabel"></td>\n                <td data-col-name="commonName" data-ng-bind="index.instrument.shortName"></td>\n                <td class="number" data-col-name="lastPrice" data-ng-bind="index.quote.lastPrice|sviNumber:2:true:true"></td>\n                <td class="number"\n                    data-col-name="dayChange"\n                    data-ng-class="{positive: index.quote.change > 0, negative: index.quote.change < 0}"\n                    data-ng-bind="index.quote.change|sviNumber:2:true:true"></td>\n                <td class="number"\n                    data-col-name="dayChangePct"\n                    data-ng-class="{positive: index.quote.pctChange > 0, negative: index.quote.pctChange < 0}"\n                    data-ng-bind="index.quote.pctChange|sviNumber:2:true:true"></td>\n                <td class="number" data-col-name="intradayRange">\n                    <span data-ng-bind="index.quote.extendedQuote.highPrice|sviNumber:2:true:false"></span>\n                    -\n                    <span data-ng-bind="index.quote.extendedQuote.lowPrice|sviNumber:2:true:false"></span>\n                </td>\n            </tr>\n            <tr class="hide"><td>&nbsp;</td></tr>\n            <tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n                <td colspan="5">\n                    <table class="table svi-detail-table">\n                        <tr data-ng-repeat="detail in rc.getRowDetails($index)">\n                            <th data-ng-bind="::detail.label"></th>\n                            <td data-ng-bind-html="::detail.value"></td>\n                        </tr>\n                    </table>\n                </td>\n            </tr>\n            </tbody>\n        </table>\n    </div>\n</div>')}]),angular.module("indexTile/indexTile.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("indexTile/indexTile.tpl.html",'<div class="svi-directive svi-index-tile">\n\t<div class="tile-body">\n\t\t<div class="loader" data-svi-loader data-callback="api.setLoader" data-ignore-invisible="true"></div>\n\t\t<div class="index-tile-header">\n\t\t\t<div class="symbol-wrapper">\n\t\t\t\t<p data-ng-bind="title"></p>\n\t\t\t</div>\n\t\t\t<div class="index-tile-sparkline-chart">\n\t\t\t\t<div data-svi-sparkline-chart\n\t\t\t\t     data-symbol="{{comm.symbol}}"\n\t\t\t\t     data-symbol-format="{{comm.symbolFormat}}"></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="separator"></div>\n\t\t<div class="text-style text-center">\n\t\t\t<p data-ng-bind="index.lastPrice" class="title"></p>\n\t\t</div>\n\t\t<div class="text-center">\n\t\t\t<span class="number" data-ng-bind="index.change" data-ng-class="index.color"></span>\n\t\t\t<span class="number parenChangePercent" data-ng-bind-html="index.percentChange | percentChange"></span>\n\t\t</div>\n\t\t<div class="text-center timespan">\n\t\t\t{{labels.asOf}} {{index.timespan | sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t</div>\n\t</div>\n\n\t<div data-ng-show="futureSymbol && preMarketHours">\n\t\t<div class="text-center future-symbol">\n\t\t\t<span class="text-style" data-ng-bind="futures.futureSymbol"></span>\n\t\t\t<span class="text-style" data-ng-bind="labels.futuresLabel"></span>\n\t\t\t<span class="text-style">:</span>\n\t\t\t<span class="currency" data-ng-bind="futures.change" data-ng-class="futures.color"></span>\n\t\t\t<span class="number parenChangePercent" data-ng-bind-html="futures.percentChange | percentChange"></span>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("ipoEventsTable/ipoEventsTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("ipoEventsTable/ipoEventsTable.tpl.html",'<div class="svi-directive svi-ipo-events-table" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div class="row paging-top" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n\t\t<div data-svi-paging-control\n\t\t     class="col-md-12"\n\t\t     data-event-id="{{::pageEventId}}"\n\t\t     data-current-page="currentPage"\n\t\t     data-total-pages="totalPages"></div>\n\t</div>\n\t<div class="svi-ipos-events-grid" data-ng-if="companies.length > 0" data-ng-class="rc.getCollapsedCols()">\n\t\t<table data-svi-responsive-columns="responsiveColumnsSettings"\n\t\t       class="table table-striped"\n\t\t       data-ng-model="companies"\n\t\t       data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-svi-column-header\n\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t    data-sortable="{{::sortable}}"\n\t\t\t\t    data-sort-field="date"\n\t\t\t\t    data-text="labels.date"\n\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t    data-col-name="date"></th>\n\t\t\t\t<th data-svi-column-header\n\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t    data-sortable="{{::sortable}}"\n\t\t\t\t    data-sort-field="company"\n\t\t\t\t    data-text="labels.company"\n\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t    data-col-name="company"></th>\n\t\t\t\t<th data-svi-column-header\n\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t    data-sortable="{{::sortable}}"\n\t\t\t\t    data-sort-field="symbol"\n\t\t\t\t    data-text="labels.symbol"\n\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t    data-col-name="symbol"></th>\n\t\t\t\t<th data-svi-column-header\n\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t    data-sortable="false"\n\t\t\t\t    data-sort-field="exchange"\n\t\t\t\t    data-text="labels.exchange"\n\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t    data-col-name="exchange"></th>\n\t\t\t\t<th data-svi-column-header\n\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t    data-sortable="false"\n\t\t\t\t    data-sort-field="lockupExpiryDate"\n\t\t\t\t    data-text="labels.lockupExpirationDate"\n\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t    data-col-name="lockupExpiryDate"></th>\n\t\t\t\t<th data-svi-column-header\n\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t    data-sortable="false"\n\t\t\t\t    data-sort-field="shares"\n\t\t\t\t    class="number"\n\t\t\t\t    data-text="labels.shares"\n\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t    data-col-name="shares"></th>\n\t\t\t\t<th data-svi-column-header\n\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t    data-sortable="false"\n\t\t\t\t    data-sort-field="finalPrice"\n\t\t\t\t    class="number"\n\t\t\t\t    data-text="labels.ipoPrice"\n\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t    data-col-name="finalPrice"></th>\n\t\t\t\t<th data-svi-column-header\n\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t    data-sortable="false"\n\t\t\t\t    data-sort-field="filingPriceLow"\n\t\t\t\t    class="number"\n\t\t\t\t    data-text="labels.expectedRange"\n\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t    data-col-name="filingPriceLow"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat-start="item in companies" data-toggle-row="{{ ::$index }}" data-svi-rc-toggle-row="rc">\n\t\t\t\t<td data-col-name="date" data-ng-bind="item.date|sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t<td data-col-name="company" data-ng-bind="item.company"></td>\n\t\t\t\t<td data-col-name="symbol" data-svi-symbol data-symbol-string="{{::item.symbol}}"></td>\n\t\t\t\t<td data-col-name="exchange" data-ng-bind="item.exchange"></td>\n\t\t\t\t<td data-col-name="lockupExpiryDate" data-ng-bind="item.lockupExpiryDate|sviDate: \'MM/dd/yyyy\'"></td>\n\t\t\t\t<td data-col-name="shares" class="number" data-ng-bind="item.shares|sviNumber:2:true:true"></td>\n\t\t\t\t<td data-col-name="finalPrice" class="number" data-ng-bind="item.finalPrice|sviCurrency"></td>\n\t\t\t\t<td data-col-name="filingPriceLow" class="number">\n\t\t\t\t\t<span data-ng-bind="item.filingPriceLow|sviCurrency"></span>\n\t\t\t\t\t-\n\t\t\t\t\t<span data-ng-bind="item.filingPriceHigh|sviCurrency"></span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class="hide">\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t<td colspan="5">\n\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t<td ng-bind-html="::detail.value"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\t<div class="row paging-bottom" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n\t\t<div data-svi-paging-control\n\t\t     class="col-md-12"\n\t\t     data-event-id="{{::pageEventId}}"\n\t\t     data-current-page="currentPage"\n\t\t     data-total-pages="totalPages"></div>\n\t</div>\n</div>\n')}]),angular.module("lipperFundESGSummary/lipperFundESGSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("lipperFundESGSummary/lipperFundESGSummary.tpl.html",'<div class="svi-directive svi-lipper-fund-e-s-g-summary" data-svi-widget data-title="labels.lipperFundESGSummaryTitle" id="{{::id}}" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="data-date" data-ng-if="data">{{labels.asOf}} {{data.date|sviDate:"MM/dd/yyyy"}} |\n\t\t\t\t\t\t{{labels.poweredBy}}\n\t\t\t\t\t\t<span \tdata-ng-if="labels.lipperHelpText"\n\t\t\t\t\t\t\t\tclass="fund-esg-summary-popover-link"\n\t\t\t\t\t\t\t\tdata-svi-lipper-attribution\n\t\t\t\t\t\t\t\tdata-label="Refinitiv Lipper"\n\t\t\t\t\t\t\t\tdata-container=".svi-lipper-fund-e-s-g-summary .data-date"\n\t\t\t\t\t\t\t\tdata-custom-class="fund-esg-summary-popover"\n\t\t\t\t\t\t\t\tdata-lipper-help-text="{{labels.lipperHelpText}}"></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="row" data-ng-if="data">\n\t\t\t\t\t\t<div class="col-md-12" data-ng-if="data">\n\t\t\t\t\t\t\t<div class="scores-title" data-ng-if="labels.scoreBreakdowns">{{labels.scoreBreakdowns}}:</div>\n\t\t\t\t\t\t\t<div class="row esg-scores-wrapper">\n\t\t\t\t\t\t\t\t<div class="score col-md-6 col-lg-3 col-sm-6 col-xs-6">\n\t\t\t\t\t\t\t\t\t<div class="title-wrapper popover-bind-esgScore">\n\t\t\t\t\t\t\t\t\t\t<a href="" data-ng-if="labels.esgScoreHelpText" class="title esg-score-title"\n\t\t\t\t\t\t\t\t\t\t   data-trigger="click" data-auto-close="1"\n\t\t\t\t\t\t\t\t\t\t   data-container=".svi-lipper-fund-e-s-g-summary .popover-bind-esgScore"\n\t\t\t\t\t\t\t\t\t\t   data-placement="bottom" data-bs-popover\n\t\t\t\t\t\t\t\t\t\t   data-content="{{labels.esgScoreHelpText}}">\n\t\t\t\t\t\t\t\t\t\t\t{{labels.esgScore}}</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div data-svi-gauge-chart data-value="{{data.esg|sviNumber:2:true}}"\n\t\t\t\t\t\t\t\t\t\t class="esg-score-chart gauge-chart" data-max-value="{{maxValue}}"\n\t\t\t\t\t\t\t\t\t\t data-chart-color="{{chartColors[\'esgScore\']}}"\n\t\t\t\t\t\t\t\t\t\t data-description="Gauge chart displays ESG Score"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="score col-md-6 col-lg-3 col-sm-6 col-xs-6">\n\t\t\t\t\t\t\t\t\t<div class="title-wrapper popover-bind-{{labels.environmental}}">\n\t\t\t\t\t\t\t\t\t\t<div class="responsive-title">{{labels.scoreBreakdowns}}:</div>\n\t\t\t\t\t\t\t\t\t\t<a href="" data-ng-if="labels.enviromentalHelpText"\n\t\t\t\t\t\t\t\t\t\t   class="title esg-score-title"\n\t\t\t\t\t\t\t\t\t\t   data-trigger="click" data-auto-close="1"\n\t\t\t\t\t\t\t\t\t\t   data-container=".svi-lipper-fund-e-s-g-summary .popover-bind-{{labels.environmental}}"\n\t\t\t\t\t\t\t\t\t\t   data-placement="bottom" data-bs-popover\n\t\t\t\t\t\t\t\t\t\t   data-content="{{labels.enviromentalHelpText}}">\n\t\t\t\t\t\t\t\t\t\t\t{{labels.environmental}}</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div data-svi-gauge-chart data-value="{{ data.environmental|sviNumber:2:true }}"\n\t\t\t\t\t\t\t\t\t\t class="gauge-chart" data-max-value="{{ maxValue }}"\n\t\t\t\t\t\t\t\t\t\t data-chart-color="{{ chartColors[\'environmental\'] }}"\n\t\t\t\t\t\t\t\t\t\t data-description="Gauge chart displays Enviromental Score"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="score col-md-6 col-lg-3 col-sm-6 col-xs-6">\n\t\t\t\t\t\t\t\t\t<div class="title-wrapper popover-bind-{{labels.social}}">\n\t\t\t\t\t\t\t\t\t\t<a href="" data-ng-if="labels.socialHelpText" class="title esg-score-title"\n\t\t\t\t\t\t\t\t\t\t   data-trigger="click" data-auto-close="1"\n\t\t\t\t\t\t\t\t\t\t   data-container=".svi-lipper-fund-e-s-g-summary .popover-bind-{{labels.social}}"\n\t\t\t\t\t\t\t\t\t\t   data-placement="bottom" data-bs-popover\n\t\t\t\t\t\t\t\t\t\t   data-content="{{labels.socialHelpText}}">\n\t\t\t\t\t\t\t\t\t\t\t{{labels.social}}</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div data-svi-gauge-chart data-value="{{ data.social|sviNumber:2:true }}"\n\t\t\t\t\t\t\t\t\t\t class="gauge-chart" data-max-value="{{ maxValue }}"\n\t\t\t\t\t\t\t\t\t\t data-chart-color="{{ chartColors[\'social\'] }}"\n\t\t\t\t\t\t\t\t\t\t data-description="Gauge chart displays Social Score"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="score col-md-6 col-lg-3 col-sm-6 col-xs-6">\n\t\t\t\t\t\t\t\t\t<div class="title-wrapper popover-bind-{{labels.governance}}">\n\t\t\t\t\t\t\t\t\t\t<a href="" data-ng-if="labels.governanceHelpText" class="title esg-score-title"\n\t\t\t\t\t\t\t\t\t\t   data-trigger="click" data-auto-close="1"\n\t\t\t\t\t\t\t\t\t\t   data-container=".svi-lipper-fund-e-s-g-summary .popover-bind-{{labels.governance}}"\n\t\t\t\t\t\t\t\t\t\t   data-placement="bottom" data-bs-popover\n\t\t\t\t\t\t\t\t\t\t   data-content="{{labels.governanceHelpText}}">\n\t\t\t\t\t\t\t\t\t\t\t{{labels.governance}}</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div data-svi-gauge-chart data-value="{{ data.governance|sviNumber:2:true }}"\n\t\t\t\t\t\t\t\t\t\t class="gauge-chart" data-max-value="{{ maxValue }}"\n\t\t\t\t\t\t\t\t\t\t data-chart-color="{{ chartColors[\'governance\'] }}"\n\t\t\t\t\t\t\t\t\t\t data-description="Gauge chart displays Governance Score"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="esg-ratings">\n\t\t\t\t\t\t\t\t<span class="esg-ratings-label" data-ng-bind="labels.esgRatings"></span>\n\t\t\t\t\t\t\t\t<div class="img-role-wrapper" role="img" aria-label=\'{{greenLeafs.length + " " + labels.outOf + " " + maxRating + " " + labels.leafs}}\'>\n\t\t\t\t\t\t\t\t\t<span data-ng-repeat="item in greenLeafs track by $index">\n\t\t\t\t\t\t\t\t\t\t<span class="fas fa-leaf green-leafs"></span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span data-ng-repeat="item in greyLeafs track by $index">\n\t\t\t\t\t\t\t\t\t\t<span class="fas fa-leaf grey-leafs"></span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("lipperFundPerformanceAnalysis/lipperFundPerformanceAnalysis.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("lipperFundPerformanceAnalysis/lipperFundPerformanceAnalysis.tpl.html",'<div class="svi-directive data-svi-lipper-fund-performance-analysis" data-svi-widget data-title="labels.lipperFundPerformanceAnalysisTitle" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n                    <div class="lipperFundPerformanceAnalysis-wrapper row" data-ng-show="benchmarks.length">\n\t                    <div class="col-md-12">\n\t\t                    <div class="as-of" data-ng-if="asOfDate">\n\t\t\t                    {{labels.asOf}} {{asOfDate | sviDate:"MM/dd/yyyy"}}\n\t\t                    </div>\n\t\t                    <div class="annotation">\n                                <span class="powered-by-lipper" data-ng-if="labels.poweredByLipper">\n\t\t\t\t\t\t\t\t\t<span data-ng-bind="labels.poweredByLipper"></span>\n\t\t\t\t\t\t\t\t\t<span data-svi-lipper-attribution\n\t\t\t\t\t\t\t\t\t      data-custom-class="lipper-leaders-performance-popover"\n\t\t\t\t\t\t\t\t\t      data-placement="bottom"\n\t\t\t\t\t\t\t\t\t      data-lipper-help-text="{{labels.disclosureText}}"></span>\n\t\t\t\t\t\t\t\t</span>\n\t\t                    </div>\n\t                    </div>\n                        <div data-svi-tabs data-arrows-enabled="false">\n                            <div class="item" data-tab-title="{{labels.annualizedTitle}}">\n                                <div class="col-md-12">\n                                    <div class="svi-lipper-fund-performance-analysis-chart-annualized"></div>\n                                </div>\n                                <div class="col-md-12 col-lg-12">\n                                    <table data-svi-responsive-columns="responsiveColumnsSettingsAnnual"\n                                           class="table table-striped lipper-fund-performance-analysis-annual-grid"\n                                           data-ng-model="benchmarks">\n                                        <thead>\n                                        <tr>\n                                            <th data-svi-column-header data-sortable="false" data-text="labels.benchmarks" data-hide-label="true" data-col-name="benchmarks"></th>\n                                            <th ng-repeat="(key, annual) in annualTitles"\n                                                data-svi-column-header data-sortable="false"\n                                                data-text="annual" class="number" data-col-name="{{key}}"></th>\n                                        </tr>\n                                        </thead>\n                                        <tbody>\n                                        <tr ng-repeat="itemData in annualData" data-toggle-row="{{ ::$index }}"\n                                            data-svi-rc-toggle-row="rc">\n                                            <td data-ng-style="{ \'box-shadow\': \'6px 0 0 -1px \' + colors[$index] + \' inset\' }" data-ng-bind-html="::itemData.name"\n                                                data-col-name="name"></td>\n                                            <td ng-repeat="(key, annual) in itemData.data"\n                                                data-ng-bind-html="annual ? (annual|percent) : \'-\'"\n                                                class="number"></td>\n                                        </tr>\n                                        </tbody>\n                                    </table>\n                                </div>\n\t                            <div class="col-md-12 lipper-footer">\n\t\t                            <span class="powered-by-lipper" data-ng-if="labels.calendarReturns">\n\t\t\t                            <span data-ng-bind="labels.fundPerformanceDefinitions"></span>:\n\t\t                                <span data-svi-lipper-attribution data-label="{{labels.calendarReturnsLabel}}"\n\t\t                                      data-custom-class="lipper-leaders-performance-popover"\n\t\t                                      data-placement="bottom"\n\t\t                                      data-lipper-help-text="{{labels.calendarReturns}}"></span>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t                            </div>\n                            </div>\n                            <div class="item" data-tab-title="{{labels.cumulativeTitle}}">\n                                <div class="col-md-12">\n                                    <div class="svi-lipper-fund-performance-analysis-chart-cumulative"></div>\n                                </div>\n\t                            <div class="col-md-12 col-lg-12">\n\t\t                            <table data-svi-responsive-columns="responsiveColumnsSettings"\n\t\t                                   class="table table-striped lipper-fund-performance-analysis-grid"\n\t\t                                   data-ng-model="benchmarks">\n\t\t\t                            <thead>\n\t\t\t                            <tr>\n\t\t\t\t                            <th data-svi-column-header data-sortable="{{false}}" data-text=""></th>\n\t\t\t\t                            <th data-svi-column-header data-text="labels.cumulativeTableTitle1M"\n\t\t\t\t                                data-sortable="{{false}}" class="number" data-col-name="1M"></th>\n\t\t\t\t                            <th data-svi-column-header data-text="labels.cumulativeTableTitle3M"\n\t\t\t\t                                data-sortable="{{false}}" class="number" data-col-name="3M"></th>\n\t\t\t\t                            <th data-svi-column-header data-text="labels.cumulativeTableTitle6M"\n\t\t\t\t                                data-sortable="{{false}}" class="number" data-col-name="6M"></th>\n\t\t\t\t                            <th data-svi-column-header data-text="labels.cumulativeTableTitleYTD"\n\t\t\t\t                                data-sortable="{{false}}" class="number" data-col-name="YTD"></th>\n\t\t\t\t                            <th data-svi-column-header data-text="labels.cumulativeTableTitle1Y"\n\t\t\t\t                                data-sortable="{{false}}" class="number" data-col-name="1Y"></th>\n\t\t\t                            </tr>\n\t\t\t                            </thead>\n\t\t\t                            <tbody>\n\t\t\t                            <tr ng-repeat="benchmark in benchmarks" data-toggle-row="{{ ::$index }}"\n\t\t\t                                data-svi-rc-toggle-row="rc">\n\t\t\t\t                            <td data-ng-style="{ \'box-shadow\': \'6px 0 0 -1px \' + colors[$index] + \' inset\' }"\n\t\t\t\t                                data-ng-bind-html="::benchmark.name"\n\t\t\t\t                                data-col-name="name"></td>\n\t\t\t\t                            <td data-ng-bind-html="::benchmark.cumulative[\'1m\'].value | percent"\n\t\t\t\t                                class="number" data-col-name="1M"></td>\n\t\t\t\t                            <td data-ng-bind-html="::benchmark.cumulative[\'3m\'].value | percent"\n\t\t\t\t                                class="number" data-col-name="3M"></td>\n\t\t\t\t                            <td data-ng-bind-html="::benchmark.cumulative[\'6m\'].value | percent"\n\t\t\t\t                                class="number" data-col-name="6M"></td>\n\t\t\t\t                            <td data-ng-bind-html="::benchmark.cumulative[\'ytd\'].value | percent"\n\t\t\t\t                                class="number" data-col-name="YTD"></td>\n\t\t\t\t                            <td data-ng-bind-html="::benchmark.cumulative[\'1y\'].value | percent"\n\t\t\t\t                                class="number" data-col-name="1Y"></td>\n\t\t\t                            </tr>\n\t\t\t                            </tbody>\n\t\t                            </table>\n\t                            </div>\n\t                            <div class="col-md-12 lipper-footer">\n\t\t                            <span class="powered-by-lipper" data-ng-if="labels.cumulativeReturns">\n\t\t\t                            <span data-ng-bind="labels.fundPerformanceDefinitions"></span>:\n\t\t                                <span data-svi-lipper-attribution\n\t\t                                      data-label="{{labels.cumulativeReturnsLabel}}"\n\t\t                                      data-custom-class="lipper-leaders-performance-popover"\n\t\t                                      data-placement="bottom"\n\t\t                                      data-lipper-help-text="{{labels.cumulativeReturns}}"></span>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t                            </div>\n                            </div>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("lipperLeadersPerformance/lipperLeadersPerformance.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("lipperLeadersPerformance/lipperLeadersPerformance.tpl.html",'<div class="svi-directive svi-lipper-leaders-performance" data-svi-widget data-title="labels.fundPerformanceTitle" data-include-loader="false" data-ng-keyup="api.onKeyUp($event)" data-ng-keydown="api.onKeyDown($event)">\n\t<svi:widget-front>\n\t\t<div class="list-body list-body-{{popoverId}}">\n\t\t\t<a href="" class="sr-only" data-ng-focus="api.cleanTabMap($event)"></a>\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader"\n\t\t\t\t\t     data-svi-loader\n\t\t\t\t\t     data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="row" ng-show="performance">\n\t\t\t\t\t\t<div class="col-md-12 lipperLeadersPerformance-block">\n\t\t\t\t\t\t\t<div data-svi-tabs\n\t\t\t\t\t\t\t     data-arrows-enabled="false"\n\t\t\t\t\t\t\t     data-auto-height="true"\n\t\t\t\t\t\t\t     data-min-height="150">\n\t\t\t\t\t\t\t\t<div class="item"\n\t\t\t\t\t\t\t\t     data-tab-title="{{timespan.toUpperCase()}}"\n\t\t\t\t\t\t\t\t     data-ng-repeat="timespan in timespans">\n\t\t\t\t\t\t\t\t\t<div class="row item-inner-block">\n\t\t\t\t\t\t\t\t\t\t<div class="performance-value-wrapper" data-ng-class="performanceValueClass">\n\t\t\t\t\t\t\t\t\t\t\t<div class="table-item-wrapper">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="performance-label" data-ng-bind="labels.performance"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div>\n                                                    <span class="performance-value"\n                                                          data-ng-class="{positive: performance.cumulative[timespan].value > 0, negative: performance.cumulative[timespan].value < 0}">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{performance.cumulative[timespan].value | percent}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="performance-rank">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="ranks[timespan].rank"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tout of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="ranks[timespan].count"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunds\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="lipper-classification-container">\n                                                    <span class="lipper-classification-label"\n                                                          data-ng-bind="labels.lipperClassification"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="fundSector"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class="rating-block"\n\t\t\t\t\t\t\t\t\t\t     data-ng-if="rating.value"\n\t\t\t\t\t\t\t\t\t\t     data-ng-class="ratingClass"\n\t\t\t\t\t\t\t\t\t\t     data-ng-repeat="rating in ratings[timespan]">\n\t\t\t\t\t\t\t\t\t\t\t<div class="table-item-wrapper">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="lipper-badge"\n\t\t\t\t\t\t\t\t\t\t\t\t     data-ng-bind="labels.leaderBadgeText"\n\t\t\t\t\t\t\t\t\t\t\t\t     data-ng-if="rating.value === 5"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="lipperRating"\n\t\t\t\t\t\t\t\t\t\t\t\t\t     data-ng-class="{\'lipperLeader\': rating.value === 5}">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="rating.value"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="rating-block-{{timespan}}-{{rating.id}} {{rating.id}}">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href="" class="lipper-rating-item-title"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-ng-focus="api.onTabFocus($event)"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-trigger="click"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-auto-close="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-container=".svi-lipper-leaders-performance .list-body-{{popoverId}}"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-placement="bottom"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-bs-on-show="onPopoverShow"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-bs-on-before-hide="onPopoverHide"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-bs-popover\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t data-content="{{rating.helperText}}">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{rating.title}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="lipper-ratings-footer">\n\t\t\t\t\t\t\t\t<span class="high-low">\n\t\t\t\t\t\t\t\t\t{{labels.lipperRatingsAAGHigh}}-5-4-3-2-1-{{labels.lipperRatingsAAGLow}}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class="vertical-divider">|</span>\n\t\t\t\t\t\t\t\t<span data-svi-lipper-attribution\n\t\t\t\t\t\t\t\t      data-label="{{labels.rankingMethodologyText}}"\n\t\t\t\t\t\t\t\t      data-custom-class="lipper-leaders-performance-popover"\n\t\t\t\t\t\t\t\t      data-placement="top"\n\t\t\t\t\t\t\t\t\t  data-container=".svi-lipper-leaders-performance .list-body-{{popoverId}}"\n\t\t\t\t\t\t\t\t      data-lipper-help-text="{{labels.rankingMethodologyTextHelpText}}"></span>\n\t\t\t\t\t\t\t\t<span class="vertical-divider">|</span>\n\t\t\t\t\t\t\t\t<span class="powered-by-lipper" data-ng-if="labels.lipperHelpText">\n\t\t\t\t\t\t\t\t\t<span data-ng-bind="labels.poweredBy"></span>\n\t\t\t\t\t\t\t\t\t<span data-svi-lipper-attribution\n\t\t\t\t\t\t\t\t\t      data-custom-class="lipper-leaders-performance-popover"\n\t\t\t\t\t\t\t\t\t      data-placement="top"\n\t\t\t\t\t\t\t\t\t\t  data-container=".svi-lipper-leaders-performance .list-body-{{popoverId}}"\n\t\t\t\t\t\t\t\t\t      data-lipper-help-text="{{labels.lipperHelpText}}"></span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class="vertical-divider">|</span>\n\t\t\t\t\t\t\t\t<span class="powered-by-lipper" data-ng-if="labels.cumulativeReturns">\n\t\t\t\t\t\t\t\t<span data-ng-bind="labels.fundPerformanceDefinitions"></span>\n\t\t\t\t\t\t\t\t<span data-svi-lipper-attribution\n\t\t\t\t\t\t\t\t      data-label="{{labels.cumulativeReturnsLabel}}"\n\t\t\t\t\t\t\t\t      data-custom-class="lipper-leaders-performance-popover"\n\t\t\t\t\t\t\t\t      data-placement="top"\n\t\t\t\t\t\t\t\t\t  data-container=".svi-lipper-leaders-performance .list-body-{{popoverId}}"\n\t\t\t\t\t\t\t\t      data-lipper-help-text="{{labels.cumulativeReturns}}"></span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class="vertical-divider">|</span>\n\t\t\t\t\t\t\t\t<span class="disclaimer">\n\t\t                            {{labels.valuesAsOf}} {{asOfDate | sviDate:\'MM/d/yyyy\'}}\n\t                            </span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>\n')}]),angular.module("lipperRatingsAAG/lipperRatingsAAG.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("lipperRatingsAAG/lipperRatingsAAG.tpl.html",'<div class="svi-directive svi-lipper-ratings-a-a-g" data-svi-widget data-title="labels.lipperRatingsAAGTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<div class="list-group-item">\n\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="ratings-wrapper" data-ng-if="ratings">\n\t\t\t\t\t\t<div class="lipper-rating-item" data-ng-repeat="rating in ratings" data-ng-show="rating.value">\n\t\t\t\t\t\t\t<span class="lipper-rating-item-title" data-ng-bind="rating.title"></span>\n\t\t\t\t\t\t\t<div data-ng-bind="rating.value" data-ng-class="{\'max-rating\': rating.value === 5, \'rating-circle\': rating.value !== 5}"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="lipper-ratings-footer" data-ng-if="ratings">\n\t\t\t\t\t\t<span>{{labels.lipperRatingsAAGHigh}}-5-4-3-2-1-{{labels.lipperRatingsAAGLow}}</span>\n\t\t\t\t\t\t<span>{{labels.lipperRatingsAAGPeerGroup}}: {{fundSector}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>\n')}]),angular.module("marketClock/marketClock.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("marketClock/marketClock.tpl.html",'<div class="svi-market-clock" data-ng-if="labels">\n    <div class="markets-status-wrapper" data-ng-if="marketsStatus[\'preMarketOneHourOpen\']">\n        <div class="markets-status" data-ng-bind="labels.preMarketOpen"></div>\n        <div class="markets-status-time"><b>{{duration.minutes}}</b> {{labels.minutes}}</div>\n    </div>\n\n    <div class="markets-status-wrapper" data-ng-if="marketsStatus[\'preMarketOneMinuteOpen\']">\n        <div class="markets-status" data-ng-bind="labels.preMarketOpen"></div>\n        <div class="markets-status-time"><b>{{duration.seconds}}</b> {{labels.seconds}}</div>\n    </div>\n\n    <div class="markets-status-wrapper" data-ng-if="marketsStatus[\'marketsCloseTwoHours\']">\n        <div class="markets-status" data-ng-bind="labels.marketsClose"></div>\n        <div class="markets-status-time"><span data-ng-if="duration.hours > 0"><b>{{duration.hours}}</b> {{labels.hr}}</span> <b>{{duration.minutes}}</b>\n            {{labels.minutes}}\n        </div>\n    </div>\n\n    <div class="markets-status-wrapper" data-ng-if="marketsStatus[\'marketsCloseFiveMinutes\']">\n        <div class="markets-status" data-ng-bind="labels.marketsClose"></div>\n        <div class="markets-status-time"><span data-ng-if="duration.minutes > 0"><b>{{duration.minutes}}</b> {{labels.minute}}</span> <b>{{duration.seconds}}</b>\n            {{labels.seconds}}\n        </div>\n    </div>\n\n    <div class="markets-status-wrapper" data-ng-if="marketsStatus[\'marketsOpen\']">\n        <div class="markets-status" data-ng-bind="labels.marketsAre"></div>\n        <div class="markets-status-time"><b>{{labels.open}}</b></div>\n    </div>\n\n    <div class="markets-status-wrapper" data-ng-if="marketsStatus[\'afterMarketHoursClosed\']">\n        <div class="markets-status" data-ng-bind="labels.marketsAre"></div>\n        <div class="markets-status-time"><b>{{labels.closed}}</b></div>\n    </div>\n\n    <div class="markets-status-wrapper" data-ng-if="marketsStatus[\'holidayOrWeekend\']">\n        <div class="markets-status" data-ng-bind="labels.marketsAre"></div>\n        <div class="markets-status-time"><b>{{labels.closed}} {{labels.today}}</b></div>\n    </div>\n</div>')}]),angular.module("marketEventsSummary/marketEventsSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("marketEventsSummary/marketEventsSummary.tpl.html",'<div class="svi-directive data-svi-market-events-summary" data-svi-widget data-title="labels.marketEventsSummaryTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t\t\t<div class="marketEventsSummary-wrapper">\n\t\t\t\t\t\t<div class="row" data-ng-show="marketEventsSummaryInfo">\n\t\t\t\t\t\t\t<div class="col-md-6">\n\t\t\t\t\t\t\t\t<div class="market-events-summary-date-input">\n\t\t\t\t\t\t\t\t\t<form data-ng-submit="api.manualDateSubmit()" class="input-group">\n\t\t\t\t\t\t\t\t\t\t<input type="text"\n\t\t\t\t\t\t\t\t\t\t       class="form-control events-date-input"\n\t\t\t\t\t\t\t\t\t\t       aria-label="Events date"\n\t\t\t\t\t\t\t\t\t\t       placeholder="MM/DD/YYYY"\n\t\t\t\t\t\t\t\t\t\t       data-ng-change="onInputChange(inputDate.date)"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="inputDate.date">\n\t\t\t\t\t\t\t\t\t\t<span class="input-group-addon">\n\t\t\t\t\t\t\t\t\t\t\t<i class="glyphicon glyphicon-calendar"></i>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="svi-bs-datepicker">\n\t\t\t\t\t\t\t\t\t<div id="datepicker-container"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="responsive-dates">\n\t\t\t\t\t\t\t\t\t<div class="svi-tabs">\n\t\t\t\t\t\t\t\t\t\t<a href="" class="control-prev"\n\t\t\t\t\t\t\t\t\t\t   aria-label="{{labels.prevDate}}"\n\t\t\t\t\t\t\t\t\t\t   data-ng-click="previousDate()"\n\t\t\t\t\t\t\t\t\t\t   role="button">\n\t\t\t\t\t\t\t\t\t\t\t<i class="carousel-control-prev-icon glyphicon glyphicon-chevron-left" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t<a href=""\n\t\t\t\t\t\t\t\t\t\t   aria-label="{{labels.nextDate}}"\n\t\t\t\t\t\t\t\t\t\t   data-ng-if="marketEventsSummaryInfo.date !== (endDate | date:\'yyyy-MM-dd\')"\n\t\t\t\t\t\t\t\t\t\t   class="control-next"\n\t\t\t\t\t\t\t\t\t\t   data-ng-click="nextDate()"\n\t\t\t\t\t\t\t\t\t\t   role="button">\n\t\t\t\t\t\t\t\t\t\t\t<i class="carousel-control-next-icon glyphicon glyphicon-chevron-right" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t<div class="item">\n\t\t\t\t\t\t\t\t\t\t\t<div class="col-md-12 info-wrapper">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="day" data-ng-bind="marketEventsSummaryInfo.date | date:\'dd\'"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="month">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{marketEventsSummaryInfo.date | date:\'MMMM\'}} - {{marketEventsSummaryInfo.date | date:\'yyyy\'}}\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="col-md-6 info-wrapper">\n\t\t\t\t\t\t\t\t<div data-ng-repeat="(event, count) in marketEventsSummaryInfo.events"\n\t\t\t\t\t\t\t\t     class="col-md-12 info border-bottom">\n\t\t\t\t\t\t\t\t\t<a href=""\n\t\t\t\t\t\t\t\t\t   data-ng-click="anchorLink(event|labels:labels)">\n\t\t\t\t\t\t\t\t\t\t{{event | labels:labels}}\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<span class="event-count" data-ng-bind="count"></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="col-md-12 info">\n\t\t\t\t\t\t\t\t\t<span class="current-date" data-ng-bind="marketEventsSummaryInfo.date | date:\'MMMM dd\'"></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("marketIndices/marketIndices.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("marketIndices/marketIndices.tpl.html",'<div class="svi-directive svi-market-indices" data-svi-widget data-title="labels.marketIndicesTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div data-svi-loader\n\t\t     class="loader indices-loader hidden"\n\t\t     data-callback="setLoader"\n\t\t     data-event-id="MARKETS.QUOTE"\n\t\t     data-ignore-invisible="true"></div>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li data-svi-price-history-chart\n\t\t\t\t\tclass="list-group-item"\n\t\t\t\t\tdata-symbol="{{comm.symbol}}"\n\t\t\t\t\tdata-reload-every="{{reloadEvery}}"\n\t\t\t\t\tdata-ignore-events="true"\n\t\t\t\t\tdata-timespan="{{timespan}}"\n\t\t\t\t\tdata-show-range-buttons="true"\n\t\t\t\t\tdata-show-volume="false"\n\t\t\t\t\tdata-show-title="false"\n\t\t\t\t\tdata-use-gradient="true"\n\t\t\t\t\tdata-responsive="true"\n\t\t\t\t\tdata-show-price-info="true"\n\t\t\t\t\tdata-market-hours-only="true"\n\t\t\t\t\tdata-chart-color-begin="#8EBFEF"\n\t\t\t\t\tdata-line-color="#8EBFEF"\n\t\t\t\t\tdata-chart-color-end="#FDFFEF">\n\t\t\t\t</li>\n\t\t\t\t<li class="list-group-item" data-ng-if="exchange.indices.length">\n\t\t\t\t\t<table class="table table-striped">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th data-ng-bind="labels.marketIndexName"></th>\n\t\t\t\t\t\t\t\t<th role="columnheader" class="currency" data-ng-bind="labels.marketIndexPrice"></th>\n\t\t\t\t\t\t\t\t<th role="columnheader" class="currency" data-ng-bind="labels.marketIndexChange"></th>\n\t\t\t\t\t\t\t\t<th role="columnheader" class="number" data-ng-bind="labels.marketIndexPercentChange"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr data-ng-repeat="index in exchange.indices" data-ng-class="{\'selected\': comm.symbol == index.symbol}">\n\t\t\t\t\t\t\t\t<td role="rowheader"><button class="btn btn-xs"\n\t\t\t\t\t\t\t\t\t\t\tdata-ng-class="{\'btn-primary\': comm.symbol == index.symbol, \'btn-default\': comm.symbol != index.symbol}"\n\t\t\t\t\t\t\t\t\t\t\tdata-ng-click="comm.symbol = index.symbol"\n\t\t\t\t\t\t\t\t\t\t\tdata-ng-bind="index.name"></button></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="index.currentPrice|sviCurrency:true:\'\'"></td>\n\t\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="index.change|currencyChange:true:\'\'"></td>\n\t\t\t\t\t\t\t\t<td class="number" data-ng-bind-html="index.percentChange|percentIndicator"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t<div data-ng-if="exchange && exchange.indices[0].timestamp" class="asof-display">\n\t\t\t\t\t\t{{labels.asOf}} {{exchange.indices[0].timestamp|sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("marketMovers/marketMovers.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("marketMovers/marketMovers.tpl.html",'<div class="svi-directive svi-market-movers" data-ng-if="type != \'Tabs\'">\n\t<div class="loader movers-loader-{{type}}" data-svi-loader data-callback="setLoader"></div>\n\t<div class="list-body">\n\t\t<ul class="list-group with-border" data-ng-show="movers">\n\t\t\t<li>\n\t\t\t\t<div class="row header-titles">\n\t\t\t\t\t<div class="col-xs-3 col-sm-3"></div>\n\t\t\t\t\t<div class="col-xs-2 col-sm-2" data-ng-bind="labels.exchange"></div>\n\t\t\t\t\t<div class="col-xs-2 col-sm-2" data-ng-bind="labels.price"></div>\n\t\t\t\t\t<div class="col-xs-3" data-ng-bind="labels.dayChange"></div>\n\t\t\t\t\t<div class="col-xs-2" data-ng-bind="labels.volume"></div>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t\t<li class="list-group-item" data-ng-repeat="item in movers | limitTo : (((showMore || limitDisplay == 0) ? limit : limitDisplay) || 9999)">\n\t\t\t\t<div class="row">\n\t\t\t\t\t<div class="col-xs-3 col-sm-3">\n\t\t\t\t\t\t<span data-svi-symbol class="instrument-symbol" data-instrument="item.instrument"></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-xs-2 col-sm-2 info-block-wrapper">\n\t\t\t\t\t\t<span class="instrument-exchange badge badge-pill" data-ng-bind="item.instrument.exch"></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-xs-2 col-sm-2 info-block-wrapper">\n\t\t\t\t\t\t<div data-ng-class="{positive: item.quote.change > 0, negative: item.quote.change < 0}" class="info-block">\n\t\t\t\t\t\t\t{{ item.quote.lastPrice|sviCurrency:null:\'\'}}\n\t\t\t\t\t\t\t<span class="svi-visually-hidden" data-ng-bind="(item.quote.change > 0 ? \'up\' : (item.quote.change < 0 ? \'down\': \'\'))"></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-xs-3 info-block-wrapper">\n\t\t\t\t\t\t<div data-ng-show="item.quote.change !== null" class="info-block">\n\t\t\t\t\t\t\t<span class="change" data-ng-bind-html="item.quote.change|currencyChange:null:\'\'"></span>\n\t\t\t\t\t\t\t<span class="parenChangePercent" data-ng-bind-html="item.quote.pctChange|percentChange:2:true"></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-xs-2 info-block-wrapper">\n\t\t\t\t\t\t<div class="volume info-block">\n\t\t\t\t\t\t\t{{item.quote.extendedQuote.volume|sviNumber:0:true:true}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row">\n\t\t\t\t\t<div class="col-xs-5 col-sm-6 instrument-description" data-ng-bind-html="item.instrument.desc|ellipsis:20:true"></div>\n\t\t\t\t\t<div class="col-xs-7 col-sm-6 as-of-date">\n\t\t\t\t\t\t{{labels.asOf}} {{item.quote.quoteTime|sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t\t<li class="list-group-item text-center" ng-if="!movers.length" data-ng-bind="labels.noData"></li>\n\t\t</ul>\n\t\t<div class="more-less-banner" data-ng-show="limitDisplay > 0">\n\t\t\t<button type="button" class="btn btn-lg btn-link" aria-expanded="{{ showMore ? \'true\' : \'false\'}}" data-ng-click="showMore = !showMore" aria-controls="{{::id}}" aria-label="{{ showMore ? labels.less : labels.more }} top movers">\n\t\t\t\t{{ showMore ? labels.less : labels.more }} <span class="glyphicon" data-ng-class="{\'glyphicon-chevron-up\': showMore, \'glyphicon-chevron-down\': !showMore}"></span>\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</div>\n<div class="svi-directive svi-market-movers" data-ng-if="type == \'Tabs\'" data-svi-widget data-title="labels.marketMoversTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t\t<div class="loader movers-loader-{{type}}" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t<div class="row">\n\t\t\t\t<div class="col-md-12">\n\t\t\t\t\t<div class="market-movers-wrapper-top">\n\t\t\t\t\t\t<div data-svi-filter-dropdown\n\t\t\t\t\t\t\tdata-ng-if="exchangeDropdown && labels.dropDownLabel"\n\t\t\t\t\t\t\tdata-event-id="MARKET_MOVERS.EXCHANGE"\n\t\t\t\t\t\t\tdata-state-id="{{exchange}}"\n\t\t\t\t\t\t\tdata-selected="{{exchange}}"\n\t\t\t\t\t\t\tdata-dropdown-class="dropdown-menu-right"\n\t\t\t\t\t\t\tdata-label-text="{{labels.dropDownLabel}}"\n\t\t\t\t\t\t\tdata-options="{{exchangeDropdown}}"></div>\n\t\t\t\t\t\t<div data-svi-tabs data-arrows-enabled="false" data-min-height="300">\n\t\t\t\t\t\t\t<div data-svi-market-movers \n\t\t\t\t\t\t\t\tclass="item" \n\t\t\t\t\t\t\t\tdata-tab-title="{{labels.marketMoversActives}}" \n\t\t\t\t\t\t\t\tdata-type="Active" \n\t\t\t\t\t\t\t\tdata-limit="{{limit}}"\n\t\t\t\t\t\t\t\tdata-limit-display="{{limitDisplay}}" \n\t\t\t\t\t\t\t\tdata-sort-field="quote.extendedQuote.volume" \n\t\t\t\t\t\t\t\tdata-sort-dir="desc"></div>\n\t\t\t\t\t\t\t<div data-svi-market-movers \n\t\t\t\t\t\t\t\tclass="item" \n\t\t\t\t\t\t\t\tdata-tab-title="% {{labels.marketMoversGainers}}" \n\t\t\t\t\t\t\t\tdata-type="Gainers" \n\t\t\t\t\t\t\t\tdata-limit="{{limit}}" \n\t\t\t\t\t\t\t\tdata-limit-display="{{limitDisplay}}" \n\t\t\t\t\t\t\t\tdata-sort-field="quote.pctChange" \n\t\t\t\t\t\t\t\tdata-sort-dir="desc"></div>\n\t\t\t\t\t\t\t<div data-svi-market-movers \n\t\t\t\t\t\t\t\tclass="item" \n\t\t\t\t\t\t\t\tdata-tab-title="% {{labels.marketMoversLosers}}"  \n\t\t\t\t\t\t\t\tdata-type="Losers" \n\t\t\t\t\t\t\t\tdata-limit="{{limit}}" \n\t\t\t\t\t\t\t\tdata-limit-display="{{limitDisplay}}" \n\t\t\t\t\t\t\t\tdata-sort-field="quote.pctChange" \n\t\t\t\t\t\t\t\tdata-sort-dir="asc"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t</svi:widget-front>\n\t<svi:widget-shortcuts>\n\t\t<span class="more-icon fas fa-external-link-alt" data-ng-click="api.more()" title="{{labels.seeAll}}" role="button" aria-label="{{labels.seeAllExtended}}"></span>\n\t</svi:widget-shortcuts>\n</div>')}]),angular.module("priceHistoryAndFundGrowthContainer/priceHistoryAndFundGrowthContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("priceHistoryAndFundGrowthContainer/priceHistoryAndFundGrowthContainer.tpl.html",'<div class="svi-directive svi-price-history-and-fund-growth-container" data-svi-widget data-title="labels.priceHistoryAndFundGrowthContainerTitle" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <form class="chart-types">\n                        <label class="label-input">\n                            <input type="radio"\n                                   name="priceHistory"\n                                   value="priceHistory"\n                                   data-ng-model="currentChart.val">\n                            {{labels.priceChart}}\n                        </label>\n                        <label class="label-input">\n                            <input type="radio"\n                                   name="fundGrowth"\n                                   value="fundGrowth"\n                                   data-ng-model="currentChart.val">\n                            {{labels.fundGrowth}}\n                        </label>\n                    </form>\n                    <div>\n                        <div data-svi-price-history-chart\n                             data-ng-if="currentChart.val === \'priceHistory\'"\n                             data-show-title="false"\n                             data-show-price-info="true"\n                             data-show-volume="true"\n                             data-line-color="#8EBFEF"\n                             data-chart-color-end="#FDFFEF"\n                             data-line-width="2"\n                             data-responsive="true"\n                             data-event-name="{{ eventName }}"\n                             data-investment-type="{{investmentType}}"\n                             data-reload-every="{{reloadEvery}}"\n                             data-chart-color-begin="{{chartColorBegin}}"\n                             data-use-gradient="{{useGradient}}"\n                             data-y-axis-font-color="{{yAxisFontColor}}"\n                             data-range-button-width="{{rangeButtonWidth}}"\n                             data-market-hours-only="true"\n                             data-show-navigator="{{showNavigator}}"\n                             data-symbol="{{ symbol }}"></div>\n                        <div data-svi-fund-growth\n                             data-symbol-format="{{symbolFormat}}"\n                             data-ng-if="currentChart.val === \'fundGrowth\'"\n                             data-template="Chart"\n                             data-symbol="{{ symbol }}"\n                             data-timespan="TenYear"\n                             data-include-benchmarks="true"\n                             data-init-range="TenYear"></div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("sectorHeatmap/sectorHeatmap.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("sectorHeatmap/sectorHeatmap.tpl.html",'<div class="svi-directive svi-sector-heatmap" data-svi-widget data-title="labels.sectorHeatmapTitle" data-min-size="{{minWidgetSize}}">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t<div class="col-xs-6 col-sm-6 col-md-6 legend">\n\t\t\t\t\t\t\t{{labels.high}}\n\t\t\t\t\t\t\t<div class="swatches large-gain"></div>\n\t\t\t\t\t\t\t<div class="swatches small-gain"></div>\n\t\t\t\t\t\t\t<div class="swatches small-loss"></div>\n\t\t\t\t\t\t\t<div class="swatches large-loss"></div>\n\t\t\t\t\t\t\t{{labels.low}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div data-ng-if="sectors && sectors[0].quote.quoteTime" class="asof-date col-xs-6 col-sm-6 col-md-6">\n\t\t\t\t\t\t\t{{labels.asOf}} {{sectors[0].quote.quoteTime|sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\n\t\t\t\t<li class="list-group-item svi-sector-heatmap-grid" data-ng-class="rc.getCollapsedCols()">\n\t\t\t\t\t<table data-svi-responsive-columns="responsiveColumnsSettings" class="table table-striped svi-sector-heatmap-table" data-float-thead="floatTheadOptions" data-ng-model="sectors">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}" data-sort-field="desc" data-text="labels.sector" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="desc"></th>\n\t\t\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}" data-sort-field="quote.pctChange" class="number" data-init-dir="desc" data-text="labels.today" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="today"></th>\n\t\t\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}" data-sort-field="weekToDate.pctChange" class="number" data-init-dir="desc" data-text="labels.thisWeek" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="thisWeek"></th>\n\t\t\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}" data-sort-field="monthToDate.pctChange" class="number" data-init-dir="desc" data-text="labels.thisMonth" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="thisMonth"></th>\n\t\t\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}" data-sort-field="yearToDate.pctChange" class="number" data-init-dir="desc" data-text="labels.thisYear" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="thisYear"></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr data-ng-repeat-start="sector in sectors" data-ng-class="{benchmark: sector.benchmark}" data-toggle-row="{{ ::$index }}" data-svi-rc-toggle-row="rc">\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="::sector.desc" class="" data-col-name="desc"></td>\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="::sector.quote.pctChange|percent:2:true" class="number" data-ng-class="::getCellClass(sector.quote.pctChange)" data-col-name="today"></td>\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="::sector.weekToDate.pctChange|percent:2:true" class="number" data-ng-class="::getCellClass(sector.weekToDate.pctChange)" data-col-name="thisWeek"></td>\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="::sector.monthToDate.pctChange|percent:2:true" class="number" data-ng-class="::getCellClass(sector.monthToDate.pctChange)" data-col-name="thisMonth"></td>\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="::sector.yearToDate.pctChange|percent:2:true" class="number" data-ng-class="::getCellClass(sector.yearToDate.pctChange)" data-col-name="thisYear"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr class="hide"><td>&nbsp;\x3c!-- this is a placeholder so row stripes match the parent and detail row --\x3e</td></tr>\n\t\t\t\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t\t\t\t\t<td colspan="5">\n\t\t\t\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t\t\t\t<td ng-bind-html="::detail.value"></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n\t<svi:widget-shortcuts>\n\t\t<span data-ng-if="::(moreUrl)" class="more-icon fas fa-external-link-alt" data-ng-click="api.more()" title="{{labels.moreTooltip}}" role="button" aria-label="{{labels.moreTooltip}}"></span>\n\t</svi:widget-shortcuts>\n</div>')}]),angular.module("sectorIndustriesChart/sectorIndustriesChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("sectorIndustriesChart/sectorIndustriesChart.tpl.html",'<div class="svi-directive svi-sector-industries-chart" data-include-loader="false">\n\t<div class="tab-controls">\n\t\t<ul class="nav nav-pills center-pills" role="tablist">\n\t\t\t<li class="nav-item active" role="presentation">\n\t\t\t\t<a role="tab" href="" class="nav-link" data-ng-click="updateChartWithTimePeriod(labels.today, $event)" data-ng-bind="labels.today"></a>\n\t\t\t</li>\n\t\t\t<li class="nav-item" role="presentation">\n\t\t\t\t<a role="tab" href="" class="nav-link" data-ng-click="updateChartWithTimePeriod(labels.thisWeek, $event)" data-ng-bind="labels.thisWeek"></a>\n\t\t\t</li>\n\t\t\t<li class="nav-item" role="presentation">\n\t\t\t\t<a role="tab" href="" class="nav-link" data-ng-click="updateChartWithTimePeriod(labels.thisMonth, $event)" data-ng-bind="labels.thisMonth"></a>\n\t\t\t</li>\n\t\t\t<li class="nav-item" role="presentation">\n\t\t\t\t<a role="tab" href="" class="nav-link" data-ng-click="updateChartWithTimePeriod(labels.thisYear, $event)" data-ng-bind="labels.thisYear"></a>\n\t\t\t</li>\n\t\t\t<li class="nav-item" role="presentation">\n\t\t\t\t<a role="tab" href="" class="nav-link" data-ng-click="updateChartWithTimePeriod(labels.lastWeek, $event)" data-ng-bind="labels.lastWeek"></a>\n\t\t\t</li>\n\t\t\t<li class="nav-item" role="presentation">\n\t\t\t\t<a role="tab" href="" class="nav-link" data-ng-click="updateChartWithTimePeriod(labels.lastMonth, $event)" data-ng-bind="labels.lastMonth"></a>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n\t<div class="row">\n\t\t<div data-ng-if="sectors && sectors[0].quote.quoteTime" class="asof-date col-xs-6 col-sm-6 col-md-6">\n\t\t\t{{labels.asOf}} {{sectors[0].quote.quoteTime|sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t</div>\n\t</div>\n\t<div id="sectors-industries-chart"></div>\n</div>')}]),angular.module("sectorIndustriesContainer/sectorIndustriesContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("sectorIndustriesContainer/sectorIndustriesContainer.tpl.html",'<div class="svi-directive svi-sector-industries-container" data-include-loader="false">\n\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\n\t<div class="sector-industries-table-wrapper" data-ng-show="sectors">\n\t\t<h2 class="sector-industries-title" data-ng-bind="labels.sectorsIndustriesChartTitle"></h2>\n\t\t<div class="row">\n\t\t\t<div class="col-md-12">\n\t\t\t\t<div data-ng-if="sectors" data-sectors="sectors" data-svi-sector-industries-chart></div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<h2 class="sector-industries-title" data-ng-bind="labels.sectorsIndustriesTableTitle"></h2>\n\t\t<div class="row">\n\t\t\t<div class="col-md-12">\n\t\t\t\t<div data-ng-if="sectors" data-svi-sector-industries-grid data-sectors="sectors" data-sort-field="sortField" data-sort-dir="sortDir"  ></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n</div>\n\n')}]),angular.module("sectorIndustriesGrid/sectorIndustriesGrid.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("sectorIndustriesGrid/sectorIndustriesGrid.tpl.html",'<div class="svi-directive svi-sector-industries-grid" data-ng-show="sectors.length > 0"\n     data-ng-class="rc.getCollapsedCols()">\n\t<div data-svi-filter-dropdown class="form-inline"\n\t     data-ng-if="labels.dropdownLabelText"\n\t     data-event-id="SECTORS.INDUSTRIES"\n\t     data-selected="{{defaultView}}"\n\t     data-title="{{labels.defaultTitle}}"\n\t     data-aria-label="{{labels.defaultTitle}}"\n\t     data-options="{{dropdownOptions}}"\n\t     data-label-text="{{labels.dropdownLabelText}}"\n\t     data-comm="{title: labels.defaultTitle, ariaLabel: labels.defaultTitle, options: dropdownOptions}"></div>\n\t<table\n\t\t\tclass="table table-striped"\n\t\t\tdata-svi-responsive-columns="responsiveColumnsSettings"\n\t\t\tdata-ng-model="sectors"\n\t\t\tdata-float-thead="floatTheadOptions">\n\t\t<thead>\n\t\t<tr>\n\t\t\t<th data-svi-column-header\n\t\t\t    role="columnheader"\n\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t    data-sortable="{{false}}"\n\t\t\t    data-text="labels.sectors"\n\t\t\t    data-col-name="sectors"></th>\n\t\t\t<th data-svi-column-header\n\t\t\t    class="number"\n\t\t\t    role="columnheader"\n\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t    data-sortable="{{::sortable}}"\n\t\t\t    data-sort-field="weekToDate.pctChange"\n\t\t\t    data-text="labels.thisWeek"\n\t\t\t    data-sorted-field="sortField"\n\t\t\t    data-sorted-dir="sortDir"\n\t\t\t    data-col-name="week"></th>\n\t\t\t<th data-svi-column-header\n\t\t\t    class="number"\n\t\t\t    role="columnheader"\n\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t    data-sortable="{{::sortable}}"\n\t\t\t    data-sort-field="monthToDate.pctChange"\n\t\t\t    data-text="labels.thisMonth"\n\t\t\t    data-sorted-field="sortField"\n\t\t\t    data-sorted-dir="sortDir"\n\t\t\t    data-col-name="month"></th>\n\t\t\t<th data-svi-column-header\n\t\t\t    class="number"\n\t\t\t    role="columnheader"\n\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t    data-sortable="{{::sortable}}"\n\t\t\t    data-sort-field="yearToDate.pctChange"\n\t\t\t    data-text="labels.thisYear"\n\t\t\t    data-sorted-field="sortField"\n\t\t\t    data-sorted-dir="sortDir"\n\t\t\t    data-col-name="year"></th>\n\t\t\t<th data-svi-column-header\n\t\t\t    class="number"\n\t\t\t    role="columnheader"\n\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t    data-sortable="{{::sortable}}"\n\t\t\t    data-sort-field="lastWeek.pctChange"\n\t\t\t    data-text="labels.lastWeek"\n\t\t\t    data-sorted-field="sortField"\n\t\t\t    data-sorted-dir="sortDir"\n\t\t\t    data-col-name="last-week"></th>\n\t\t\t<th data-svi-column-header\n\t\t\t    class="number"\n\t\t\t    role="columnheader"\n\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t    data-sortable="{{::sortable}}"\n\t\t\t    data-sort-field="lastMonth.pctChange"\n\t\t\t    data-text="labels.lastMonth"\n\t\t\t    data-sorted-field="sortField"\n\t\t\t    data-sorted-dir="sortDir"\n\t\t\t    data-col-name="last-month"></th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\x3c!-- benchmark --\x3e\n\t\t<tr data-ng-repeat-start="benchmark in benchmarks track by $index" data-ng-if="benchmark"\n\t\t    data-svi-rc-toggle-row="rc" data-toggle-row="{{\'benchmark\' + $index}}"\n\t\t    class="parent benchmark">\n\t\t\t<td class="outer-table-name" role="rowheader" data-col-name="desc" data-ng-bind="benchmark.desc"></td>\n\t\t\t<td data-col-name="week" class="number"\n\t\t\t    data-ng-class="{positive: benchmark.weekToDate.pctChange > 0, negative: benchmark.weekToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="benchmark.weekToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="month" class="number"\n\t\t\t    data-ng-class="{positive: benchmark.monthToDate.pctChange > 0, negative: benchmark.monthToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="benchmark.monthToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="year" class="number"\n\t\t\t    data-ng-class="{positive: benchmark.yearToDate.pctChange > 0, negative: benchmark.yearToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="benchmark.yearToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-week" class="number"\n\t\t\t    data-ng-class="{positive: benchmark.lastWeek.pctChange > 0, negative: benchmark.lastWeek.pctChange < 0}"\n\t\t\t    data-ng-bind="benchmark.lastWeek.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-month" class="number"\n\t\t\t    data-ng-class="{positive: benchmark.lastMonth.pctChange > 0, negative: benchmark.lastMonth.pctChange < 0}"\n\t\t\t    data-ng-bind="benchmark.lastMonth.pctChange|percent:2:true"></td>\n\t\t</tr>\n\t\t<tr class="hide">\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t<tr class="detail" data-ng-repeat-end data-ng-show="rc.rowExpanded(\'benchmark\' + $index)">\n\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(\'benchmark\' + $index)">\n\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t<td class="{{(detail.value.slice(0, -1) < 0) ? \'negative\' : (detail.value.slice(0, -1) > 0) ? \'positive\' : \'\'}}"\n\t\t\t\t\t\t    data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\n\t\t\x3c!--1--\x3e\n\t\t<tr data-ng-repeat-start="(parentIndex, sector) in displayingSectors" data-svi-rc-toggle-row="rc"\n\t\t    data-toggle-row="{{parentIndex}}"\n\t\t    class="parent">\n\t\t\t<td class="outer-table-name" role="rowheader" data-col-name="desc" data-ng-bind="sector.desc"></td>\n\t\t\t<td data-col-name="week" class="number"\n\t\t\t    data-ng-class="{positive: sector.weekToDate.pctChange > 0, negative: sector.weekToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="sector.weekToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="month" class="number"\n\t\t\t    data-ng-class="{positive: sector.monthToDate.pctChange > 0, negative: sector.monthToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="sector.monthToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="year" class="number"\n\t\t\t    data-ng-class="{positive: sector.yearToDate.pctChange > 0, negative: sector.yearToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="sector.yearToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-week" class="number"\n\t\t\t    data-ng-class="{positive: sector.lastWeek.pctChange > 0, negative: sector.lastWeek.pctChange < 0}"\n\t\t\t    data-ng-bind="sector.lastWeek.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-month" class="number"\n\t\t\t    data-ng-class="{positive: sector.lastMonth.pctChange > 0, negative: sector.lastMonth.pctChange < 0}"\n\t\t\t    data-ng-bind="sector.lastMonth.pctChange|percent:2:true"></td>\n\t\t</tr>\n\t\t<tr class="hide">\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t<tr class="detail" data-ng-show="rc.rowExpanded(parentIndex)">\n\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(parentIndex)">\n\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t<td class="{{(detail.value.slice(0, -1) < 0) ? \'negative\' : (detail.value.slice(0, -1) > 0) ? \'positive\' : \'\'}}"\n\t\t\t\t\t\t    data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\n\t\t\x3c!--2--\x3e\n\t\t<tr data-ng-show="sector.children" data-svi-rc-toggle-row="rc" data-toggle-row="{{parentIndex}}_{{industryIndex}}"\n\t\t    data-ng-repeat-start="(industryIndex, industry) in sector.children">\n\t\t\t<td class="inner-table-name-level-1" role="rowheader" data-ng-class="{\'has-expander\': industry.children.length}">\n\t\t\t\t<div>\n\t\t\t\t\t<span data-svi-expander\n\t\t\t\t\t      class="expander-wrapper"\n\t\t\t\t\t      data-ng-if="industry.children.length"\n\t\t\t\t\t      data-expanded="visibleRows[industry.children]"\n\t\t\t\t\t      data-target="{{parentIndex}}_{{industryIndex}}"\n\t\t\t\t\t      data-event-id="SECTORS.INDUSTRIES"\n\t\t\t\t\t      data-aria-label="toggle details for {{ ::industry.desc }}"></span>\n\t\t\t\t\t{{industry.desc}}\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<td data-col-name="week" class="number"\n\t\t\t    data-ng-class="{positive: industry.weekToDate.pctChange > 0, negative: industry.weekToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industry.weekToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="month" class="number"\n\t\t\t    data-ng-class="{positive: industry.monthToDate.pctChange > 0, negative: industry.monthToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industry.monthToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="year" class="number"\n\t\t\t    data-ng-class="{positive: industry.yearToDate.pctChange > 0, negative: industry.yearToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industry.yearToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-week" class="number"\n\t\t\t    data-ng-class="{positive: industry.lastWeek.pctChange > 0, negative: industry.lastWeek.pctChange < 0}"\n\t\t\t    data-ng-bind="industry.lastWeek.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-month" class="number"\n\t\t\t    data-ng-class="{positive: industry.lastMonth.pctChange > 0, negative: industry.lastMonth.pctChange < 0}"\n\t\t\t    data-ng-bind="industry.lastMonth.pctChange|percent:2:true"></td>\n\t\t</tr>\n\t\t<tr class="hide">\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t<tr class="detail" data-ng-show="rc.rowExpanded(parentIndex+\'_\'+industryIndex)">\n\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(parentIndex+\'_\'+industryIndex)">\n\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t<td class="{{(detail.value.slice(0, -1) < 0) ? \'negative\' : (detail.value.slice(0, -1) > 0) ? \'positive\' : \'\'}}"\n\t\t\t\t\t\t    data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\n\t\t\x3c!--3--\x3e\n\t\t<tr data-ng-show="industry.expanded" data-svi-rc-toggle-row="rc"\n\t\t    data-toggle-row="{{parentIndex}}_{{industryIndex}}_{{industryNestedKey}}"\n\t\t    data-ng-repeat-start="(industryNestedKey, industryNested) in industry.children">\n\t\t\t<td class="inner-table-name-level-2" role="rowheader"\n\t\t\t    data-ng-class="{\'has-expander\': industryNested.children.length}">\n\t\t\t\t<div>\n\t\t\t\t\t<span data-svi-expander\n\t\t\t\t\t      class="expander-wrapper"\n\t\t\t\t\t      data-ng-if="industryNested.children.length"\n\t\t\t\t\t      data-expanded="visibleRows[industryNested.children]"\n\t\t\t\t\t      data-target="{{parentIndex}}_{{industryIndex}}_{{industryNestedKey}}"\n\t\t\t\t\t      data-event-id="SECTORS.INDUSTRIES"\n\t\t\t\t\t      data-aria-label="toggle details for {{ ::industryNested.desc }}"></span>\n\t\t\t\t\t{{industryNested.desc}}\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<td data-col-name="week" class="number"\n\t\t\t    data-ng-class="{positive: industryNested.weekToDate.pctChange > 0, negative: industryNested.weekToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested.weekToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="month" class="number"\n\t\t\t    data-ng-class="{positive: industryNested.monthToDate.pctChange > 0, negative: industryNested.monthToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested.monthToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="year" class="number"\n\t\t\t    data-ng-class="{positive: industryNested.yearToDate.pctChange > 0, negative: industryNested.yearToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested.yearToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-week" class="number"\n\t\t\t    data-ng-class="{positive: industryNested.lastWeek.pctChange > 0, negative: industryNested.lastWeek.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested.lastWeek.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-month" class="number"\n\t\t\t    data-ng-class="{positive: industryNested.lastMonth.pctChange > 0, negative: industryNested.lastMonth.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested.lastMonth.pctChange|percent:2:true"></td>\n\t\t</tr>\n\t\t<tr class="hide">\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t<tr class="detail" data-ng-show="rc.rowExpanded(parentIndex+\'_\'+industryIndex+\'_\'+industryNestedKey)">\n\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(parentIndex+\'_\'+industryIndex+\'_\'+industryNestedKey)">\n\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t<td class="{{(detail.value.slice(0, -1) < 0) ? \'negative\' : (detail.value.slice(0, -1) > 0) ? \'positive\' : \'\'}}"\n\t\t\t\t\t\t    data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t\x3c!--4--\x3e\n\t\t<tr data-svi-rc-toggle-row="rc"\n\t\t    data-ng-show="industryNested.expanded"\n\t\t    data-toggle-row="{{parentIndex}}_{{industryIndex}}_{{industryNestedKey}}_{{industryNested_1_Key}}"\n\t\t    data-ng-repeat-start="(industryNested_1_Key, industryNested_1) in industryNested.children">\n\t\t\t<td class="inner-table-name-level-3" role="rowheader"\n\t\t\t    data-ng-class="{\'has-expander\': industryNested_1.children.length}">\n\t\t\t\t<div>\n\t\t\t\t\t<span data-svi-expander\n\t\t\t\t\t      class="expander-wrapper"\n\t\t\t\t\t      data-ng-if="industryNested_1.children.length"\n\t\t\t\t\t      data-expanded="visibleRows[industryNested_1.children]"\n\t\t\t\t\t      data-target="{{parentIndex}}_{{industryIndex}}_{{industryNestedKey}}_{{industryNested_1_Key}}"\n\t\t\t\t\t      data-event-id="SECTORS.INDUSTRIES"\n\t\t\t\t\t      data-aria-label="toggle details for {{ ::industryNested_1.desc }}"></span>\n\t\t\t\t\t{{industryNested_1.desc}}\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<td data-col-name="week" class="number"\n\t\t\t    data-ng-class="{positive: industryNested_1.weekToDate.pctChange > 0, negative: industryNested_1.weekToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested_1.weekToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="month" class="number"\n\t\t\t    data-ng-class="{positive: industryNested_1.monthToDate.pctChange > 0, negative: industryNested_1.monthToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested_1.monthToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="year" class="number"\n\t\t\t    data-ng-class="{positive: industryNested_1.yearToDate.pctChange > 0, negative: industryNested_1.yearToDate.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested_1.yearToDate.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-week" class="number"\n\t\t\t    data-ng-class="{positive: industryNested_1.lastWeek.pctChange > 0, negative: industryNested_1.lastWeek.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested_1.lastWeek.pctChange|percent:2:true"></td>\n\t\t\t<td data-col-name="last-month" class="number"\n\t\t\t    data-ng-class="{positive: industryNested_1.lastMonth.pctChange > 0, negative: industryNested_1.lastMonth.pctChange < 0}"\n\t\t\t    data-ng-bind="industryNested_1.lastMonth.pctChange|percent:2:true"></td>\n\t\t</tr>\n\t\t<tr class="hide">\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t<tr data-ng-repeat-end class="detail"\n\t\t    data-ng-show="rc.rowExpanded(parentIndex+\'_\'+industryIndex+\'_\'+industryNestedKey+\'_\'+industryNested_1_Key)">\n\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(parentIndex+\'_\'+industryIndex+\'_\'+industryNestedKey+\'_\'+industryNested_1_Key)">\n\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t<td class="{{(detail.value.slice(0, -1) < 0) ? \'negative\' : (detail.value.slice(0, -1) > 0) ? \'positive\' : \'\'}}"\n\t\t\t\t\t\t    data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr data-ng-repeat-end ng-if=0>\n\t\t\t<td></td>\n\t\t</tr>\n\t\t<tr data-ng-repeat-end ng-if=0>\n\t\t\t<td></td>\n\t\t</tr>\n\t\t<tr data-ng-repeat-end ng-if=0>\n\t\t\t<td></td>\n\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>')}]),angular.module("stockBalanceSheet/stockBalanceSheet.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockBalanceSheet/stockBalanceSheet.tpl.html",'<div class="svi-directive svi-stock-balance-sheet" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div class="svi-stocks-balance-sheet-grid" data-ng-show="balances" data-ng-class="rc.getCollapsedCols()">\n\t\t<div data-svi-filter-dropdown class="form-inline"\n\t\t\t data-ng-if="labels.dropdownLabelText"\n\t\t\t data-event-id="EVENTS.BALANCE.SHEET"\n\t\t\t data-selected="{{defaultView}}"\n\t\t\t data-title="{{labels.defaultTitle}}"\n\t\t\t data-aria-label="{{labels.defaultTitle}}"\n\t\t\t data-options="{{dropdownOptions}}"\n\t\t\t data-label-text="{{labels.dropdownLabelText}}"\n\t\t\t data-comm="{title: labels.defaultTitle, ariaLabel: labels.defaultTitle, options: dropdownOptions}"></div>\n\n\t\t<div class="row">\n\t\t\t<div class="col-md-12 col-sm-12 col-xs-12">\n\t\t\t\t<div class="disclaimer" data-ng-bind="labels.allValuesNote"></div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<table\n\t\t\t\tclass="table table-striped"\n\t\t\t\tdata-svi-responsive-columns="responsiveColumnsSettings"\n\t\t\t\tdata-ng-model="balances"\n\t\t\t\tdata-float-thead="floatTheadOptions"\n\t\t>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-svi-column-header data-text="labels.fiscalPeriod" data-col-name="fiscalPeriod" data-sortable="{{::sortable}}"></th>\n\t\t\t\t<th data-svi-column-header data-ng-repeat="year in headers track by $index" class="number" data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t data-text="year" data-col-name="Y{{$index+1}}"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat-start="(name, balance) in balances" data-ng-class="{\'header-esg-row\': balance.isHeader}" data-svi-rc-toggle-row="rc" data-toggle-row="{{!balance.data.length ? null : name}}"\n\t\t\t\tclass="parent">\n\t\t\t\t<td data-col-name="fiscalPeriod" colspan="{{balance.data.length ? 1 : colspan}}" data-ng-bind="name"></td>\n\t\t\t\t<td data-col-name="Y{{$index+1}}" class="number" data-ng-repeat="item in balance.data track by $index" data-ng-bind="item"></td>\n\t\t\t</tr>\n\t\t\t<tr data-ng-if="balance.isLast && !rc.rowExpanded(name)" class="empty-row"><td colspan="{{colspan}}"></td></tr>\n\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded(name)">\n\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(name)">\n\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\n</div>')}]),angular.module("stockCashFlow/stockCashFlow.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockCashFlow/stockCashFlow.tpl.html",'<div class="svi-directive svi-stock-cash-flow" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div data-ng-if="cashCurr" data-ng-class="rc.getCollapsedCols()" class="svi-stock-cash-flow-grid">\n\t\t\t<div data-svi-filter-dropdown \n\t\t\t\t class="form-inline" \n\t\t\t\t data-event-id="EVENTS.CASH.FLOW"\n\t\t\t\t data-selected="{{currentGrid}}" \n\t\t\t\t data-title="{{labels.defaultGrid}}"\n\t\t\t\t data-aria-label="{{labels.defaultGrid}}" \n\t\t\t\t data-label-text="{{labels.dropdownLabelText}}"\n\t\t\t\t data-options="{{dropdownOptions}}"></div>\n\t\t\t<div class="row">\n\t\t\t\t<div class="col-md-12 col-sm-12 col-xs-12">\n\t\t\t\t\t<div data-ng-bind="labels.disclaimer" class="disclaimer"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="cashCurr" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header data-col-name="name" data-sortable="{{::sortable}}" data-text="labels.fiscalPeriod"></th>\n\t\t\t\t\t<th data-svi-column-header data-col-name="Y{{$index+1}}" data-sortable="{{::sortable}}" class="number" data-text="year" data-ng-repeat="year in cashCurrHeader track by $index"></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat-start="(name, cashFlow) in cashCurr track by $index" data-svi-rc-toggle-row="rc" data-toggle-row="{{cashFlow.isHeader ? null : name}}">\n\t\t\t\t\t<td data-col-name="name" data-ng-bind="name" data-ng-class="{\'cash-flow-header\': cashFlow.isHeader}"></td>\n\t\t\t\t\t<td data-col-name="Y{{$index+1}}" class="number" data-ng-repeat="cash in cashFlow.data track by $index" data-ng-bind="cash"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr data-ng-if="cashFlow.isLast && !rc.rowExpanded(name)" class="empty-row"><td colspan="{{cashCurrColspan}}"></td></tr>\n\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded(name)">\n\t\t\t\t\t<td colspan="{{cashCurrColspan}}">\n\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(name)">\n\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>')}]),angular.module("stockCorporateEvents/stockCorporateEvents.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockCorporateEvents/stockCorporateEvents.tpl.html",'<div class="svi-directive svi-stock-corporate-events" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="setLoader" style="margin-top: 15px"></div>\n\t<div data-ng-show="corporateEvents.length > 0" class="dropdown-wrapper">\n\t\t<div data-svi-filter-dropdown class="form-inline"\n\t\t\t data-ng-if="labels.timePeriod"\n\t\t\t data-event-id="STOCK.CORPORATE.EVENTS"\n\t\t\t data-selected="{{defaultView}}"\n\t\t\t data-title="{{dropdownOptions[0].display}}"\n\t\t\t data-aria-label="{{dropdownOptions[0].display}}"\n\t\t\t data-options="{{dropdownOptions}}"\n\t\t\t data-label-text="{{labels.timePeriod}}"\n\t\t\t data-comm="{title: labels.defaultDropdownTitle, ariaLabel: labels.defaultDropdownTitle, options: dropdownOptions}"></div>\n\t</div>\n\n\t<div data-ng-show="corporateEvents.length > 0" data-ng-class="rc.getCollapsedCols()" class="stocks-corporate-events-grid">\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="corporateEvents" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-svi-column-header data-col-name="event" data-sortable="{{::sortable}}" data-text="labels.event"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="date" data-sortable="{{::sortable}}" data-text="labels.date"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="startTime" data-sortable="{{::sortable}}" data-text="labels.startTime"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="eventName" data-sortable="{{::sortable}}" data-text="labels.eventName"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="webcastLink" data-sortable="{{::sortable}}" data-text="labels.webcastLink"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat-start="event in corporateEvents" data-svi-rc-toggle-row="rc" data-toggle-row="{{$index}}">\n\t\t\t\t<td data-col-name="event" data-ng-bind="event.type"></td>\n\t\t\t\t<td data-col-name="date" data-ng-bind="event.date | sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t<td data-col-name="startTime" data-ng-bind="event.startTime"></td>\n\t\t\t\t<td data-col-name="eventName" data-ng-bind="event.name"></td>\n\t\t\t\t<td data-col-name="webcastLink">\n\t\t\t\t\t<div data-ng-if="!event.liveWebcastUrl">-</div>\n\t\t\t\t\t<a data-ng-href="{{event.liveWebcastUrl}}" data-ng-bind="labels.viewWebcast" target="_blank" data-ng-if="event.liveWebcastUrl"></a>\n\t\t\t\t\t<span class="hidden">{{event.liveWebcastUrl}}</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\n</div>\n')}]),angular.module("stockDetails/stockDetails.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockDetails/stockDetails.tpl.html",'<div class="svi-directive svi-details svi-stock-details" data-svi-widget data-title="labels.stockDetailsTitle"\n     data-include-loader="false">\n    <svi:widget-front>\n        <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n        <div class="list-body" data-ng-show="data">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div class="row">\n                        <div class="col-sm-6">\n                            <dl class="dl-vertical">\n                                <dt class="data-label" data-ng-bind="labels.weekRange"></dt>\n                                <dd class="data-value">{{data.low52wk | sviNumber:2:true:true}} - {{data.high52wk | sviNumber:2:true:true}}</dd>\n\n                                <dt class="data-label" data-ng-bind="labels.avgVolume"></dt>\n                                <dd class="data-value" data-ng-bind="data.avgVolume10D | sviNumber:2:true:true"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.pERatio"></dt>\n                                <dd class="data-value" data-ng-bind="data.peTTM | sviNumber:2:true:true"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.eps"></dt>\n                                <dd class="data-value" data-ng-bind="data.epsTTM | sviNumber:2:true:true"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.beta"></dt>\n                                <dd class="data-value beta" data-ng-bind="data.beta | sviNumber:2:true:true"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.dividendYield"></dt>\n                                <dd class="data-value" data-ng-bind="data.dividend.yield | percent : 2"></dd>\n                            </dl>\n                        </div>\n\n                        <div class="col-sm-6">\n                            <dl class="dl-vertical">\n                                <dt class="data-label" data-ng-bind="labels.marketCap"></dt>\n                                <dd class="data-value" data-ng-bind="data.marketCap * 1000000 | sviNumber:2:true:true"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.sharesOutstanding"></dt>\n                                <dd class="data-value" data-ng-bind="data.sharesOutstanding | sviNumber:2:true:true"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.listedExchange"></dt>\n                                <dd class="data-value" data-ng-bind="data.exchange"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.dividendsPaid"></dt>\n                                <dd class="data-value" data-ng-bind="data.dividend.amt | sviNumber:2:true:true"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.dividendPayableDate"></dt>\n                                <dd class="data-value" data-ng-bind="data.dividend.payDate | sviDate: \'MM/dd/yyyy\'"></dd>\n\n                                <dt class="data-label" data-ng-bind="labels.nextEarningsDate"></dt>\n                                <dd class="data-value" data-ng-bind="data.nextEarningsDate | sviDate: \'MM/dd/yyyy\'"></dd>\n                            </dl>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n')}]),angular.module("stockDividendHistory/stockDividendHistory.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockDividendHistory/stockDividendHistory.tpl.html",'<div class="svi-directive svi-stock-dividend-history" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="setLoader" style="margin-top: 15px"></div>\n\n\t<div data-ng-show="dividendHistory" data-ng-class="rc.getCollapsedCols()" class="stocks-dividend-history-grid">\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="dividendHistory" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-svi-column-header data-col-name="paymentDate" data-sortable="{{::sortable}}" data-text="labels.paymentDate"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="exDate" data-sortable="{{::sortable}}" data-text="labels.exDate"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="recordDate" data-sortable="{{::sortable}}" data-text="labels.recordDate"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="dividendAmount" class="number" data-sortable="{{::sortable}}" data-text="labels.dividendAmount"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat-start="dividend in dividendHistory" data-svi-rc-toggle-row="rc" data-toggle-row="{{$index}}">\n\t\t\t\t<td data-col-name="paymentDate" data-ng-bind="dividend.paymentDate | sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t<td data-col-name="exDate" data-ng-bind="dividend.exDate | sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t<td data-col-name="recordDate" data-ng-bind="dividend.recordDate | sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t<td data-col-name="dividendAmount" class="number" data-ng-bind="dividend.dividendAmount | sviNumber:2:true"></td>\n\t\t\t</tr>\n\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\n</div>\n')}]),angular.module("stockEsgSummary/stockEsgSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockEsgSummary/stockEsgSummary.tpl.html",'<div class="svi-directive svi-stock-e-s-g-summary" data-svi-widget data-title="labels.stockESGSummaryTitle"\n\t data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="stock-esg-summary-wrapper" data-ng-show="data">\n\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t<div data-ng-if="data.reportDate" class="as-of-date">{{labels.asOf}} {{data.reportDate |sviDate:"MM/dd/yyyy"}} </div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row top-ranking-info">\n\t\t\t\t\t\t\t<div class="col-md-5 col-sm-12 col-xs-12 symbol-info">\n\t\t\t\t\t\t\t\t<div data-ng-bind-html="data.companyName|ellipsis:companyNameLength:true:true"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="col-md-7 col-sm-12 col-xs-12 leafs-rating-wrapper">\n\t\t\t\t\t\t\t\t<div class="sub-title esg-rating-title" data-ng-bind="labels.esgRatings"></div>\n\t\t\t\t\t\t\t\t<div class="img-role-wrapper" role="img" aria-label=\'{{greenLeafs.length + " " + labels.outOf + " " + maxRating + " " + labels.leafs}}\'>\n\t\t\t\t\t\t\t\t\t<span data-ng-repeat="item in greenLeafs track by $index">\n\t\t\t\t\t\t\t\t\t\t<span class="fas fa-leaf green-leafs"></span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span data-ng-repeat="item in greyLeafs track by $index">\n\t\t\t\t\t\t\t\t\t\t<span class="fas fa-leaf grey-leafs"></span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div class="row ranking-info-wrapper">\n\t\t\t\t\t\t\t<div class="col-md-3 col-sm-6 col-xs-6 scores popover-bind-esg-score">\n\t\t\t\t\t\t\t\t<a href="" class="sub-title help-text-link" data-ng-bind="labels.ESGScore" data-trigger="click" data-container=".svi-stock-e-s-g-summary .popover-bind-esg-score" data-placement="bottom"  data-bs-popover data-auto-close="1"  data-content="{{labels.esgScoreText}}"></a>\n\t\t\t\t\t\t\t\t<div data-svi-gauge-chart data-value="{{data.esg | sviNumber:2}}" class="gauge-chart"\n\t\t\t\t\t\t\t\t\t data-max-value="100" data-chart-color="{{ chartColors[\'esgScore\'] }}"\n\t\t\t\t\t\t\t\t\t data-description=""></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="col-md-3 col-sm-6 col-xs-6 scores popover-bind-peer-avg">\n\t\t\t\t\t\t\t\t<a href="" class="sub-title help-text-link" data-ng-bind="labels.peerAvg" data-trigger="click" data-container=".svi-stock-e-s-g-summary .popover-bind-peer-avg" data-placement="bottom"  data-bs-popover data-auto-close="1"  data-content="{{labels.peerAvgText}}"></a>\n\t\t\t\t\t\t\t\t<div data-svi-gauge-chart data-value="{{data.industryAvg | sviNumber:2}}" class="gauge-chart"\n\t\t\t\t\t\t\t\t\t data-max-value="100" data-chart-color="{{ chartColors[\'peerAvg\'] }}"\n\t\t\t\t\t\t\t\t\t data-description=""></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="col-md-3 col-sm-6 col-xs-6 scores peer-ranking-info">\n\t\t\t\t\t\t\t\t<div class="sub-title" data-ng-bind="labels.peerRanking"></div>\n\t\t\t\t\t\t\t\t<span>#{{data.industryRank | sviNumber:2}}</span>\n\t\t\t\t\t\t\t\t{{labels.outOf}} {{data.industrySize}}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="col-md-3 col-sm-6 col-xs-6 scores trend-info">\n\t\t\t\t\t\t\t\t<div class="sub-title" data-ng-bind="labels.yearTrend3"></div>\n\t\t\t\t\t\t\t\t<span data-ng-if="data[\'3yTrend\']">\n\t\t\t\t\t\t\t\t\t<span class="glyphicon" data-ng-class="{\'positive-trend glyphicon-arrow-up\': data[\'3yTrend\'] === \'up\', \'negative-trend glyphicon-arrow-down\': data[\'3yTrend\'] === \'down\'}"></span>\n\t\t\t\t\t\t\t\t\t<span class="trend-message" data-ng-bind="data[\'3yTrend\']"></span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span data-ng-if="!data[\'3yTrend\']">\n\t\t\t\t\t\t\t\t\t<span class="not-announced-text" data-ng-bind="labels.notAnnounced"></span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t<div class="col-md-3 col-sm-6 col-xs-6 score-breakdowns-title">\n\t\t\t\t\t\t\t\t<h4 aria-level="3">{{labels.scoreBreakdown}}:</h4>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class="col-md-3 col-sm-6 col-xs-6 score-breakdowns popover-bind-environmental">\n\t\t\t\t\t\t\t\t<a href="" class="title help-text-link" data-ng-bind="labels.environmental" data-trigger="click" data-container=".svi-stock-e-s-g-summary .popover-bind-environmental" data-placement="bottom"  data-bs-popover data-auto-close="1"  data-content="{{labels.environmentalText}}"></a>\n\t\t\t\t\t\t\t\t<div class="value" data-ng-bind="data.environmental | sviNumber:2"></div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class="col-md-3 col-sm-6 col-xs-6 score-breakdowns popover-bind-social">\n\t\t\t\t\t\t\t\t<a href="" class="title help-text-link" data-ng-bind="labels.social" data-trigger="click" data-container=".svi-stock-e-s-g-summary .popover-bind-social" data-placement="bottom"  data-bs-popover data-auto-close="1"  data-content="{{labels.socialText}}"></a>\n\t\t\t\t\t\t\t\t<div class="value" data-ng-bind="data.social | sviNumber:2"></div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class="col-md-3 col-sm-6 col-xs-6 score-breakdowns popover-bind-governance">\n\t\t\t\t\t\t\t\t<a href="" class="title help-text-link" data-ng-bind="labels.governance" data-trigger="click" data-container=".svi-stock-e-s-g-summary .popover-bind-governance" data-placement="bottom"  data-bs-popover data-auto-close="1"  data-content="{{labels.governanceText}}"></a>\n\t\t\t\t\t\t\t\t<div class="value" data-ng-bind="data.governance | sviNumber:2"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t<div class="col-md-12 esg-ranking-footer">\n\t\t\t\t\t\t\t\t{{labels.peerGroup}}: {{data.industryName}}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>\n')}]),angular.module("stockIncomeStatement/stockIncomeStatement.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockIncomeStatement/stockIncomeStatement.tpl.html",'<div class="svi-directive svi-stock-income-statement" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div data-ng-if="currentStocks" data-ng-class="rc.getCollapsedCols()" class="svi-stock-income-statement-grid">\n\t\t\t<div data-svi-filter-dropdown \n\t\t\t\t class="form-inline"\n\t\t\t\t data-event-id="EVENTS.INCOME.STATEMENT"\n\t\t\t\t data-selected="{{currentGrid}}" \n\t\t\t\t data-title="{{labels.defaultGrid}}"\n\t\t\t\t data-label-text="{{labels.dropdownLabelText}}"\n\t\t\t\t data-aria-label="{{labels.defaultGrid}}" \n\t\t\t\t data-options="{{dropdownOptions}}"></div>\n\t\t\t<div class="row">\n\t\t\t\t<div class="col-md-12 col-sm-12 col-xs-12">\n\t\t\t\t\t<div data-ng-bind="labels.disclaimer" class="disclaimer"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="currentStocks" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header data-col-name="name" data-sortable="{{::sortable}}" data-text="labels.fiscalPeriod"></th>\n\t\t\t\t\t<th data-svi-column-header data-col-name="Y{{$index+1}}" data-sortable="{{::sortable}}" class="number" data-text="year" data-ng-repeat="year in currentHeader track by $index"></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat-start="(name, statements) in currentStocks" data-svi-rc-toggle-row="rc" data-toggle-row="{{statements.isHeader ? null : name}}">\n\t\t\t\t\t<td data-col-name="name" data-ng-bind="name" \n\t\t\t\t\t\tdata-ng-class="{\'income-header\': statements.isHeader, \'income-total\': statements.isBold}"></td>\n\t\t\t\t\t<td data-col-name="Y{{$index+1}}" class="number" data-ng-repeat="stocks in statements.data track by $index" data-ng-bind="stocks"\n\t\t\t\t\t\tdata-ng-class="{\'income-total\': statements.isBold}"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr data-ng-if="statements.isLast && !rc.rowExpanded(name)" class="empty-row"><td colspan="{{currentColspan}}"></td></tr>\n\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded(name)">\n\t\t\t\t\t<td colspan="{{currentColspan}}">\n\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(name)">\n\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>')}]),angular.module("stockKeyRatios/stockKeyRatios.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockKeyRatios/stockKeyRatios.tpl.html",'<div class="svi-directive svi-stock-key-ratios" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div data-ng-class="rc.getCollapsedCols()" class="svi-stock-key-ratios-grid" data-ng-if="ratiosHeader.length > 0">\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="ratios" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header data-col-name="name" data-sortable="{{::sortable}}" data-text="labels.ratios"></th>\n\t\t\t\t\t<th data-svi-column-header data-col-name="Y{{$index+1}}" data-sortable="{{::sortable}}" class="number" data-text="year" data-ng-repeat="year in ratiosHeader track by $index"></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat-start="(name, ratio) in ratios" data-svi-rc-toggle-row="rc" data-toggle-row="{{ratio.isHeader ? null : name}}">\n\t\t\t\t\t<td data-col-name="name" data-ng-bind="name" colspan="{{ratio.isHeader ? colspan : 1}}" data-ng-class="{\'ratio-header\': ratio.isHeader}"></td>\n\t\t\t\t\t<td data-col-name="Y{{$index+1}}" class="number" data-ng-repeat="item in ratio.data track by $index" data-ng-bind="item"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr data-ng-if="ratio.isLast && !rc.rowExpanded(name)" class="empty-row"><td colspan="{{colspan}}"></td></tr>\n\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded(name)">\n\t\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails(name)">\n\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>')}]),angular.module("stockOwnershipSummary/stockOwnershipSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockOwnershipSummary/stockOwnershipSummary.tpl.html",'<div class="svi-directive svi-stock-ownership-summary" data-title="labels.stocksOwnershipSummaryTitle"\n     data-include-loader="false">\n    <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n    <div class="loader" data-ignore-invisible="true" data-hidden="true" data-svi-loader data-callback="getDetailsLoader"></div>\n    <div class="row" data-ng-if="summary">\n        <div class="col-md-12">\n            <h3 data-ng-bind="labels.stocksOwnershipSummaryTitle"></h3>\n        </div>\n        <div class="col-md-12">\n            <div class="row">\n                <div class="col-md-3 col-xs-6">\n                    <div class="datapoint-box text-center">\n                        <div class="data-label" data-ng-bind="labels.sharesOutstanding"></div>\n                        <div class="vertical-aligned-values">\n                            <span class="data-value ng-binding"\n                                  data-ng-bind="summary.sharesOutstanding|sviNumber:2:true:true"></span>\n                        </div>\n                    </div>\n                </div>\n\n                <div class="col-md-3 col-xs-6">\n                    <div class="datapoint-box text-center">\n                        <div class="data-label" data-ng-bind="labels.marketCap"></div>\n                        <div class="vertical-aligned-values">\n                            <span class="data-value ng-binding"\n                                  data-ng-bind="data.marketCap * 1000000 | sviNumber:2:true:true"></span>\n                        </div>\n                    </div>\n                </div>\n\n                <div class="col-md-3 col-xs-6">\n                    <div class="datapoint-box text-center">\n                        <div class="data-label" data-ng-bind="labels.sharesHeld"></div>\n                        <span class="data-value ng-binding"\n                              data-ng-bind="summary.sharesHeldByStrategicInvestors | sviNumber:2:true:true"></span>\n                        <span class="parenChangePercent">\n\t\t\t\t\t\t\t\t<span class="data-value parenChangePercent"\n                                      ng-bind="summary.strategicEntitiesOwnPct | percent:2"></span>\n\t\t\t\t\t\t\t</span>\n                    </div>\n                </div>\n\n                <div class="col-md-3 col-xs-6">\n                    <div class="datapoint-box text-center">\n                        <div class="data-label" data-ng-bind="labels.freeFloat"></div>\n                        <span class="data-value ng-binding"\n                              data-ng-bind="summary.freeFloat | sviNumber:2:true:true"></span>\n                        <span class="parenChangePercent">\n\t\t\t\t\t\t\t\t<span class="data-value parenChangePercent"\n                                      ng-bind="summary.freeFloatPercent | percent:2"></span>\n\t\t\t\t\t\t\t</span>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>')}]),angular.module("stockOwnershipTopHolders/stockOwnershipTopHolders.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockOwnershipTopHolders/stockOwnershipTopHolders.tpl.html",'<div class="svi-directive svi-stock-ownership-top-holders" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\n\t<div data-ng-show="ownershipTopHolders.institutional" data-ng-class="rc.getCollapsedCols()" class="stocks-ownership-top-holders-grid">\n\t\t<h3 data-ng-bind="labels.topInstitutionalHolders"></h3>\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="ownershipTopHolders.institutional" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-svi-column-header data-col-name="holder" class="holder" data-sortable="{{::sortable}}" data-text="labels.holder"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="shares" class="number" data-sortable="{{::sortable}}" data-text="labels.shares"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="dateReported"  class="number" data-sortable="{{::sortable}}" data-text="labels.dateReported"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="out" class="number" data-sortable="{{::sortable}}" data-text="labels.out"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="changePct" class="number" data-sortable="{{::sortable}}" data-text="labels.changePct"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="portfolioPct" class="number" data-sortable="{{::sortable}}" data-text="labels.portfolioPct"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="turnoverPct" class="number" data-sortable="{{::sortable}}" data-text="labels.turnoverPct"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="value" class="number" data-sortable="{{::sortable}}" data-text="labels.value"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat-start="institutional in ownershipTopHolders.institutional" data-svi-rc-toggle-row="rc" data-toggle-row="{{$index}}">\n\t\t\t\t<td data-col-name="holder" class="holder" data-ng-bind="institutional.name"></td>\n\t\t\t\t<td data-col-name="shares" class="number" data-ng-bind="institutional.sharesHeld | sviNumber:0:true"></td>\n\t\t\t\t<td data-col-name="dateReported" class="number" data-ng-bind="institutional.holdingsDate | sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t<td data-col-name="out" class="number" data-ng-bind="institutional.pctOfSharesOutstanding | percent:2"></td>\n\t\t\t\t<td data-col-name="changePct" class="number" data-ng-bind="institutional.sharesHeldChangePct | percent:2"></td>\n\t\t\t\t<td data-col-name="portfolioPct" class="number" data-ng-bind="institutional.pctOfPortfolio | percent:2"></td>\n\t\t\t\t<td data-col-name="turnoverPct" class="number" data-ng-bind="institutional.turnoverPct | percent:2"></td>\n\t\t\t\t<td data-col-name="value" class="number" data-ng-bind="institutional.sharesHeldValue | sviNumber:0:true"></td>\n\t\t\t</tr>\n\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\n\t<div data-ng-show="ownershipTopHolders.fund" data-ng-class="rc.getCollapsedCols()" class="stocks-ownership-top-holders-grid">\n\t\t<h3 data-ng-bind="labels.topMutualFundHolders"></h3>\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="ownershipTopHolders.fund" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th data-svi-column-header data-col-name="holder" class="holder" data-sortable="{{::sortable}}" data-text="labels.holder"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="shares" class="number" data-sortable="{{::sortable}}" data-text="labels.shares"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="dateReported"  class="number" data-sortable="{{::sortable}}" data-text="labels.dateReported"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="out" class="number" data-sortable="{{::sortable}}" data-text="labels.out"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="changePct" class="number" data-sortable="{{::sortable}}" data-text="labels.changePct"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="portfolioPct" class="number" data-sortable="{{::sortable}}" data-text="labels.portfolioPct"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="turnoverPct" class="number" data-sortable="{{::sortable}}" data-text="labels.turnoverPct"></th>\n\t\t\t\t<th data-svi-column-header data-col-name="value" class="number" data-sortable="{{::sortable}}" data-text="labels.value"></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t<tr data-ng-repeat-start="institutional in ownershipTopHolders.fund" data-svi-rc-toggle-row="rc" data-toggle-row="{{$index}}">\n\t\t\t\t<td data-col-name="holder" class="holder" data-ng-bind="institutional.name"></td>\n\t\t\t\t<td data-col-name="shares" class="number" data-ng-bind="institutional.sharesHeld | sviNumber:0:true"></td>\n\t\t\t\t<td data-col-name="dateReported" class="number" data-ng-bind="institutional.holdingsDate | sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t<td data-col-name="out" class="number" data-ng-bind="institutional.pctOfSharesOutstanding | percent:2"></td>\n\t\t\t\t<td data-col-name="changePct" class="number" data-ng-bind="institutional.sharesHeldChangePct | percent:2"></td>\n\t\t\t\t<td data-col-name="portfolioPct" class="number" data-ng-bind="institutional.pctOfPortfolio | percent:2"></td>\n\t\t\t\t<td data-col-name="turnoverPct" class="number" data-ng-bind="institutional.turnoverPct | percent:2"></td>\n\t\t\t\t<td data-col-name="value" class="number" data-ng-bind="institutional.sharesHeldValue | sviNumber:0:true"></td>\n\t\t\t</tr>\n\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t<td colspan="{{colspan}}">\n\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t<td data-ng-bind-html="detail.value"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>')}]),angular.module("stockPeers/stockPeers.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockPeers/stockPeers.tpl.html",'<div class="svi-directive svi-stock-peers" data-svi-widget data-title="labels.stockPeersTitle" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item svi-stock-peers-grid" data-ng-class="rc.getCollapsedCols()" data-ng-if="header.length > 0">\n\t\t\t\t\t<div class="data-date">{{labels.asOf}} {{asOfDate|sviDate:"MM/dd/yyyy"}}</div>\n\t\t\t\t\t<div class="table-wrapper">\n\t\t\t\t\t\t<div class="table-scroller">\n\t\t\t\t\t\t\t<table class="table table-striped">\n\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class="symbol-col companies-items" data-ng-bind="labels.symbol"></th>\n\t\t\t\t\t\t\t\t\t<th class="companies-items" data-ng-repeat="symbol in header">\n\t\t\t\t\t\t\t\t\t\t<span data-svi-symbol data-symbol-string="{{symbol}}"></span>\n\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr data-ng-repeat="(name, companies) in companies track by $index">\n\t\t\t\t\t\t\t\t\t<td class="symbol-col companies-items" data-ng-bind="name"></td>\n\t\t\t\t\t\t\t\t\t<td class="companies-items" data-ng-repeat="item in companies track by $index" data-ng-bind="item"></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="peer-group-footer">\n\t\t\t\t\t\t<span class="peer-group">\n\t\t\t\t\t\t\t<span data-ng-bind-template="{{labels.peerGroup}}{{labels.colon}}"></span>\n\t\t\t\t\t\t\t<span data-ng-bind="peerGroup"></span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n\t<svi:widget-shortcuts>\n\t\t<span class="more-icon fas fa-expand-alt"\n\t\t\t  data-ng-click="displayModal()"\n\t\t\t  title="{{labels.compareAll}}"\n\t\t\t  role="button"\n\t\t\t  data-toggle="modal"\n\t\t\t  data-target="#stockPeersModal"\n\t\t\t  data-backdrop="false"\n\t\t\t  aria-label="{{labels.compareAll}}"\n\t\t\t  tabindex=\'-1\'></span>\n\t</svi:widget-shortcuts>\n</div>\n')}]),angular.module("stockPeers/stockPeersModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockPeers/stockPeersModal.tpl.html",'<div class="modal svi-directive svi-stock-peers" data-backdrop-limit="1" tabindex="-1" role="dialog" id="stockPeersModal" aria-labelledby="stockPeersModalTitle">\n\t<div class="modal-dialog modal-lg modal-dialog-centered" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 id="stockPeersModalTitle"\n\t\t\t\t\tclass="modal-title"\n\t\t\t\t\tdata-ng-bind-html="labels.modalTitle|ellipsis:60"></h1>\n\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer"\n\t\t\t\t\t data-ng-click="api.hide()"\n\t\t\t\t\t data-dismiss="modal"\n\t\t\t\t\t role="button"\n\t\t\t\t\t tabindex="0"\n\t\t\t\t\t aria-label="Close"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-body" id="stockPeersModalBody">\n\t\t\t\t<div class="table-wrapper">\n\t\t\t\t\t<table class="table table-striped">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class="companies-items" data-ng-bind="labels.symbol"></th>\n\t\t\t\t\t\t\t<th class="companies-items" data-ng-repeat="symbol in modalHeader">\n\t\t\t\t\t\t\t\t<span data-svi-symbol\n\t\t\t\t\t\t\t\t\t  data-container="false"\n\t\t\t\t\t\t\t\t\t  data-placement="bottom"\n\t\t\t\t\t\t\t\t\t  data-symbol-string="{{symbol}}"\n\t\t\t\t\t\t\t\t\t  data-manual-popover-position-update="false"></span>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr data-ng-repeat="(name, companies) in modalCompanies track by $index">\n\t\t\t\t\t\t\t<td class="companies-items" data-ng-bind="name"></td>\n\t\t\t\t\t\t\t<td class="companies-items" data-ng-repeat="item in companies track by $index" data-ng-bind="item"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="modal-footer">\n\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="btn btn-primary"\n\t\t\t\t\t\tdata-ng-click="api.hide()"\n\t\t\t\t\t\tdata-dismiss="modal"\n\t\t\t\t\t\tdata-ng-bind="labels.close"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("stockSplitsEventsTable/stockSplitsEventsTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockSplitsEventsTable/stockSplitsEventsTable.tpl.html",'<div class="svi-directive svi-stock-splits-events-table" data-include-loader="false">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div class="row paging-top" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n\t\t<div data-svi-paging-control\n\t\t\t class="col-md-12"\n\t\t\t data-event-id="{{::pageEventId}}"\n\t\t\t data-current-page="currentPage"\n\t\t\t data-total-pages="totalPages"></div>\n\t</div>\n\t<div class="svi-splits-events-grid" data-ng-if="companies.length > 0" data-ng-class="rc.getCollapsedCols()">\n\t\t<table data-svi-responsive-columns="responsiveColumnsSettings" class="table table-striped" data-ng-model="companies" data-float-thead="floatTheadOptions">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header\n\t\t\t\t\t\tdata-event-id="{{::api.eventName}}"\n\t\t\t\t\t\tdata-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="paymentDate"\n\t\t\t\t\t\tdata-text="labels.paymentDate"\n\t\t\t\t\t\tdata-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir"\n\t\t\t\t\t\tdata-col-name="paymentDate"></th>\n\t\t\t\t\t<th data-svi-column-header\n\t\t\t\t\t\tdata-event-id="{{::api.eventName}}"\n\t\t\t\t\t\tdata-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="company"\n\t\t\t\t\t\tdata-text="labels.company"\n\t\t\t\t\t\tdata-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir"\n\t\t\t\t\t\tdata-col-name="company"></th>\n\t\t\t\t\t<th data-svi-column-header\n\t\t\t\t\t\tdata-event-id="{{::api.eventName}}"\n\t\t\t\t\t\tdata-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="symbol"\n\t\t\t\t\t\tdata-text="labels.symbol"\n\t\t\t\t\t\tdata-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir"\n\t\t\t\t\t\tdata-col-name="symbol"></th>\n\t\t\t\t\t<th data-svi-column-header\n\t\t\t\t\t\tdata-event-id="{{::api.eventName}}"\n\t\t\t\t\t\tdata-sortable="false"\n\t\t\t\t\t\tdata-sort-field="ratio"\n\t\t\t\t\t\tclass="number"\n\t\t\t\t\t\tdata-text="labels.ratio"\n\t\t\t\t\t\tdata-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir"\n\t\t\t\t\t\tdata-col-name="ratio"></th>\n\t\t\t\t\t<th data-svi-column-header\n\t\t\t\t\t\tdata-event-id="{{::api.eventName}}"\n\t\t\t\t\t\tdata-sortable="false"\n\t\t\t\t\t\tdata-sort-field="announcementDate"\n\t\t\t\t\t\tdata-text="labels.announcementDate"\n\t\t\t\t\t\tdata-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir"\n\t\t\t\t\t\tdata-col-name="announcementDate"></th>\n\t\t\t\t\t<th data-svi-column-header\n\t\t\t\t\t    data-event-id="{{::api.eventName}}"\n\t\t\t\t\t    data-sortable="false"\n\t\t\t\t\t    data-text="labels.exDate"\n\t\t\t\t\t    data-sorted-field="sortField"\n\t\t\t\t\t    data-sorted-dir="sortDir"\n\t\t\t\t\t    data-col-name="exDate"></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat-start="item in companies" data-toggle-row="{{ ::$index }}" data-svi-rc-toggle-row="rc">\n\t\t\t\t\t<td data-col-name="paymentDate" data-ng-bind="item.paymentDate|sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t\t<td data-col-name="company" data-ng-bind="item.company"></td>\n\t\t\t\t\t<td data-col-name="symbol" data-svi-symbol data-symbol-string="{{::item.symbol}}"></td>\n\t\t\t\t\t<td data-col-name="ratio" class="number" data-ng-bind="item.ratio"></td>\n\t\t\t\t\t<td data-col-name="announcementDate" data-ng-bind="item.announcementDate|sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t\t<td data-col-name="exDate" data-ng-bind="item.exDate|sviDate:\'MM/dd/yyyy\'"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t\t<td colspan="5">\n\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t<td ng-bind-html="::detail.value"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n\t<div class="row paging-bottom" data-ng-show="pageSize" data-ng-if="companies.length > 0">\n\t\t<div data-svi-paging-control\n\t\t\t class="col-md-12"\n\t\t\t data-event-id="{{::pageEventId}}"\n\t\t\t data-current-page="currentPage"\n\t\t\t data-total-pages="totalPages"></div>\n\t</div>\n</div>')}]),angular.module("stockSymbolName/stockSymbolName.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("stockSymbolName/stockSymbolName.tpl.html",'<div class="svi-directive svi-symbol-name svi-stock-symbol-name" data-include-loader="false">\n    <div class="loader" data-svi-loader></div>\n    <div class="data-display" data-ng-show="data">\n        <span class="symbol-id" data-ng-bind="data.symbol | uppercase"></span>\n\t\t<span class="symbol-name-divider">|</span>\n        <span class="symbol-name" data-ng-bind="data.name"></span>\n        <div class="symbol-attributes">\n            <span class="badge label-empty-background symbol-outline-badge" ng-bind="data.sector"></span>\n            <span class="badge label-empty-background symbol-outline-badge" data-ng-bind="data.industry"></span>\n        </div>\n    </div>\n</div>\n')}]),angular.module("topFundHoldings/topFundHoldings.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topFundHoldings/topFundHoldings.tpl.html",'<div class="svi-directive svi-top-fund-holdings" data-svi-widget data-title="labels.topFundHoldingsTitle"\n     data-include-loader="false">\n    <svi:widget-front>\n        <div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item svi-top-fund-holdings-grid" data-ng-show="holdings">\n                    <table class="table table-striped" data-ng-model="holdings" data-ng-show="holdings">\n                        <thead>\n                        <tr>\n                            <th data-svi-column-header data-event-id="{{::api.eventName}}"\n                                data-sortable="{{::sortable}}" data-sort-field="desc"\n                                data-text="labels.topFundHoldingsCompanyName" data-sorted-field="sortField"\n                                data-sorted-dir="sortDir" data-col-name="desc"></th>\n                            <th data-svi-column-header data-event-id="{{::api.eventName}}"\n                                data-sortable="{{::sortable}}" data-sort-field="value" data-init-dir="asc"\n                                data-text="labels.topFundHoldingsNetAssets" data-sorted-field="sortField"\n                                data-sorted-dir="sortDir" data-col-name="value"></th>\n                        </tr>\n                        </thead>\n                        <tbody>\n                        <tr data-ng-repeat="holding in holdings" data-toggle-row="{{::$index }}">\n                            <td data-ng-bind-html="::holding.desc | ellipsis: 25:true" data-col-name="desc"></td>\n                            <td data-col-name="value">\n                                <div class="row">\n                                    <div class="col-xs-6">\n                                        <div class="top-fund-holdings-progress">\n                                            <div class="progress">\n                                                <div class="progress-bar"\n                                                     role="progressbar"\n                                                     aria-label="{{holding.symbol}}"\n                                                     aria-valuemin="0"\n                                                     aria-valuenow="{{holding.value}}"\n                                                     aria-valuemax="{{max}}"\n                                                     data-ng-style="{\'width\': holding.barWidth}"></div>\n                                            </div>\n                                        </div>\n                                    </div>\n                                    <div class="col-xs-2" data-ng-bind="::holding.value | percent : 1"></div>\n                                </div>\n                            </td>\n                        </tr>\n                        </tbody>\n                    </table>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n')}]),angular.module("topMoversContainer/topMoversContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topMoversContainer/topMoversContainer.tpl.html",'<div class="svi-directive svi-top-movers-container">\n\t<div data-svi-filter-dropdown\n\t\t data-event-id="MOVERS.DROPDOWN"\n\t\t data-state-id="MOVERS.DROPDOWN"\n\t\t data-options="{{exchangeDropdown}}"\n\t\t data-selected="{{exchange}}"\n\t\t data-label-text="{{labels.dropDownLabel}}"\n\t\t data-dropdown-class="dropdown-menu-right"\n\t\t data-ng-if="labels.dropDownLabel"\n\t\t class="form-inline"></div>\n\t<div data-svi-tabs data-arrows-enabled="false">\n\t\t<div class="item" data-tab-title="{{labels.actives}}" data-tab-id="actives">\n\t\t\t<div data-svi-top-movers-table \n\t\t\t\tdata-type="Active" \n\t\t\t\tdata-exchange="{{exchange}}"\n\t\t\t\tdata-limit="{{limit}}" \n\t\t\t\tdata-sort-field="quote.extendedQuote.volume" \n\t\t\t\tdata-sort-dir="desc"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="% {{labels.gainers}}" data-tab-id="gainers">\n\t\t\t<div data-svi-top-movers-table \n\t\t\t\tdata-type="Gainers" \n\t\t\t\tdata-exchange="{{exchange}}" \n\t\t\t\tdata-limit="{{limit}}" \n\t\t\t\tdata-sort-field="quote.pctChange" \n\t\t\t\tdata-sort-dir="desc"></div>\n\t\t</div>\n\t\t<div class="item" data-tab-title="% {{labels.losers}}" data-tab-id="losers">\n\t\t\t<div data-svi-top-movers-table \n\t\t\t\tdata-type="Losers" \n\t\t\t\tdata-exchange="{{exchange}}" \n\t\t\t\tdata-limit="{{limit}}" \n\t\t\t\tdata-sort-field="quote.pctChange" \n\t\t\t\tdata-sort-dir="asc"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("topMoversTable/topMoversTable.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("topMoversTable/topMoversTable.tpl.html",'<div class="svi-directive svi-top-movers-table">\n\t<div class="loader" data-svi-loader data-callback="api.setLoader"></div>\n\t<div class="svi-top-movers-grid" data-ng-class="rc.getCollapsedCols()" data-ng-if="quotes.length > 0">\n\t\t<div data-ng-if="asOfDate" class="as-of-date">{{labels.asOf}} {{asOfDate|sviDate:\'MM/dd/yyyy h:mm a \\\'ET\\\'\'}}</div>\n\t\t<table class="table table-striped" data-svi-responsive-columns="responsiveColumnsSettings" data-ng-model="quotes">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="instrument.symbol" data-text="labels.symbol" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="symbol"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.lastPrice" class="number" data-text="labels.lastPrice" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="lastPrice"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.change" class="number" data-text="labels.change" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="change"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.pctChange" class="number" data-text="labels.pctChange" data-sorted-field="sortField"\n\t\t\t\t\t\tdata-sorted-dir="sortDir" data-col-name="pctChange"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.extendedQuote.volume" class="number" data-text="labels.volume"\n\t\t\t\t\t\tdata-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="volume"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.extendedQuote.volume50dMA" class="number" data-text="labels.avgVol"\n\t\t\t\t\t\tdata-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="avgVol"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.extendedQuote.earningsPerShare" class="number" data-text="labels.eps"\n\t\t\t\t\t\tdata-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="eps"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.extendedQuote.priceEarningsRatio" class="number" data-text="labels.peRatio"\n\t\t\t\t\t\tdata-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="peRatio"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.extendedQuote.low52Price" class="number" data-text="labels.weekRange"\n\t\t\t\t\t\tdata-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="weekRange"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="{{::api.eventName}}" data-sortable="{{::sortable}}"\n\t\t\t\t\t\tdata-sort-field="quote.extendedQuote.dividendData.yield" class="number" data-text="labels.yield"\n\t\t\t\t\t\tdata-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="yield"></th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat-start="quote in quotes" data-toggle-row="{{$index}}" data-svi-rc-toggle-row="rc">\n\t\t\t\t\t<td data-col-name="symbol" data-svi-symbol data-symbol-string="{{::quote.instrument.symbol}}"></td>\n\t\t\t\t\t<td data-col-name="lastPrice" class="number" data-ng-bind="quote.quote.lastPrice|sviNumber:2:true:true"></td>\n\t\t\t\t\t<td data-col-name="change" class="number" data-ng-class="{positive: quote.quote.change > 0, negative: quote.quote.change < 0}"\n\t\t\t\t\t\tdata-ng-bind="quote.quote.change|sviNumber:2:true:false"></td>\n\t\t\t\t\t<td data-col-name="pctChange" class="number" data-ng-class="{positive: quote.quote.pctChange > 0, negative: quote.quote.pctChange < 0}"\n\t\t\t\t\t\tdata-ng-bind="quote.quote.pctChange|sviNumber:2:true:false"></td>\n\t\t\t\t\t<td data-col-name="volume" class="number" data-ng-bind="quote.quote.extendedQuote.volume|sviNumber:2:true:true"></td>\n\t\t\t\t\t<td data-col-name="avgVol" class="number" data-ng-bind="quote.quote.extendedQuote.volume50dMA|sviNumber:2:true:true"></td>\n\t\t\t\t\t<td data-col-name="eps" class="number" data-ng-bind="quote.quote.extendedQuote.earningsPerShare|sviNumber:2:true:false"></td>\n\t\t\t\t\t<td data-col-name="peRatio" class="number" data-ng-bind="quote.quote.extendedQuote.priceEarningsRatio|sviNumber:2:true:false"></td>\n\t\t\t\t\t<td data-col-name="weekRange" class="number">\n\t\t\t\t\t\t<span data-ng-bind="quote.quote.extendedQuote.low52Price|sviNumber:2:true:false"></span>\n\t\t\t\t\t\t-\n\t\t\t\t\t\t<span data-ng-bind="quote.quote.extendedQuote.high52Price|sviNumber:2:true:false"></span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td data-col-name="yield" class="number" data-ng-bind="quote.quote.extendedQuote.dividendData.yield|sviNumber:2:true:false"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class="hide"><td>&nbsp;</td></tr>\n\t\t\t\t<tr data-ng-repeat-end class="detail" data-ng-show="rc.rowExpanded($index)">\n\t\t\t\t\t<td colspan="5">\n\t\t\t\t\t\t<table class="table svi-detail-table">\n\t\t\t\t\t\t\t<tr data-ng-repeat="detail in rc.getRowDetails($index)">\n\t\t\t\t\t\t\t\t<th ng-bind="::detail.label"></th>\n\t\t\t\t\t\t\t\t<td ng-bind-html="::detail.value"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>')}]),angular.module("templates-symbol",["advancedSymbolChart/advancedSymbolChart.tpl.html","advancedSymbolChart/advancedSymbolChartModal.tpl.html","advancedSymbolChart/advancedSymbolChartPopover.tpl.html","advancedSymbolChart/advancedSymbolChartWrapper.tpl.html","advancedSymbolChart/advancedSymbolWidget.tpl.html","detailedQuote/ariaLiveQuote.tpl.html","detailedQuote/detailedQuote.tpl.html","detailedQuote/detailedWidgetQuote.tpl.html","detailedQuote/mutualFundAAGQuote.tpl.html","detailedQuote/newPopoverQuote.tpl.html","detailedQuote/popoverQuote.tpl.html","detailedQuote/stockAAGQuote.tpl.html","detailedQuote/tradePageQuote.tpl.html","detailedQuote/tradeWidgetQuote.tpl.html","priceHistoryChart/priceHistoryChart.tpl.html","priceHistoryChart/priceHistoryWidget.tpl.html","snapQuote/popover.tpl.html","snapQuote/snapQuote.tpl.html","sparklineChart/sparklineChart.tpl.html","symbolLookup/popover.tpl.html","symbolLookup/symbolLookup.tpl.html","symbolLookupGrid/symbolLookupGrid.tpl.html","symbolNews/symbolNews.tpl.html","symbolNews/symbolNewsContent.tpl.html","symbolNews/symbolNewsModal.tpl.html","symbolNews/symbolNewsTwoColumns.tpl.html","symbolNews/symbolNewsWidget.tpl.html","symbolOrderStatus/symbolOrderStatus.tpl.html","symbolOrderStatus/symbolOrderStatusWidget.tpl.html","watchlist/deleteWatchlistPopover.tpl.html","watchlist/watchlist.tpl.html"]),angular.module("advancedSymbolChart/advancedSymbolChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("advancedSymbolChart/advancedSymbolChart.tpl.html",'<div class="svi-directive svi-price-history-chart svi-advanced-symbol-chart" id="{{::id}}">\n    <h3 class="title" data-ng-bind="labels.priceHistoryChartTitle" data-ng-show="showTitle"></h3>\n    <div data-svi-loader data-callback="setLoader" class="loader-floating"\n         data-ignore-invisible="true"></div>\n    <div class="loader" data-ignore-invisible="true" data-hidden="true" data-svi-loader data-callback="getPriceInfoLoader"></div>\n    <h4 class="symbol" data-ng-bind="symbol" data-ng-show="showSymbol"></h4>\n    %CHART_WRAPPER%\n    <div data-ng-if="showDisclaimer" class="disclaimer">\n        <span data-ng-bind="labels.disclaimer"></span>: {{symbol}}\n    </div>\n</div>')}]),angular.module("advancedSymbolChart/advancedSymbolChartModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("advancedSymbolChart/advancedSymbolChartModal.tpl.html",'<div class="svi-directive modal svi-advanced-chart-modal" data-backdrop-limit="1" tabindex="-1" role="dialog"\n     id="advanced-chart-indicators-modal">\n    <div class="modal-dialog" role="document">\n        <div class="modal-content">\n            <div class="modal-header">\n                <div class="indicator-tools-wrapper">\n                    <div class="indicator-tools row">\n                        <div class="indicator-tools-item center-block indicator-search">\n                            <span data-ng-bind="labels.indicatorLookup" class="hidden-xs"></span>\n                            <input type="text"\n                                   placeholder="{{labels.indicatorSearch}}"\n                                   data-ng-model="indicatorLookup"\n                                   class="indicator-lookup">\n                        </div>\n\n                        <div class="center-block indicator-tools-item">\n                            <div class="dropdown" role="presentation">\n                                <button class="btn btn-default dropdown-toggle highcharts-menu-item indicators-filter-dropdown"\n                                        type="button"\n                                        id="chart-type-button"\n                                        data-toggle="dropdown"\n                                        aria-haspopup="true"\n                                        aria-expanded="true"\n                                >\n                                    <span data-ng-bind="indicatorLookupOption.display"></span>\n                                    <span class="caret"></span>\n                                </button>\n                                <ul class="dropdown-menu dropdown-menu-left chart-type-dropdown">\n                                    <li data-ng-repeat="option in config.indicatorTypes">\n                                        <a href=""\n                                           class="highcharts-menu-item dropdown-item indicator-dropdown-{{option.value}}"\n                                           data-ng-click="api.filterIndicators(option)"\n                                        >\n                                        <span data-ng-bind="option.display"\n                                              class="highcharts-menu-item-title"></span>\n                                        </a>\n                                    </li>\n                                </ul>\n                            </div>\n                        </div>\n                        <div class="center-block indicator-tools-item">\n                            <button class="btn btn-default indicators-clear-button" type="button"\n                                    data-ng-click="api.clearIndicators()">\n                                {{labels.clearIndicators}}\n                                <span class="badge btn-primary" data-ng-bind="addedIndicators.length"></span>\n                            </button>\n                        </div>\n                    </div>\n                    <div class="help-message"><span>Add up to 5 indicators</span></div>\n                </div>\n            </div>\n\n            <div class="modal-body" id="advanced-chart-indicators-modal-body">\n                <div class="highcharts-popup-indicators">\n                    <div class="indicators-list">\n                        <table class="table">\n                            <thead>\n                            <tr>\n                                <th ng-click="indicatorsOrder =\'name\'; indicatorsOrderReverse = !indicatorsOrderReverse">\n                                    <span data-ng-bind="labels.indicatorsTableHeader"></span>\n                                    <span class="pad-left-10 sort-icon fas fa-sort-amount-down-alt"\n                                          data-ng-class="{\'fas fa-sort-amount-down-alt\' : !indicatorsOrderReverse, \'fas fa-sort-amount-up\' : indicatorsOrderReverse }"></span>\n                                </th>\n                                <th data-ng-bind="labels.indicatorsActionHeader"></th>\n                                <th data-ng-bind="labels.indicatorsBookmarkHeader"></th>\n                            </tr>\n                            </thead>\n                            <tbody>\n                            <tr data-ng-repeat="indicator in indicatorsList | filter: api.investmentTypeFilter | filter: api.indicatorsFilter(indicatorLookup) | orderBy: indicatorsOrder : indicatorsOrderReverse">\n                                <td class="indicators-name-column col-sm-7">\n                                    <span data-ng-bind="indicator.name"></span>\n                                    <span data-ng-if="indicator.fullName">{{\'(\' + indicator.fullName + \')\'}}</span>\n                                </td>\n                                <td class="indicators-action-column col-sm-3"\n                                    data-ng-class="\'indicator-button-\' + indicator.type">\n                                    <button\n                                            class="btn"\n                                            data-ng-bind="indicator.added ? \'Remove\' : \'Add\'"\n                                            data-ng-click="api.toggleCurrentIndicator(indicator)"\n                                            data-ng-class="{\'btn-default\': indicator.added,\n                                \'btn-primary\': !indicator.added,\n                                \'disabled\': addedIndicators.length > 4 && !indicator.added}"\n                                    ></button>\n                                </td>\n                                <td class="indicators-bookmark-column col-sm-2"\n                                    data-ng-class="\'indicator-bookmark-\' + indicator.type">\n                                    <i class="fa "\n                                       data-ng-click="indicator.bookmark = !indicator.bookmark"\n                                       aria-label="bookmark"\n                                       data-ng-class="{\'fa-bookmark\': indicator.bookmark, \'fa-bookmark-o\': !indicator.bookmark}"\n                                    ></i>\n                                </td>\n                            </tr>\n                            </tbody>\n                        </table>\n                    </div>\n                </div>\n            </div>\n\n            <div class="modal-footer">\n                <button type="button" class="btn btn-primary close-modal"\n                        data-dismiss="modal"\n                        data-ng-click="api.hideModal()"\n                        data-ng-bind="labels.close"></button>\n            </div>\n        </div>\n    </div>\n</div>\n\n\n\n\n')}]),angular.module("advancedSymbolChart/advancedSymbolChartPopover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("advancedSymbolChart/advancedSymbolChartPopover.tpl.html",'<div class="highcharts-popup-indicators indicators-popover popover" id="{{::id}}">\n    <div class="arrow"></div>\n    <div class="popover-content panel panel-default ">\n        <div class="indicator-tools-wrapper">\n            <div class="indicator-tools">\n                <div class="indicator-tools-item center-block">\n                    <label data-ng-bind="labels.indicatorLookup" class="hidden-xs"></label>\n                    <input type="text"\n                           placeholder="{{labels.indicatorSearch}}"\n                           data-ng-model="indicatorLookup"\n                           class="indicator-lookup">\n                </div>\n                <div class="center-block indicator-tools-item">\n                    <select class="btn btn-default indicators-filter-select"\n                            data-ng-model="indicatorLookupOption"\n                            data-ng-change="api.filterIndicators(indicatorLookupOption)">\n                        <option data-ng-repeat="option in config.indicatorTypes" value="{{option.value}}"\n                                data-ng-bind="option.display"></option>\n                    </select>\n                </div>\n                <div class="center-block indicator-tools-item">\n                    <button class="btn btn-default indicators-clear-button" type="button"\n                            data-ng-click="api.clearIndicators()">\n                        {{labels.clearIndicators}}\n                        <span class="badge btn-primary" data-ng-bind="addedIndicators.length"></span>\n                    </button>\n                </div>\n            </div>\n            <div class="help-message"><span>Add up to 5 indicators</span></div>\n        </div>\n\n        <div class="indicators-list">\n            <table class="table">\n                <thead>\n                <tr>\n                    <th ng-click="indicatorsOrder =\'name\'; indicatorsOrderReverse = !indicatorsOrderReverse">\n                        <span data-ng-bind="labels.indicatorsTableHeader"></span>\n                        <span class="pad-left-10 sort-icon glyphicon glyphicon-chevron-down"\n                              data-ng-class="{\'glyphicon-chevron-down\' : !indicatorsOrderReverse, \'glyphicon-chevron-up\' : indicatorsOrderReverse }"></span>\n                    </th>\n                    <th data-ng-bind="labels.indicatorsActionHeader"></th>\n                    <th data-ng-bind="labels.indicatorsBookmarkHeader"></th>\n                </tr>\n                </thead>\n                <tbody>\n                <tr data-ng-repeat="indicator in indicatorsList | filter: api.investmentTypeFilter | filter: indicatorLookup | orderBy: indicatorsOrder : indicatorsOrderReverse">\n                    <td class="indicators-name-column col-sm-7">\n                        <span data-ng-bind="indicator.name"></span>\n                        <span data-ng-if="indicator.fullName">{{\'(\' + indicator.fullName + \')\'}}</span>\n                    </td>\n                    <td class="indicators-action-column col-sm-3" data-ng-class="\'indicator-button-\' + indicator.type">\n                        <button\n                                class="btn"\n                                data-ng-bind="indicator.added ? \'Remove\' : \'Add\'"\n                                data-ng-click="api.toggleCurrentIndicator(indicator)"\n                                data-ng-class="{\'btn-default\': indicator.added,\n                                \'btn-primary\': !indicator.added,\n                                \'disabled\': addedIndicators.length > 4 && !indicator.added}"\n                        ></button>\n                    </td>\n                    <td class="indicators-bookmark-column col-sm-2" data-ng-class="\'indicator-bookmark-\' + indicator.type">\n                        <i class="fa "\n                           data-ng-click="indicator.bookmark = !indicator.bookmark"\n                           aria-label="bookmark"\n                           data-ng-class="{\'fa-bookmark\': indicator.bookmark, \'fa-bookmark-o\': !indicator.bookmark}"\n                        ></i>\n                    </td>\n                </tr>\n                </tbody>\n            </table>\n        </div>\n\n    </div>\n    <a class="svi-visually-hidden" data-svi-skip-link="#{{::parentId}} .tt-input" data-callback="api.hidePopover"></a>\n</div>')}]),angular.module("advancedSymbolChart/advancedSymbolChartWrapper.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("advancedSymbolChart/advancedSymbolChartWrapper.tpl.html",'<div class="chart-wrapper advanced-chart-wrapper" xmlns="http://www.w3.org/1999/html">\n\t<div data-ng-class="[toolsContainerClass]" class="tools-container">\n\t\t<div class="row">\n\t\t\t<ul class="nav nav-pills col-sm-10" role="tablist">\n\t\t\t\t<li role="none" id="comparisonChartTab">\n\t\t\t\t\t<a href="#comparisonChart"\n\t\t\t\t\t   data-toggle="tab"\n\t\t\t\t\t   role="tab"\n\t\t\t\t\t   aria-controls="comparisonChart"\n\t\t\t\t\t   data-ng-click="api.clearIndicators(); api.changeActiveTab(\'comparison\')"\n\t\t\t\t\t   data-ng-bind="labels.comparison"\n\t\t\t\t\t></a>\n\t\t\t\t</li>\n\t\t\t\t<li role="none" data-ng-if="!fundGrowthEnabled">\n\t\t\t\t\t<a href="#indicators"\n\t\t\t\t\t   class="highcharts-indicators-popover"\n\t\t\t\t\t   data-toggle="tab"\n\t\t\t\t\t   role="tab"\n\t\t\t\t\t   data-ng-click="api.displayModal(); api.clearBenchmarks(); api.changeActiveTab(\'indicators\')"\n\t\t\t\t\t   data-ng-bind="labels.indicators"\n\t\t\t\t\t></a>\n\t\t\t\t</li>\n\t\t\t\t<li role="none"\n\t\t\t\t    class="disabled"\n\t\t\t\t    data-ng-if="fundGrowthEnabled"\n\t\t\t\t    data-trigger="hover focus"\n\t\t\t\t    data-container=".svi-bs"\n\t\t\t\t    data-bs-tooltip\n\t\t\t\t    data-title="{{labels.disabledIndicatorGrowth}}"\n\t\t\t\t>\n\t\t\t\t\t<a href="#indicators"\n\t\t\t\t\t   class="highcharts-indicators-popover disabled"\n\t\t\t\t\t   data-toggle="tab"\n\t\t\t\t\t   role="tab"\n\t\t\t\t\t   data-ng-bind="labels.indicators"\n\t\t\t\t\t></a>\n\t\t\t\t</li>\n\t\t\t\t<li role="none" id="chartSettingsTab">\n\t\t\t\t\t<a href="#chartSettings"\n\t\t\t\t\t   class="chart-settings-tab"\n\t\t\t\t\t   data-toggle="tab"\n\t\t\t\t\t   role="tab"\n\t\t\t\t\t   aria-controls="comparisonChart"\n\t\t\t\t\t   data-ng-click="api.changeActiveTab(\'chartSettings\')"\n\t\t\t\t\t   data-ng-bind="labels.settings"\n\t\t\t\t\t></a>\n\t\t\t\t</li>\n\t\t\t\t<li role="none">\n\t\t\t\t\t<a href="#drawAnnotations"\n\t\t\t\t\t   class="chart-annotations-tab"\n\t\t\t\t\t   data-toggle="tab"\n\t\t\t\t\t   role="tab"\n\t\t\t\t\t   aria-controls="drawAnnotations"\n\t\t\t\t\t   data-ng-click="api.changeActiveTab(\'drawAnnotations\')"\n\t\t\t\t\t   data-ng-bind="labels.draw"\n\t\t\t\t\t></a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<div class="col-sm-2 text-center">\n\t\t\t\t<button class="btn btn-default reset-chart-button" type="button"\n\t\t\t\t        data-ng-click="api.clearChart()">\n\t\t\t\t\t{{labels.clearFilter}}\n\t\t\t\t\t<span class="badge btn-primary">{{symbols.length + chart.annotations.length + addedIndicators.length}}</span>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="tab-content">\n\t\t\t\t<div class="tab-pane" id="comparisonChart">\n\t\t\t\t\t<div class="tools-wrapper">\n\t\t\t\t\t\t<div class="tools-item" data-ng-if="!fundGrowthEnabled">\n\t\t\t\t\t\t\t<div class="labels-wrapper">\n\t\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t\t<label data-ng-if="config.djiaEnabled">\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox" name="{{config.indexes.DJIA.symbol}}"\n\t\t\t\t\t\t\t\t\t\t       ng-disabled="symbols.length > 4 && !indexes.DJIA"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="indexes.DJIA"\n\t\t\t\t\t\t\t\t\t\t       data-ng-change="api.checkBoxClick(config.indexes.DJIA, indexes.DJIA)">\n\t\t\t\t\t\t\t\t\t\t{{labels.dow}}\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<label><input type="checkbox" name="{{config.indexes.NASDAQ.symbol}}"\n\t\t\t\t\t\t\t\t\t              ng-disabled="symbols.length > 4 && !indexes.NASDAQ"\n\t\t\t\t\t\t\t\t\t              data-ng-model="indexes.NASDAQ"\n\t\t\t\t\t\t\t\t\t              data-ng-change="api.checkBoxClick(config.indexes.NASDAQ, indexes.NASDAQ)">\n\t\t\t\t\t\t\t\t\t\t{{labels.nasdaq}}\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<label><input type="checkbox" data-ng-model="indexes.SPX"\n\t\t\t\t\t\t\t\t\t              ng-disabled="symbols.length > 4 && !indexes.SPX"\n\t\t\t\t\t\t\t\t\t              name="{{config.indexes.SPX.symbol}}"\n\t\t\t\t\t\t\t\t\t              data-ng-change="api.checkBoxClick(config.indexes.SPX, indexes.SPX)">\n\t\t\t\t\t\t\t\t\t\t{{labels.snp}}\n\t\t\t\t\t\t\t\t\t</label></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="tools-item" data-ng-show="fundGrowthEnabled && benchmarks.length">\n\t\t\t\t\t\t\t<div class="labels-wrapper">\n\t\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t\t<label style="margin-right: 20px;">\n\t\t\t\t\t\t\t\t\t\t{{labels.benchmarks}}\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="includeBenchmarks"\n\t\t\t\t\t\t\t\t\t\t       data-ng-disabled="symbols.length + benchmarks.length > 5 && !includeBenchmarks">\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="tools-item" data-ng-if="fundGrowthEnabled && benchmarks.length === 0">\n\t\t\t\t\t\t\t<div class="labels-wrapper">\n\t\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t\t<label style="margin-right: 20px;">\n\t\t\t\t\t\t\t\t\t\t{{labels.noBenchmarks}}\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="tools-item large-size">\n\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t<div data-svi-input-symbol\n\t\t\t\t\t\t\t\t     data-ng-if="labels.addSymbolPlaceholder"\n\t\t\t\t\t\t\t\t     data-osi="false"\n\t\t\t\t\t\t\t\t     data-only-valid="true"\n\t\t\t\t\t\t\t\t     data-comm="inputSymbolComm"\n\t\t\t\t\t\t\t\t     data-enable-lookup="false"\n\t\t\t\t\t\t\t\t     data-debounce-delay="0"\n\t\t\t\t\t\t\t\t     data-manual-submit="true"\n\t\t\t\t\t\t\t\t     data-clear-on-submit="true"\n\t\t\t\t\t\t\t\t     data-submit-message="{{labels.addSymbolMessage}}"\n\t\t\t\t\t\t\t\t     data-event-name="SYMBOL.CONTEXT.ADDED"\n\t\t\t\t\t\t\t\t     data-autocomplete-event-name="SYMBOL.CONTEXT.ADDED"\n\t\t\t\t\t\t\t\t     data-investment-type="{{investmentType}}"\n\t\t\t\t\t\t\t\t     data-placeholder="{{labels.addSymbolPlaceholder}}">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="tab-pane" id="indicators"></div>\n\t\t\t\t<div class="tab-pane" id="drawAnnotations">\n\t\t\t\t\t<div class="tools-wrapper">\n\t\t\t\t\t\t<div class="col-sm-10 tools-item">\n\t\t\t\t\t\t\t<div class="dropdown-wrapper">\n\t\t\t\t\t\t\t\t<ul class="item-body" role="tablist">\n\t\t\t\t\t\t\t\t\t<li role="presentation" data-ng-repeat="item in drawAnnotations"\n\t\t\t\t\t\t\t\t\t    class="dropdown-toggle-item">\n\t\t\t\t\t\t\t\t\t\t<div class="dropdown">\n\t\t\t\t\t\t\t\t\t\t\t<button class="btn btn-default dropdown-toggle highcharts-menu-item"\n\t\t\t\t\t\t\t\t\t\t\t        type="button"\n\t\t\t\t\t\t\t\t\t\t\t        id="annotation-type-{{::item.type}}"\n\t\t\t\t\t\t\t\t\t\t\t        data-toggle="dropdown"\n\t\t\t\t\t\t\t\t\t\t\t        aria-haspopup="true"\n\t\t\t\t\t\t\t\t\t\t\t        aria-expanded="true">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon visible-md visible-lg"\n\t\t\t\t\t\t\t\t\t\t\t\t      data-ng-style="{\'background-image\': \'url(\' + item.items[0].icon + \')\'}"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon hidden-on-large"\n\t\t\t\t\t\t\t\t\t\t\t\t      data-ng-attr-style="{{ \'background-image: url(\' + item.items[0].icon + \')!important\' }}"\n\t\t\t\t\t\t\t\t\t\t\t\t      data-trigger="hover"\n\t\t\t\t\t\t\t\t\t\t\t\t      data-auto-close="1"\n\t\t\t\t\t\t\t\t\t\t\t\t      data-container=".svi-bs"\n\t\t\t\t\t\t\t\t\t\t\t\t      data-placement="bottom"\n\t\t\t\t\t\t\t\t\t\t\t\t      data-bs-popover\n\t\t\t\t\t\t\t\t\t\t\t\t      data-content="{{item.type}}"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="item.type" class="visible-md visible-lg"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t<ul class="dropdown-menu">\n\t\t\t\t\t\t\t\t\t\t\t\t<li data-ng-repeat="annotation in item.items">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=""\n\t\t\t\t\t\t\t\t\t\t\t\t\t   data-ng-class="annotation.className"\n\t\t\t\t\t\t\t\t\t\t\t\t\t   class="highcharts-menu-item">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon visible-md visible-lg"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-ng-style="{\'background-image\': \'url(\' + annotation.icon + \')\'}"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon hidden-on-large"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-ng-attr-style="{{ \'background-image: url(\' + item.items[0].icon + \')!important\' }}"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-trigger="hover"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-auto-close="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-container=".svi-bs"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-placement="bottom"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-bs-popover\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-content="{{annotation.name}}"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="annotation.name"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      class="highcharts-menu-item-title visible-md visible-lg"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-sm-2 tools-item">\n\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t<button class="btn btn-default highcharts-menu-item" type="button"\n\t\t\t\t\t\t\t\t        data-ng-click="api.clearDrawAnnotations()">\n\t\t\t\t\t\t\t\t\t{{labels.clearDraw}}\n\t\t\t\t\t\t\t\t\t<span class="badge btn-primary">{{chart.annotations.length}}</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="tab-pane" id="chartSettings">\n\t\t\t\t\t<div class="tools-wrapper">\n\t\t\t\t\t\t<div class="col-sm-2 tools-item ">\n\t\t\t\t\t\t\t<div class="labels-wrapper">\n\t\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t\t<label>{{labels.chartTypesLabel}}</label>\n\t\t\t\t\t\t\t\t\t<div class="dropdown" role="presentation">\n\t\t\t\t\t\t\t\t\t\t<button class="btn btn-default dropdown-toggle highcharts-menu-item"\n\t\t\t\t\t\t\t\t\t\t        type="button"\n\t\t\t\t\t\t\t\t\t\t        id="chart-type-button"\n\t\t\t\t\t\t\t\t\t\t        data-toggle="dropdown"\n\t\t\t\t\t\t\t\t\t\t        aria-haspopup="true"\n\t\t\t\t\t\t\t\t\t\t        aria-expanded="true">\n\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon"\n\t\t\t\t\t\t\t\t\t\t\t      data-ng-style="{\'background-image\': \'url(\' + selectedChartType.icon + \')\'}"></span>\n\t\t\t\t\t\t\t\t\t\t\t{{selectedChartType.display}}\n\t\t\t\t\t\t\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<ul class="dropdown-menu dropdown-menu-left chart-type-dropdown">\n\t\t\t\t\t\t\t\t\t\t\t<li data-ng-repeat="type in config.chartTypes | filter: api.investmentTypeFilter">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=""\n\t\t\t\t\t\t\t\t\t\t\t\t   class="highcharts-menu-item dropdown-item"\n\t\t\t\t\t\t\t\t\t\t\t\t   data-ng-click="api.changeChartType(type.value)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon"\n\t\t\t\t\t\t\t\t\t\t\t\t\t      data-ng-style="{\'background-image\': \'url(\' + type.icon + \')\'}"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="type.display"\n\t\t\t\t\t\t\t\t\t\t\t\t\t      class="highcharts-menu-item-title"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-sm-7 tools-item ">\n\t\t\t\t\t\t\t<div class="label-wrapper">\n\t\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t\t<label data-ng-bind="labels.settingsShowHide"></label>\n\t\t\t\t\t\t\t\t\t<label class="font-weight-normal" data-ng-show="!(investmentType === \'MutualFund\')">\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t\t\t       data-ng-disabled="volumeChartCheckboxDisabled"\n\t\t\t\t\t\t\t\t\t\t       class="show-volume-checkbox"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="showVolume">\n\t\t\t\t\t\t\t\t\t\t{{labels.settingsVolumeChart}}</label>\n\t\t\t\t\t\t\t\t\t<label class="font-weight-normal">\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t\t\t       data-ng-disabled="currentPriceIndicatorCheckboxDisabled"\n\t\t\t\t\t\t\t\t\t\t       class="show-current-price-indicator-checkbox"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="currentPriceIndicatorEnabled">\n\t\t\t\t\t\t\t\t\t\t{{labels.settingsCurrentPriceIndicator}}</label>\n\t\t\t\t\t\t\t\t\t<label class="font-weight-normal"\n\t\t\t\t\t\t\t\t\t       data-ng-show="investmentType === \'MutualFund\' || investmentSubType === \'ETF\'">\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t\t\t       class="toggle-fund-growth-checkbox"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="fundGrowthEnabled">\n\t\t\t\t\t\t\t\t\t\t{{labels.fundGrowth}}</label>\n\t\t\t\t\t\t\t\t\t<label class="font-weight-normal" data-ng-show="showActiveMarketHoursToggler">\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t\t\t       class="show-after-market-activity-checkbox"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="showAfterMarketActivity">\n\t\t\t\t\t\t\t\t\t\t{{labels.afterMarketTradingActivity}}\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-sm-3 tools-item">\n\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t<label>{{labels.settingsView}}</label>\n\t\t\t\t\t\t\t\t<ul class="item-body" role="tablist">\n\t\t\t\t\t\t\t\t\t<li role="presentation" data-ng-repeat="item in chartSettings"\n\t\t\t\t\t\t\t\t\t    class="dropdown-toggle-item">\n\t\t\t\t\t\t\t\t\t\t<div class="dropdown">\n\t\t\t\t\t\t\t\t\t\t\t<button class="btn btn-default dropdown-toggle highcharts-menu-item settings-dropdown"\n\t\t\t\t\t\t\t\t\t\t\t        type="button"\n\t\t\t\t\t\t\t\t\t\t\t        role="tab"\n\t\t\t\t\t\t\t\t\t\t\t        id="settings-type-{{::item.type}}"\n\t\t\t\t\t\t\t\t\t\t\t        data-toggle="dropdown"\n\t\t\t\t\t\t\t\t\t\t\t        aria-haspopup="true"\n\t\t\t\t\t\t\t\t\t\t\t        aria-expanded="true">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon"\n\t\t\t\t\t\t\t\t\t\t\t\t      data-ng-style="{\'background-image\': \'url(\' + item.items[0].icon + \')\'}"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="item.type"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t<ul class="dropdown-menu dropdown-menu-left">\n\t\t\t\t\t\t\t\t\t\t\t\t<li data-ng-repeat="setting in item.items">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=""\n\t\t\t\t\t\t\t\t\t\t\t\t\t   data-ng-class="setting.className"\n\t\t\t\t\t\t\t\t\t\t\t\t\t   class="highcharts-menu-item dropdown-item">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      data-ng-style="{\'background-image\': \'url(\' + setting.icon + \')\'}"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span data-ng-bind="setting.name"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t      class="highcharts-menu-item-title"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li role="presentation">\n\t\t\t\t\t\t\t\t\t\t<div class="btn btn-default dropdown-toggle highcharts-full-screen highcharts-menu-item">\n\t\t\t\t\t\t\t\t\t\t\t<span class="highcharts-menu-item-icon"\n\t\t\t\t\t\t\t\t\t\t\t      style="background-image: url(\'https://code.highcharts.com/gfx/stock-icons/fullscreen.svg\')"></span>\n\t\t\t\t\t\t\t\t\t\t\t{{labels.settingsFullScreen}}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="tab-pane" id="events">\n\t\t\t\t\t<div class="tools-wrapper">\n\t\t\t\t\t\t<div class="tools-item">\n\t\t\t\t\t\t\t<div class="labels-wrapper">\n\t\t\t\t\t\t\t\t<div class="item-body">\n\t\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t\t\t       name="labels.dividends"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="events.dividends"\n\t\t\t\t\t\t\t\t\t\t       data-ng-disabled="shouldLoadEvents">\n\t\t\t\t\t\t\t\t\t\t{{labels.dividends}}\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t\t\t       name="labels.splits.name"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="events.splits"\n\t\t\t\t\t\t\t\t\t\t       data-ng-disabled="shouldLoadEvents">\n\t\t\t\t\t\t\t\t\t\t{{labels.splits}}\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<label style="margin-right: 0">\n\t\t\t\t\t\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t\t\t\t\t\t       name="labels.earnings.name"\n\t\t\t\t\t\t\t\t\t\t       data-ng-model="events.earnings"\n\t\t\t\t\t\t\t\t\t\t       data-ng-disabled="shouldLoadEvents">\n\t\t\t\t\t\t\t\t\t\t{{labels.earnings}}\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<span data-ng-repeat="symbol in symbols"\n\t      class="symbol-label pull-left"\n\t      data-ng-attr-style="{{ \'background-color: \' + symbol.color + \'!important; color:\'+symbol.textColor+ \'!important\'}}">\n\t\t\t\t\t\t\t<span data-ng-attr-style="{{ \'background-color: \' + symbol.color + \'!important; color:\'+symbol.textColor+ \'!important\'}}"\n\t\t\t\t\t\t\t      data-ng-bind="symbol.title" class="symbol-label-title pull-left"></span>\n\t\t\t\t\t\t\t<i data-ng-click="api.removeSymbolFromChart(symbol)"\n\t\t\t\t\t\t\t   data-ng-attr-style="{{ \'color:\'+symbol.textColor+ \'!important\'}}"\n\t\t\t\t\t\t\t   class="fas fa-times super-close pull-right"></i>\n\t\t\t\t\t\t</span>\n\t<div class="chart-inner">\n\t\t<a class="svi-visually-hidden"\n\t\t   data-svi-skip-link="#{{::id}} .highcharts-contextbutton">\n\t\t\tSkip to chart export menu.\n\t\t</a>\n\t\t<div class="chart"></div>\n\t</div>\n</div>\n')}]),angular.module("advancedSymbolChart/advancedSymbolWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("advancedSymbolChart/advancedSymbolWidget.tpl.html",'<div class="svi-directive svi-price-history-widget" data-svi-widget data-title="labels.priceHistoryChartTitle" data-include-loader="false"\n     id="{{::id}}">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div data-svi-loader data-callback="setLoader" class="loader-floating"\n                         data-ignore-invisible="true"></div>\n                    <div class="loader" data-ignore-invisible="true" data-hidden="true" data-svi-loader data-callback="getPriceInfoLoader"></div>\n                    <h4 class="symbol" data-ng-bind="symbol" data-ng-show="showSymbol"></h4>\n                    %CHART_WRAPPER%\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("detailedQuote/ariaLiveQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/ariaLiveQuote.tpl.html",'<div class="svi-visually-hidden aria-live-quote" aria-live="polite">\n\t<div data-ng-if="quote && quote.length > 0">\n\t\t<span data-ng-if="quote.length > 1">Quotes loaded for multiple symbols.</span>\n\t\t<span data-ng-if="quote.length == 1">Quote loaded.</span>\n\n\t\t<div data-ng-repeat="quoteRecord in quote">\n\t\t\tQuote summary for {{ quoteRecord.instrument.symbol }} {{labels.lastTrade}} {{quoteRecord.quote.lastTradeTime|sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}.\n\t\t\t<div data-ng-if="quoteRecord.unknownSymbol" data-ng-bind="labels.noDataSymbol"></div>\n\t\t\t<div data-ng-show="!quoteRecord.unknownSymbol">\n\t\t\t\tDescription: {{ quoteRecord.instrument.desc }}.\n\t\t\t\tLast Price: {{ quoteRecord.quote.lastPrice|sviCurrency }}\n\t\t\t\tDay Change: {{ ( quoteRecord.quote.change >= 0 ) ? \'up\' : \'\' }} {{ quoteRecord.quote.change|sviCurrency }}\n\t\t\t\tDay Change Percent: {{ ( quoteRecord.quote.change >= 0 ) ? \'up\' : \'\' }} {{quoteRecord.quote.pctChange|percent:2}}.\n\t\t\t</div>\n\t\t</div>\n\n\t\tMore information is available if you focus the quote area.\n\t</div>\n</div>\n\n<h5 data-ng-if="quote.length > 0" tabindex="-1" class="svi-visually-hidden-forced aria-quote-target">Quote for {{ quote[0].instrument.symbol }}</h5>')}]),angular.module("detailedQuote/detailedQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/detailedQuote.tpl.html",'<div class="svi-directive detailed-quote">\n\t<h3 class="title" data-ng-bind="labels.detailedQuoteTitle" data-ng-show="showTitle"></h3>\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t%ARIA_LIVE%\n\t<div data-ng-show="quote && quote.length > 0 && quote[0].unknownSymbol" class="col-sm-12 alert alert-danger" data-ng-bind="labels.noDataSymbol"></div>\n\t<div data-ng-show="quote && quote.length > 0 && !quote[0].unknownSymbol" class="row">\n\t\t<div class="col-md-6 col-sm-6">\n\t\t\t<dl data-ng-if="quote[0].instrument.investmentType != \'Option\'">\n\t\t\t\t<dt><span data-ng-bind="labels.low"></span>-<span data-ng-bind="labels.high"></span></dt>\n\t\t\t\t<dd><span data-ng-bind="quote[0].quote.extendedQuote.lowPrice|sviCurrency"></span> - <span data-ng-bind="quote[0].quote.extendedQuote.highPrice|sviCurrency"></span></dd>\n\t\t\t\t<dt>52 <span data-ng-bind="labels.week"></span></dt>\n\t\t\t\t<dd>\n\t\t\t\t\t<span data-ng-bind="quote[0].quote.extendedQuote.low52Price|sviCurrency"></span>\n\t\t\t\t\t<div class="rangechart">\n\t\t\t\t\t\t\x3c!--\n\t\t\t\t\t\t<div class="midpoint"></div>\n\t\t\t\t\t\t<div class="marker"><span data-ng-bind="labels.today"></span><span></span></div>\n\t\t\t\t\t\t<div class="progress">\n\t\t\t\t\t\t  <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 100%;">\n\t\t\t\t\t\t  </div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t--\x3e\n\t\t\t\t\t</div>\n\t\t\t\t\t<span data-ng-bind="quote[0].quote.extendedQuote.high52Price|sviCurrency"></span>\n\t\t\t\t</dd>\n\t\t\t\t<dt data-ng-bind="labels.open"></dt>\n\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.openPrice|sviCurrency"></dd>\n\t\t\t\t<dt data-ng-bind="labels.volume"></dt>\n\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.volume|sviNumber:0:true:true"></dd>\n\t\t\t</dl>\n\t\t\t<dl data-ng-if="quote[0].instrument.investmentType == \'Option\'">\n\t\t\t\t<dt><span data-ng-bind="labels.low"></span>-<span data-ng-bind="labels.high"></span></dt>\n\t\t\t\t<dd><span data-ng-bind="quote[0].quote.extendedQuote.contractLow|sviCurrency"></span> - <span data-ng-bind="quote[0].quote.extendedQuote.contractHigh|sviCurrency"></span></dd>\n\t\t\t\t<dt data-ng-bind="labels.openInterest"></dt>\n\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.openInterest|sviNumber:0"></dd>\n\t\t\t</dl>\n\t\t</div>\n\t\t<div class="col-md-6 col-sm-6">\n\t\t\t<dl data-ng-if="quote[0].instrument.investmentType != \'Option\'">\n\t\t\t\t<dt data-ng-bind="labels.peRatio"></dt>\n\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.priceEarningsRatio|sviNumber:2:true:true"></dd>\n\t\t\t\t<dt data-ng-bind="labels.dividend"></dt>\n\t\t\t\t<dd><span data-ng-bind="quote[0].quote.extendedQuote.dividendData.amt|sviCurrency"></span></dd>\n\t\t\t\t<dt data-ng-bind="labels.yield"></dt>\n\t\t\t\t<dd><span data-ng-bind="quote[0].quote.extendedQuote.dividendData.yield|percent"></span></dd>\n\t\t\t\t<dt data-ng-bind="labels.eps"></dt>\n\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.earningsPerShare|sviCurrency"></dd>\n\t\t\t</dl>\n\t\t\t<dl data-ng-if="quote[0].instrument.investmentType == \'Option\'">\n\t\t\t\t<dt data-ng-bind="labels.prevPrice"></dt>\n\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviCurrency"></dd>\n\t\t\t\t<dt data-ng-bind="labels.expirationDate"></dt>\n\t\t\t\t<dd><span data-ng-bind-html="quote[0].instrument.maturityDate|sviDate"></span></dd>\n\t\t\t</dl>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("detailedQuote/detailedWidgetQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/detailedWidgetQuote.tpl.html",'<div class="svi-directive data-svi-detailed-widget-quote svi-details" data-svi-widget data-title="labels.detailedQuoteTitle" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div class="loader" data-svi-loader data-callback="setLoader"></div>\n                    %ARIA_LIVE%\n                    <div class="col-sm-12 alert alert-danger"\n                         data-ng-show="quote && quote.length > 0 && quote[0].unknownSymbol"\n                         data-ng-bind="labels.noDataSymbol"></div>\n                    <div data-ng-show="quote && quote.length > 0 && !quote[0].unknownSymbol" class="row">\n                        <div class="col-md-6 col-sm-6">\n                            <dl class="dl-vertical" data-ng-if="quote[0].instrument.investmentType !== \'Option\'">\n                                <dt class="data-label">\n                                    <span data-ng-bind="labels.low"></span> -\n                                    <span data-ng-bind="labels.high"></span>\n                                </dt>\n                                <dd class="data-value">\n                                    <span data-ng-bind="quote[0].quote.extendedQuote.lowPrice|sviCurrency"></span> -\n                                    <span data-ng-bind="quote[0].quote.extendedQuote.highPrice|sviCurrency"></span>\n                                </dd>\n                                <dt class="data-label">\n                                    52 <span data-ng-bind="labels.week"></span>\n                                </dt>\n                                <dd class="data-value">\n                                    <span data-ng-bind="quote[0].quote.extendedQuote.low52Price|sviCurrency"></span> -\n                                    <span data-ng-bind="quote[0].quote.extendedQuote.high52Price|sviCurrency"></span>\n                                </dd>\n                                <dt class="data-label" data-ng-bind="labels.open"></dt>\n                                <dd class="data-value" data-ng-bind="quote[0].quote.extendedQuote.openPrice|sviCurrency"></dd>\n                                <dt class="data-label" data-ng-bind="labels.volume"></dt>\n                                <dd class="data-value" data-ng-bind="quote[0].quote.extendedQuote.volume|sviNumber:0:true:true"></dd>\n                            </dl>\n                            <dl data-ng-if="quote[0].instrument.investmentType == \'Option\'">\n                                <dt class="data-label"><span data-ng-bind="labels.low"></span>-<span data-ng-bind="labels.high"></span></dt>\n                                <dd class="data-value">\n                                    <span data-ng-bind="quote[0].quote.extendedQuote.contractLow|sviCurrency"></span> -\n                                    <span data-ng-bind="quote[0].quote.extendedQuote.contractHigh|sviCurrency"></span>\n                                </dd>\n                                <dt class="data-label" data-ng-bind="labels.openInterest"></dt>\n                                <dd class="data-value" data-ng-bind="quote[0].quote.extendedQuote.openInterest|sviNumber:0"></dd>\n                            </dl>\n                        </div>\n                        <div class="col-md-6 col-sm-6">\n                            <dl data-ng-if="quote[0].instrument.investmentType !== \'Option\'">\n                                <dt class="data-label" data-ng-bind="labels.peRatio"></dt>\n                                <dd class="data-value" data-ng-bind="quote[0].quote.extendedQuote.priceEarningsRatio|sviNumber:2:true:true"></dd>\n                                <dt class="data-label" data-ng-bind="labels.dividend"></dt>\n                                <dd class="data-value">\n                                    <span data-ng-bind="quote[0].quote.extendedQuote.dividendData.amt|sviCurrency"></span>\n                                </dd>\n                                <dt class="data-label" data-ng-bind="labels.yield"></dt>\n                                <dd class="data-value"><span data-ng-bind="quote[0].quote.extendedQuote.dividendData.yield|percent"></span></dd>\n                                <dt class="data-label" data-ng-bind="labels.eps"></dt>\n                                <dd class="data-value" data-ng-bind="quote[0].quote.extendedQuote.earningsPerShare|sviCurrency"></dd>\n                            </dl>\n                            <dl data-ng-if="quote[0].instrument.investmentType === \'Option\'">\n                                <dt class="data-label" data-ng-bind="labels.prevPrice"></dt>\n                                <dd class="data-value" data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviCurrency"></dd>\n                                <dt class="data-label" data-ng-bind="labels.expirationDate"></dt>\n                                <dd class="data-value"><span data-ng-bind-html="quote[0].instrument.maturityDate|sviDate"></span></dd>\n                            </dl>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("detailedQuote/mutualFundAAGQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/mutualFundAAGQuote.tpl.html",'<div class="svi-directive svi-detailed-quote svi-mutual-fund-quote-a-a-g">\n    <div data-svi-loader data-callback="setLoader" data-event-id="QUOTE"></div>\n    <div class="quote-exchange-date" data-ng-show="quote[0].quote">{{ labels.asOf }} {{ quote[0].quote.quoteTime | sviDate:"MM/dd/yyyy" }}</div>\n    <div class="row" data-ng-show="quote[0].quote">\n        <div class="col-md-3 col-xs-6">\n            <div class="datapoint-box text-center">\n                <div class="data-label" data-ng-bind="labels.netAssetValue"></div>\n                <div class="data-value" data-ng-bind="quote[0].quote.nav|sviCurrency"></div>\n            </div>\n        </div>\n        <div class="col-md-3 col-xs-6">\n            <div class="datapoint-box text-center">\n                <div class="data-label" data-ng-bind="labels.dayChange"></div>\n                <span class="data-value " data-ng-class="{positive: quote[0].quote.change > 0, negative: quote[0].quote.change < 0}" data-ng-bind-html="quote[0].quote.change|sviCurrency"></span>\n                <span class="data-value parenChangePercent" ng-bind-html="quote[0].quote.pctChange|percentChange"></span>\n            </div>\n        </div>\n        <div class="col-md-3 col-xs-6">\n            <div class="datapoint-box text-center">\n                <div class="data-label" data-ng-bind="labels.expenseRatio"></div>\n\t\t\t\t<div class="vertical-aligned-values">\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].fundOverview.grossExpenseRatio|percent"></span>\n\t\t\t\t\t<span class="data-value">/</span>\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].fundOverview.netExpenseRatio|percent"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n        </div>\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.weekRange"></div>\n\t\t\t\t<div class="vertical-aligned-values">\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].quote.extendedQuote.low52Price|sviCurrency"></span>\n\t\t\t\t\t<span class="extra-symbols" data-ng-bind="labels.dash"></span>\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].quote.extendedQuote.high52Price|sviCurrency"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n    </div>\n</div>')}]),angular.module("detailedQuote/newPopoverQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/newPopoverQuote.tpl.html",'<div class="svi-directive svi-detailed-quote svi-new-popover-quote">\n\t<div data-svi-loader\n\t     data-callback="setLoader"\n\t     data-event-id="POPOVER.QUOTE"></div>\n\t<div data-ng-if="quote && quote.length > 0 && quote[0].unknownSymbol"\n\t     class="col-xs-12 alert alert-danger"\n\t     data-ng-bind="labels.noDataSymbol"></div>\n\t<div data-ng-if="quote && quote.length > 0 && !quote[0].unknownSymbol">\n\t\t<div class="dim glyphicon glyphicon-refresh pointer refresh-button-icon"\n\t\t     data-ng-click="load(true)"\n\t\t     aria-label="refresh quote"></div>\n\t\t<div class="quote-popover-header row small">\n\t\t\t<div class="dim quote-time col-sm-5">\n\t\t\t\t{{labels.asOf}} {{quote[0].quote.lastTradeTime | sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}&nbsp;\n\t\t\t</div>\n\t\t\t<div class="new-popover-quote-action-buttons col-sm-7">\n\t\t\t\t<label class="option-search-checkbox-label" data-ng-if="investmentType !== \'MutualFund\'">\n\t\t\t\t\t<input type="checkbox"\n\t\t\t\t\t       class="option-search-checkbox"\n\t\t\t\t\t       data-ng-disabled="symbols.length > 4 && !indexes.DJIA"\n\t\t\t\t\t       data-ng-model="optionSearch.val"\n\t\t\t\t\t       data-ng-change="api.handleOptionSearch(optionSearch.val)">\n\t\t\t\t\tOption Search\n\t\t\t\t</label>\n\t\t\t\t<div data-svi-add-to-watchlist\n\t\t\t\t     data-symbol="{{ symbol }}"\n\t\t\t\t     data-symbol-instrument="{{ securityType }}"\n\t\t\t\t     data-manual-show-dropdown="true"></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div data-ng-class="{\'option-search-selected\': showOptionSearch }" class="popover-quote-container">\n\t\t\t<div class="symbol-row row" data-ng-class="{\'blured-border\': showOptionSearch }">\n\t\t\t\t<div class="symbol-company" data-ng-if="investmentType !== \'Option\'">\n\t\t\t\t\t<div data-ng-bind-html="symbol|ellipsis:4:true"></div>\n\t\t\t\t\t<span class="vertical-separator"> | </span>\n\t\t\t\t\t<div class="desc" data-ng-bind-html="quote[0].instrument.desc|ellipsis:{sm:12,xs:27}:true"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="symbol-company" data-ng-if="investmentType === \'Option\'">\n\t\t\t\t\t<div data-ng-bind-html="symbol|ellipsis:{sm:12, xs:27}:true"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="last-price-and-change" data-ng-if="investmentType !== \'MutualFund\'">\n\t\t\t\t\t<dl class="aligned-right-column">\n\t\t\t\t\t\t<dt class="item-header lastPrice" data-ng-bind="labels.lastPrice"></dt>\n\t\t\t\t\t\t<dd class="lastPrice" data-ng-bind-html="quote[0].quote.lastPrice|sviNumber:2:true"></dd>\n\t\t\t\t\t</dl>\n\t\t\t\t\t<dl>\n\t\t\t\t\t\t<dt class="item-header change" data-ng-bind="labels.change"></dt>\n\t\t\t\t\t\t<dd class="change">\n\t\t\t\t\t\t\t<span data-ng-bind-html="quote[0].quote.change|currencyChange"></span>\n\t\t\t\t\t\t\t(<span data-ng-bind-html="quote[0].quote.pctChange|percentChange:2:true"></span>)\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</dl>\n\t\t\t\t</div>\n\t\t\t\t<div class="last-price-and-change" data-ng-if="investmentType === \'MutualFund\'">\n\t\t\t\t\t<dl class="aligned-right-column">\n\t\t\t\t\t\t<dt class="item-header lastPrice" data-ng-bind="labels.nav"></dt>\n\t\t\t\t\t\t<dd class="lastPrice" data-ng-bind-html="quote[0].quote.nav|sviNumber:2:true"></dd>\n\t\t\t\t\t</dl>\n\t\t\t\t\t<dl>\n\t\t\t\t\t\t<dt class="item-header change" data-ng-bind="labels.newChange"></dt>\n\t\t\t\t\t\t<dd class="change">\n\t\t\t\t\t\t\t<span data-ng-bind-html="quote[0].quote.change|currencyChange"></span>\n\t\t\t\t\t\t\t(<span data-ng-bind-html="quote[0].quote.pctChange|percentChange:2:true"></span>)\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</dl>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="quote-data" data-ng-if="investmentType === \'MutualFund\'">\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.prevNav"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviNumber:2:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.high52Price"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.high52Price|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.low52Price"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.low52Price|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.dividend"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.dividendData.amt|sviNumber:2:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.yield"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.dividendData.yield|sviNumber:2:true"></dd>\n\t\t\t\t</dl>\n\t\t\t</div>\n\n\t\t\t<div class="quote-data" data-ng-if="investmentType === \'ETF\'">\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.bid"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.bidPrice|sviNumber:2:true"\n\t\t\t\t\t    data-ng-click="trade(\'bid\')"\n\t\t\t\t\t    data-ng-class="{\'tradeable-bidask\': isTradeableBidAsk()}"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.ask"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.askPrice|sviNumber:2:true"\n\t\t\t\t\t    data-ng-click="trade(\'ask\')"\n\t\t\t\t\t    data-ng-class="{\'tradeable-bidask\': isTradeableBidAsk()}"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.size"></dt>\n\t\t\t\t\t<dd>\n\t\t\t\t\t\t{{quote[0].quote.extendedQuote.bidSize | sviNumber:2}} /\n\t\t\t\t\t\t{{quote[0].quote.extendedQuote.askSize | sviNumber:2}}\n\t\t\t\t\t</dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.openPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.openPrice|sviNumber:2:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.highPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.highPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.lowPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.lowPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.prevClose"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviNumber:2:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.dividend"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.dividendData.amt|sviNumber:{0:4,4:2}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.yield"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.dividendData.yield|percent:2"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.high52Price"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.high52Price|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.low52Price"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.low52Price|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.exch"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].instrument.exch"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.volume"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.volume|sviNumber:0:true"></dd>\n\t\t\t\t</dl>\n\t\t\t</div>\n\n\t\t\t<div class="quote-data" data-ng-if="investmentType === \'Option\'">\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.bid"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.bidPrice|sviNumber:2:true"\n\t\t\t\t\t    data-ng-click="trade(\'bid\')"\n\t\t\t\t\t    data-ng-class="{\'tradeable-bidask\': isTradeableBidAsk()}"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.ask"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.askPrice|sviNumber:2:true"\n\t\t\t\t\t    data-ng-click="trade(\'ask\')"\n\t\t\t\t\t    data-ng-class="{\'tradeable-bidask\': isTradeableBidAsk()}"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.undlSym"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].undly.symbol|ellipsis:4:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.openPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.openPrice|sviNumber:2:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.size"></dt>\n\t\t\t\t\t<dd>\n\t\t\t\t\t\t{{quote[0].quote.extendedQuote.bidSize | sviNumber:2}} /\n\t\t\t\t\t\t{{quote[0].quote.extendedQuote.askSize | sviNumber:2}}\n\t\t\t\t\t</dd>\n\t\t\t\t\t<dt data-ng-bind="labels.undlLast"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[1].quote.lastPrice|sviNumber:2:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.highPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.highPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.lowPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.lowPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.undlChange"></dt>\n\t\t\t\t\t<dd data-ng-if="quote[1].quote.change == 0">\n\t\t\t\t\t\t{{ quote[1].quote.change | sviNumber:2:true }}\n\t\t\t\t\t\t({{ quote[1].quote.pctChange | percent:2 }})\n\t\t\t\t\t</dd>\n\t\t\t\t\t<dd data-ng-if="quote[1].quote.change > 0" class="positive">\n\t\t\t\t\t\t{{ quote[1].quote.change | sviNumber:2:true }}\n\t\t\t\t\t\t({{ quote[1].quote.pctChange | percent:2 }})\n\t\t\t\t\t</dd>\n\t\t\t\t\t<dd data-ng-if="quote[1].quote.change < 0" class="negative">\n\t\t\t\t\t\t{{ quote[1].quote.change | sviNumber:2:true }}\n\t\t\t\t\t\t({{ quote[1].quote.pctChange | percent:2 }})\n\t\t\t\t\t</dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.prevClose"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviNumber:2:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.exch"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].instrument.exch"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.undlVolume"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[1].quote.extendedQuote.volume|sviNumber:0:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.openInt"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.openInterest|sviNumber:2:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.expiration"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].instrument.maturityDate|sviDate:\'yyyy/MM/dd\'"></dd>\n\t\t\t\t</dl>\n\t\t\t</div>\n\t\t\t<div class="quote-data" data-ng-if="investmentType === \'Stock\'">\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.bid"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.bidPrice|sviNumber:2:true"\n\t\t\t\t\t    data-ng-click="trade(\'bid\')"\n\t\t\t\t\t    data-ng-class="{\'tradeable-bidask\': isTradeableBidAsk()}"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.ask"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.askPrice|sviNumber:2:true"\n\t\t\t\t\t    data-ng-click="trade(\'ask\')"\n\t\t\t\t\t    data-ng-class="{\'tradeable-bidask\': isTradeableBidAsk()}"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.size"></dt>\n\t\t\t\t\t<dd>\n\t\t\t\t\t\t{{quote[0].quote.extendedQuote.bidSize | sviNumber:2}} /\n\t\t\t\t\t\t{{quote[0].quote.extendedQuote.askSize | sviNumber:2}}\n\t\t\t\t\t</dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.openPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.openPrice|sviNumber:2:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.highPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.highPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.lowPrice"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.lowPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.high52Price"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.high52Price|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.low52Price"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.low52Price|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.exch"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].instrument.exch"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.volume"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.volume|sviNumber:0:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.peRatio"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.priceEarningsRatio|sviNumber:2:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.earningsPerShare"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.earningsPerShare|sviNumber:{0:4,3:2,5:0}:true"></dd>\n\t\t\t\t</dl>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt data-ng-bind="labels.dividend"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.dividendData.amt|sviNumber:{0:4,4:2}:true"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.yield"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.dividendData.yield|percent:2"></dd>\n\t\t\t\t\t<dt data-ng-bind="labels.prevClose"></dt>\n\t\t\t\t\t<dd data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviNumber:2:true"></dd>\n\t\t\t\t</dl>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="actionBar" data-ng-if="quote[0].menuItems && !showOptionSearch">\n\t\t\t<div data-svi-action-bar\n\t\t\t     data-items="quote[0].menuItems"\n\t\t\t     data-max-items="{{getActionBarMaxItems()}}"></div>\n\t\t</div>\n\t\t<div class="option-search" data-ng-if="showOptionSearch">\n\t\t\t<div data-svi-option-search-controls\n\t\t\t     data-controls-label="{{labels.searchOptions}}"\n\t\t\t     data-last-price="{{quote[0].quote.lastPrice}}"\n\t\t\t     data-symbol="{{symbolValue}}"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("detailedQuote/popoverQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/popoverQuote.tpl.html",'<div class="svi-directive svi-detailed-quote popover-quote">\n\t<div data-ng-if="!quote || !quote.length" class="large bright symbol" data-ng-bind-html="symbol|ellipsis:6:true"></div>\n\t<div data-svi-loader data-callback="setLoader" data-event-id="QUOTE"></div>\n\t%ARIA_LIVE%\n\t<div data-ng-if="quote && quote.length > 0 && quote[0].unknownSymbol" class="col-xs-12 alert alert-danger" data-ng-bind="labels.noDataSymbol"></div>\n\t<div data-ng-if="quote && quote.length > 0 && !quote[0].unknownSymbol">\n\t\t<div class="row">\n\t\t\t<div class="verysmall dim glyphicon glyphicon-refresh pointer pull-right quoteRefreshBtn" data-ng-click="load(true)" aria-label="refresh quote"></div>\n\t\t\t<div class="col-xs-6 col-sm-8 large bright desc" data-ng-bind-html="quote[0].instrument.desc|ellipsis:{sm:19,xs:15}:true"></div>\n\t\t\t<div class="col-xs-6 col-sm-4 verysmall dim quoteTime">\n\t\t\t\t{{labels.lastTrade}} {{quote[0].quote.lastTradeTime|sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}&nbsp;\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<dl class="col-xs-3" data-ng-if="quote[0].instrument.investmentType != \'Option\'">\n\t\t\t\t<dt class="symbol" data-ng-bind="labels.symbol"></dt>\n\t\t\t\t<dd class="symbol large" data-ng-bind-html="symbol|ellipsis:4:true"></dd>\n\t\t\t</dl>\n\t\t\t<dl class="col-xs-3">\n\t\t\t\t<dt class="lastPrice" data-ng-bind="labels.lastPrice"></dt>\n\t\t\t\t<dd class="lastPrice large hidden-xs" data-ng-bind="quote[0].quote.lastPrice|sviNumber:2:true"></dd>\n\t\t\t\t<dd class="lastPrice large visible-xs-block" data-ng-bind="quote[0].quote.lastPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t</dl>\n\t\t\t<dl data-ng-class="quote[0].instrument.investmentType == \'Option\' ? \'col-xs-6 col-sm-5\' : \'col-xs-6\'">\n\t\t\t\t<dt class="change" data-ng-bind="labels.change"></dt>\n\t\t\t\t<dd data-ng-if="quote[0].quote.change == 0" class="change large">\n\t\t\t\t\t{{ quote[0].quote.change|sviNumber:2:true }}\n\t\t\t\t\t({{ quote[0].quote.pctChange|percent:2 }})\n\t\t\t\t</dd>\n\t\t\t\t<dd data-ng-if="quote[0].quote.change > 0" class="change positive large">\n\t\t\t\t\t<span class="glyphicon glyphicon-arrow-up"></span><span class="svi-visually-hidden">up</span>\n\t\t\t\t\t{{ quote[0].quote.change|sviNumber:2:true }}\n\t\t\t\t\t({{ quote[0].quote.pctChange|percent:2 }})\n\t\t\t\t</dd>\n\t\t\t\t<dd data-ng-if="quote[0].quote.change < 0" class="change negative large">\n\t\t\t\t\t<span class="glyphicon glyphicon-arrow-down"></span><span class="svi-visually-hidden">down</span>\n\t\t\t\t\t{{ quote[0].quote.change|sviNumber:2:true }}\n\t\t\t\t\t({{ quote[0].quote.pctChange|percent:2 }})\n\t\t\t\t</dd>\n\t\t\t</dl>\n\t\t\t<dl class="col-xs-3 col-sm-4" data-ng-if="quote[0].instrument.investmentType == \'Option\'">\n\t\t\t\t<dt class="symbol" data-ng-bind="labels.undlySymbol"></dt>\n\t\t\t\t<dd class="symbol large" data-ng-bind-html="quote[0].undly.symbol|ellipsis:4:true"></dd>\n\t\t\t</dl>\n\t\t</div>\n\t\t<div class="row underlying" data-ng-if="quote[0].instrument.investmentType == \'Option\' && quote.length == 2">\n\t\t\t<dl class="col-xs-5 col-sm-3">\n\t\t\t\t<dt class="lastPrice" data-ng-bind="labels.undlyLastPrice"></dt>\n\t\t\t\t<dd class="lastPrice large hidden-xs" data-ng-bind="quote[1].quote.lastPrice|sviNumber:2:true"></dd>\n\t\t\t\t<dd class="lastPrice large visible-xs-block" data-ng-bind="quote[1].quote.lastPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t</dl>\n\t\t\t<dl class="col-xs-7 col-sm-5">\n\t\t\t\t<dt class="change" data-ng-bind="labels.undlyChange"></dt>\n\t\t\t\t<dd data-ng-if="quote[1].quote.change == 0" class="change large">\n\t\t\t\t\t{{ quote[1].quote.change|sviNumber:2:true }}\n\t\t\t\t\t({{ quote[1].quote.pctChange|percent:2 }})\n\t\t\t\t</dd>\n\t\t\t\t<dd data-ng-if="quote[1].quote.change > 0" class="change positive large">\n\t\t\t\t\t<span class="glyphicon glyphicon-arrow-up"></span><span class="svi-visually-hidden">up</span>\n\t\t\t\t\t{{ quote[1].quote.change|sviNumber:2:true }}\n\t\t\t\t\t({{ quote[1].quote.pctChange|percent:2 }})\n\t\t\t\t</dd>\n\t\t\t\t<dd data-ng-if="quote[1].quote.change < 0" class="change negative large">\n\t\t\t\t\t<span class="glyphicon glyphicon-arrow-down"></span><span class="svi-visually-hidden">down</span>\n\t\t\t\t\t{{ quote[1].quote.change|sviNumber:2:true }}\n\t\t\t\t\t({{ quote[1].quote.pctChange|percent:2 }})\n\t\t\t\t</dd>\n\t\t\t</dl>\n\t\t\t<dl class="col-sm-4 hidden-xs">\n\t\t\t\t<dt class="undlyVolume" data-ng-bind="labels.undlyVolume"></dt>\n\t\t\t\t<dd class="undlyVolume large" data-ng-bind="quote[1].quote.extendedQuote.volume|sviNumber:0:true"></dd>\n\t\t\t</dl>\n\t\t</div>\n\t\t<div class="row underlying" data-ng-if="quote[0].instrument.investmentType == \'Option\' && quote.length == 1">\n\t\t\t<dl class="col-xs-5 col-sm-3">\n\t\t\t\t<dt class="lastPrice" data-ng-bind="labels.undlyLastPrice"></dt>\n\t\t\t\t<dd class="lastPrice large hidden-xs" data-ng-bind="quote[0].undlyQuote.lastPrice|sviNumber:2:true"></dd>\n\t\t\t\t<dd class="lastPrice large visible-xs-block" data-ng-bind="quote[0].undlyQuote.lastPrice|sviNumber:{0:2,6:0}:true"></dd>\n\t\t\t</dl>\n\t\t\t<dl class="col-xs-7 col-sm-5">\n\t\t\t\t<dt class="change" data-ng-bind="labels.undlyChange"></dt>\n\t\t\t\t<dd data-ng-if="quote[0].undlyQuote.change == 0" class="undlyChange large">\n\t\t\t\t\t{{ quote[0].undlyQuote.change|sviNumber:2:true }}\n\t\t\t\t</dd>\n\t\t\t\t<dd data-ng-if="quote[0].undlyQuote.change > 0" class="undlyChange positive large">\n\t\t\t\t\t<span class="glyphicon glyphicon-arrow-up"></span><span class="svi-visually-hidden">up</span>\n\t\t\t\t\t{{ quote[0].undlyQuote.change|sviNumber:2:true }}\n\t\t\t\t</dd>\n\t\t\t\t<dd data-ng-if="quote[0].undlyQuote.change < 0" class="undlyChange negative large">\n\t\t\t\t\t<span class="glyphicon glyphicon-arrow-down"></span><span class="svi-visually-hidden">down</span>\n\t\t\t\t\t{{ quote[0].undlyQuote.change|sviNumber:2:true }}\n\t\t\t\t</dd>\n\t\t\t</dl>\n\t\t\t<dl class="col-sm-4 hidden-xs">\n\t\t\t\t<dt class="undlyVolume" data-ng-bind="labels.undlyVolume"></dt>\n\t\t\t\t<dd class="undlyVolume large" data-ng-bind="quote[0].undlyQuote.extendedQuote.volume|sviNumber:0:true"></dd>\n\t\t\t</dl>\n\t\t</div>\n\t\t<div class="row detail">\n\t\t\t<div class="col-xs-12">\n\t\t\t\t<table role="presentation">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class="bid" data-ng-bind="labels.bid"></th>\n\t\t\t\t\t\t<td class="bid hidden-xs" data-ng-bind="quote[0].quote.bidPrice|sviNumber:2:true" data-ng-click="trade(\'bid\')" data-ng-class="{\'tradeable-bidask\':isTradeableBidAsk()}"></td>\n\t\t\t\t\t\t<td class="bid hidden-sm hidden-md hidden-lg" data-ng-bind="quote[0].quote.bidPrice|sviNumber:{0:2,6:0}:true" data-ng-click="trade(\'bid\')" data-ng-class="{\'tradeable-bidask\':isTradeableBidAsk()}"></td>\n\t\t\t\t\t\t<th class="highPrice" data-ng-bind="labels.highPrice"></th>\n\t\t\t\t\t\t<td class="highPrice" data-ng-bind="quote[0].quote.extendedQuote.highPrice|sviNumber:{0:2,6:0}:true"></td>\n\t\t\t\t\t\t<th class="volume" data-ng-bind="labels.volume"></th>\n\t\t\t\t\t\t<td class="volume" data-ng-bind="quote[0].quote.extendedQuote.volume|sviNumber:0:true"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class="ask" data-ng-bind="labels.ask"></th>\n\t\t\t\t\t\t<td class="ask hidden-xs" data-ng-bind="quote[0].quote.askPrice|sviNumber:2:true" data-ng-click="trade(\'ask\')" data-ng-class="{\'tradeable-bidask\':isTradeableBidAsk()}"></td>\n\t\t\t\t\t\t<td class="ask hidden-sm hidden-md hidden-lg" data-ng-bind="quote[0].quote.askPrice|sviNumber:{0:2,6:0}:true" data-ng-click="trade(\'ask\')" data-ng-class="{\'tradeable-bidask\':isTradeableBidAsk()}"></td>\n\t\t\t\t\t\t<th class="lowPrice" data-ng-bind="labels.lowPrice"></th>\n\t\t\t\t\t\t<td class="lowPrice" data-ng-bind="quote[0].quote.extendedQuote.lowPrice|sviNumber:{0:2,6:0}:true"></td>\n\t\t\t\t\t\t<th class="priceEarningsRatio" data-ng-bind="labels.priceEarningsRatio"></th>\n\t\t\t\t\t\t<td class="priceEarningsRatio" data-ng-bind="quote[0].quote.extendedQuote.priceEarningsRatio|sviNumber:2:true"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class="size" data-ng-bind="labels.size"></th>\n\t\t\t\t\t\t<td class="size">{{quote[0].quote.extendedQuote.bidSize|sviNumber:2}} / {{quote[0].quote.extendedQuote.askSize|sviNumber:2}}</td>\n\t\t\t\t\t\t<th class="high52Price" data-ng-bind="labels.high52Price" data-ng-if="quote[0].instrument.investmentType != \'Option\'"></th>\n\t\t\t\t\t\t<td class="high52Price" data-ng-bind="quote[0].quote.extendedQuote.high52Price|sviNumber:{0:2,6:0}:true" data-ng-if="quote[0].instrument.investmentType != \'Option\'"></td>\n\t\t\t\t\t\t<th class="contractHigh" data-ng-bind="labels.contractHigh" data-ng-if="quote[0].instrument.investmentType == \'Option\'"></th>\n\t\t\t\t\t\t<td class="contractHigh" data-ng-bind="quote[0].quote.extendedQuote.contractHigh|sviNumber:{0:2,6:0}:true" data-ng-if="quote[0].instrument.investmentType == \'Option\'"></td>\n\t\t\t\t\t\t<th class="earningsPerShare" data-ng-bind="labels.earningsPerShare"></th>\n\t\t\t\t\t\t<td class="earningsPerShare" data-ng-bind="quote[0].quote.extendedQuote.earningsPerShare|sviNumber:{0:4,3:2,5:0}:true"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class="openPrice" data-ng-bind="labels.openPrice"></th>\n\t\t\t\t\t\t<td class="openPrice hidden-xs" data-ng-bind="quote[0].quote.extendedQuote.openPrice|sviNumber:2:true"></td>\n\t\t\t\t\t\t<td class="openPrice hidden-sm hidden-md hidden-lg" data-ng-bind="quote[0].quote.extendedQuote.openPrice|sviNumber:{0:2,6:0}:true"></td>\n\t\t\t\t\t\t<th class="low52Price" data-ng-bind="labels.low52Price" data-ng-if="quote[0].instrument.investmentType != \'Option\'"></th>\n\t\t\t\t\t\t<td class="low52Price" data-ng-bind="quote[0].quote.extendedQuote.low52Price|sviNumber:{0:2,6:0}:true" data-ng-if="quote[0].instrument.investmentType != \'Option\'"></td>\n\t\t\t\t\t\t<th class="contractLow" data-ng-bind="labels.contractLow" data-ng-if="quote[0].instrument.investmentType == \'Option\'"></th>\n\t\t\t\t\t\t<td class="contractLow" data-ng-bind="quote[0].quote.extendedQuote.contractLow|sviNumber:{0:2,6:0}:true" data-ng-if="quote[0].instrument.investmentType == \'Option\'"></td>\n\t\t\t\t\t\t<th class="dividend" data-ng-bind="labels.dividend"></th>\n\t\t\t\t\t\t<td class="dividend" data-ng-bind="quote[0].quote.extendedQuote.dividendData.amt|sviNumber:{0:4,4:2}:true"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class="prevClose" data-ng-bind="labels.prevClose"></th>\n\t\t\t\t\t\t<td class="prevClose hidden-xs" data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviNumber:2:true"></td>\n\t\t\t\t\t\t<td class="prevClose hidden-sm hidden-md hidden-lg" data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviNumber:{0:2,6:0}:true"></td>\n\t\t\t\t\t\t<th class="exch" data-ng-bind="labels.exch"></th>\n\t\t\t\t\t\t<td class="exch" data-ng-bind="quote[0].instrument.exch"></td>\n\t\t\t\t\t\t<th class="yield" data-ng-bind="labels.yield" data-ng-if="quote[0].instrument.investmentType != \'Option\'"></th>\n\t\t\t\t\t\t<td class="yield" data-ng-bind="quote[0].quote.extendedQuote.dividendData.yield|percent:2" data-ng-if="quote[0].instrument.investmentType != \'Option\'"></td>\n\t\t\t\t\t\t<th class="contractSize" data-ng-bind="labels.contractSize" data-ng-if="quote[0].instrument.investmentType == \'Option\'"></th>\n\t\t\t\t\t\t<td class="contractSize" data-ng-bind="quote[0].quote.extendedQuote.contractSize|sviNumber:0:true" data-ng-if="quote[0].instrument.investmentType == \'Option\'"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row actionBar" data-ng-if="quote[0].menuItems">\n\t\t\t<div data-svi-action-bar class="col-xs-12"\n\t\t\t\t data-items="quote[0].menuItems"\n\t\t\t\t data-max-items="{{getActionBarMaxItems()}}"></div>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("detailedQuote/stockAAGQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/stockAAGQuote.tpl.html",'<div class="svi-directive svi-detailed-quote svi-stock-quote-a-a-g">\n\t<div data-svi-loader data-callback="setLoader"></div>\n\t<div class="quote-exchange-date" data-ng-show="quote[0].quote">{{ quote[0].instrument.exch }} {{ labels.asOfSmall}} {{ quote[0].quote.quoteTime | sviDate:"MM/dd/yyyy h:mm a \'ET\'" }}</div>\n\t<div class="row" data-ng-show="quote[0].quote">\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.lastPrice"></div>\n\t\t\t\t<div class="data-value" data-ng-bind="quote[0].quote.lastPrice|sviCurrency"></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.change"></div>\n\t\t\t\t<span class="data-value " data-ng-class="{positive: quote[0].quote.change > 0, negative: quote[0].quote.change < 0}" data-ng-bind-html="quote[0].quote.change|sviCurrency"></span>\n\t\t\t\t<span class="data-value parenChangePercent" ng-bind-html="quote[0].quote.pctChange | percentChange"></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.bidXSize"></div>\n\t\t\t\t<div class="vertical-aligned-values">\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].quote.bidPrice|sviCurrency"></span>\n\t\t\t\t\t<span class="extra-symbols data-ask-bid-size" data-ng-bind="labels.cross"></span>\n\t\t\t\t\t<span class="data-value data-ask-bid-size" data-ng-bind="quote[0].quote.extendedQuote.bidSize"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.askXSize"></div>\n\t\t\t\t<div class="vertical-aligned-values">\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].quote.askPrice|sviCurrency"></span>\n\t\t\t\t\t<span class="extra-symbols data-ask-bid-size" data-ng-bind="labels.cross"></span>\n\t\t\t\t\t<span class="data-value data-ask-bid-size" data-ng-bind="quote[0].quote.extendedQuote.askSize"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class="row print-breaker-before" data-ng-show="quote[0].quote">\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.previousClose"></div>\n\t\t\t\t<div class="data-value" data-ng-bind="quote[0].quote.extendedQuote.prevClose|sviCurrency"></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.openPrice"></div>\n\t\t\t\t<div class="data-value" data-ng-bind="quote[0].quote.extendedQuote.openPrice|sviCurrency"></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.dayRange"></div>\n\t\t\t\t<div class="vertical-aligned-values">\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].quote.extendedQuote.lowPrice|sviCurrency"></span>\n\t\t\t\t\t<span class="extra-symbols" data-ng-bind="labels.dash"></span>\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].quote.extendedQuote.highPrice|sviCurrency"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="col-md-3 col-xs-6">\n\t\t\t<div class="datapoint-box text-center">\n\t\t\t\t<div class="data-label" data-ng-bind="labels.volume"></div>\n\t\t\t\t<div class="data-value" data-ng-bind="quote[0].quote.extendedQuote.volume|sviNumber"></div>\n\t\t\t\t\x3c!-- <div class="vertical-aligned-values">\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].quote.extendedQuote.low52Price|sviCurrency"></span>\n\t\t\t\t\t<span class="extra-symbols" data-ng-bind="labels.dash"></span>\n\t\t\t\t\t<span class="data-value" data-ng-bind="quote[0].quote.extendedQuote.high52Price|sviCurrency"></span>\n\t\t\t\t</div> --\x3e\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("detailedQuote/tradePageQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/tradePageQuote.tpl.html",'<div class="svi-directive svi-detailed-quote svi-trade-page-quote tradePage">\n\t%ARIA_LIVE%\n\t<div data-ng-if="quote && quote.length > 0" class="pull-right dim glyphicon glyphicon-refresh pointer pad-right-10" data-ng-click="load(true)" aria-label="refresh quote"></div>\n\t<div data-ng-if="!quote || !quote.length">\n\t\t<div class="svi-visually-hidden">Placeholder area for displaying a quote. <a data-svi-skip-link="#{{::id}}end">Skip over quote</a>.</div>\n\t\t<div class="quote-row">\n\t\t\t<div class="row">\n\t\t\t\t<div class="col-xs-10 small dim widgetQuoteTime">\n\t\t\t\t\t{{labels.lastTrade}} {{ naValue }}\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-10 large bright symbol" data-ng-bind="symbol !== \'\' ? symbol : labels.symbol"></div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="!loader.showSpinner">\n\t\t\t\t<div class="col-xs-12 dim desc" data-ng-bind="naValue"></div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="!loader.showSpinner">\n\t\t\t\t<div class="col-xs-6 col-md-4 super bright lastPrice" data-ng-bind="naValue"></div>\n\t\t\t\t<div class="col-xs-5 col-md-4 well well-sm">\n\t\t\t\t\t{{ naValue }} ({{ naValue }})\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="!loader.showSpinner">\n\t\t\t\t<div class="col-xs-4 bid"><span class="dim">{{labels.bidXSize}}</span><br class="hidden-md hidden-lg" /> <span class="bright">{{ naValue }}</span></div>\n\t\t\t\t<div class="col-xs-4 ask"><span class="dim">{{labels.askXSize}}</span><br class="hidden-md hidden-lg" /> <span class="bright">{{ naValue }}</span></div>\n\t\t\t\t<div class="col-xs-4 vol"><span class="dim">{{labels.vol}}</span><br class="hidden-md hidden-lg" /> <span class="bright">{{ naValue }}</span></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<h5 class="svi-visually-hidden" id="{{::id}}end" tabindex="-1">End of quote area.</h5>\n\t</div>\n\t<div data-svi-loader data-callback="setLoader" data-event-id="QUOTE"></div>\n\t<div data-ng-if="quote && quote.length > 0">\n\t\t<div data-ng-repeat="quoteRecord in quote" class="quote-row">\n\t\t\t<div class="row">\n\t\t\t\t<div class="col-xs-10 small dim widgetQuoteTime">\n\t\t\t\t\t{{labels.lastTrade}} {{quoteRecord.quote.lastTradeTime|sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-10 large bright symbol" data-ng-bind="quoteRecord.instrument.symbol"></div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="quoteRecord.unknownSymbol">\n\t\t\t\t<div class="col-xs-12 alert alert-danger" data-ng-bind="labels.noDataSymbol"></div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="!quoteRecord.unknownSymbol">\n\t\t\t\t<div class="col-xs-12 dim">\n\t\t\t\t\t<span class="desc" data-ng-bind="quoteRecord.instrument.desc"></span>\n\t\t\t\t\t(<span class="exch" data-ng-bind="quoteRecord.instrument.exch"></span> - <span class="symbol" data-ng-bind="quoteRecord.instrument.symbol"></span>)\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="!quoteRecord.unknownSymbol">\n\t\t\t\t<div class="col-xs-6 super bright lastPrice">\n\t\t\t\t\t<span>{{quoteRecord.quote.lastPrice|sviNumber:2:true}}</span>\n\t\t\t\t\t<span data-ng-if="quoteRecord.quote.extendedQuote.lastPriceExchange && quote.length === 1"> x {{quoteRecord.quote.extendedQuote.lastSize|sviNumber:2}}</span>\n\t\t\t\t\t<span class="badge"\n\t\t\t\t\t\t  data-ng-if="quoteRecord.quote.extendedQuote.lastPriceExchange && quote.length === 1"\n\t\t\t\t\t\t  data-trigger="click"\n\t\t\t\t\t\t  data-container=".svi-bs"\n\t\t\t\t\t\t  data-auto-close="1"\n\t\t\t\t\t\t  data-bs-popover\n\t\t\t\t\t\t  data-toggle="tooltip"\n\t\t\t\t\t\t  data-placement="bottom"\n\t\t\t\t\t\t  href=""\n\t\t\t\t\t\t  data-content="{{quoteRecord.quote.extendedQuote.lastPriceExchange.split(\':\')[1]}}"\n\t\t\t\t\t>{{quoteRecord.quote.extendedQuote.lastPriceExchange.split(\':\')[0]}}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-5 well well-sm" data-ng-class="{\'gain\': quoteRecord.quote.change > 0, \'loss\': quoteRecord.quote.change < 0}">\n\t\t\t\t\t{{ ( quoteRecord.quote.change > 0 ) ? \'+\' : \'\' }}\n\t\t\t\t\t{{quoteRecord.quote.change|sviNumber:2:true}}\n\t\t\t\t\t({{quoteRecord.quote.pctChange|percent:2}})\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="row extendedQuote" data-ng-show="!quoteRecord.unknownSymbol && quoteRecord.instrument.securityType != \'MutualFund\'">\n\t\t\t\t<div class="col-xs-4 bid">\n\t\t\t\t\t<div class="ask-container">\n\t\t\t\t\t\t<div class="value-container">\n\t\t\t\t\t\t\t<div class="dim">{{labels.bidXSize}}</div>\n\t\t\t\t\t\t\t<span class="bright">{{quoteRecord.quote.bidPrice|sviNumber:2:true}} x {{quoteRecord.quote.extendedQuote.bidSize|sviNumber:2}}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class="badge"\n\t\t\t\t\t\t\t  data-ng-if="quoteRecord.quote.extendedQuote.bidPriceExchange && quote.length === 1"\n\t\t\t\t\t\t\t  data-trigger="click"\n\t\t\t\t\t\t\t  data-container=".svi-bs"\n\t\t\t\t\t\t\t  data-auto-close="1"\n\t\t\t\t\t\t\t  data-bs-popover\n\t\t\t\t\t\t\t  data-toggle="tooltip"\n\t\t\t\t\t\t\t  data-placement="bottom"\n\t\t\t\t\t\t\t  href=""\n\t\t\t\t\t\t\t  data-popover-template=""\n\t\t\t\t\t\t\t  data-content="{{quoteRecord.quote.extendedQuote.bidPriceExchange.split(\':\')[1]}}"\n\t\t\t\t\t\t>{{quoteRecord.quote.extendedQuote.bidPriceExchange.split(\':\')[0]}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-4 ask">\n\t\t\t\t\t<div class="ask-container">\n\t\t\t\t\t\t<div class="value-container">\n\t\t\t\t\t\t\t<div class="dim">{{labels.askXSize}}</div>\n\t\t\t\t\t\t\t<span class="bright">{{quoteRecord.quote.askPrice|sviNumber:2:true}} x {{quoteRecord.quote.extendedQuote.askSize|sviNumber:2}}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class="badge"\n\t\t\t\t\t\t\t  data-ng-if="quoteRecord.quote.extendedQuote.askPriceExchange && quote.length === 1"\n\t\t\t\t\t\t\t  data-trigger="click"\n\t\t\t\t\t\t\t  data-container=".svi-bs"\n\t\t\t\t\t\t\t  data-auto-close="1"\n\t\t\t\t\t\t\t  data-bs-popover\n\t\t\t\t\t\t\t  data-toggle="tooltip"\n\t\t\t\t\t\t\t  data-placement="bottom"\n\t\t\t\t\t\t\t  href=""\n\t\t\t\t\t\t\t  data-content="{{quoteRecord.quote.extendedQuote.askPriceExchange.split(\':\')[1]}}"\n\t\t\t\t\t\t>{{quoteRecord.quote.extendedQuote.askPriceExchange.split(\':\')[0]}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-4 vol">\n\t\t\t\t\t<span class="dim">{{labels.vol}}</span>\n\t\t\t\t\t<br />\n\t\t\t\t\t<span class="bright">{{quoteRecord.quote.extendedQuote.volume|sviNumber:0:true}}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("detailedQuote/tradeWidgetQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("detailedQuote/tradeWidgetQuote.tpl.html",'<div class="svi-directive svi-detailed-quote" aria-live="polite">\n\t<div data-ng-if="quote && quote.length > 0" class="pull-right dim glyphicon glyphicon-refresh pointer pad-right-10" data-ng-click="load(true)" aria-label="refresh quote"></div>\n\t<div data-ng-if="!quote || !quote.length" class="large bright symbol" data-ng-bind="symbol"></div>\n\t<div data-svi-loader data-callback="setLoader" data-event-id="QUOTE"></div>\n\t%ARIA_LIVE%\n\t<div data-ng-if="quote && quote.length > 0">\n\t\t<div data-ng-repeat="quoteRecord in quote" class="quote-row">\n\t\t\t<div class="row">\n\t\t\t\t<div class="col-xs-10 small dim widgetQuoteTime widgetQuoteTimeTrade">\n\t\t\t\t\t{{labels.lastTrade}} {{quoteRecord.quote.lastTradeTime|sviDate:"MM/dd/yyyy h:mm a \'ET\'"}}\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-10 large bright symbol" data-ng-bind="quoteRecord.instrument.symbol"></div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="quoteRecord.unknownSymbol">\n\t\t\t\t<div class="col-xs-12 alert alert-danger" data-ng-bind="labels.noDataSymbol"></div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="!quoteRecord.unknownSymbol">\n\t\t\t\t<div class="col-xs-12 dim">\n\t\t\t\t\t<span class="desc" data-ng-bind="quoteRecord.instrument.desc"></span>\n\t\t\t\t\t(<span class="exch" data-ng-bind="quoteRecord.instrument.exch"></span> - <span class="symbol" data-ng-bind="quoteRecord.instrument.symbol"></span>)\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="row" data-ng-show="!quoteRecord.unknownSymbol">\n\t\t\t\t<div class="col-xs-6 super bright lastPrice">\n\t\t\t\t\t<span>{{quoteRecord.quote.lastPrice|sviNumber:2:true}}</span>\n\t\t\t\t\t<span data-ng-if="quoteRecord.quote.extendedQuote.lastPriceExchange && quote.length === 1"> x {{quoteRecord.quote.extendedQuote.lastSize|sviNumber:2}}</span>\n\t\t\t\t\t<span class="badge"\n\t\t\t\t\t\t  data-ng-if="quoteRecord.quote.extendedQuote.lastPriceExchange && quote.length === 1"\n\t\t\t\t\t\t  data-trigger="click"\n\t\t\t\t\t\t  data-container=".svi-bs"\n\t\t\t\t\t\t  data-auto-close="1"\n\t\t\t\t\t\t  data-bs-popover\n\t\t\t\t\t\t  data-toggle="tooltip"\n\t\t\t\t\t\t  data-placement="bottom"\n\t\t\t\t\t\t  href=""\n\t\t\t\t\t\t  data-content="{{quoteRecord.quote.extendedQuote.lastPriceExchange.split(\':\')[1]}}"\n\t\t\t\t\t>{{quoteRecord.quote.extendedQuote.lastPriceExchange.split(\':\')[0]}}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-5 well well-sm" data-ng-class="{\'gain\': quoteRecord.quote.change > 0, \'loss\': quoteRecord.quote.change < 0}">\n\t\t\t\t\t{{ ( quoteRecord.quote.change > 0 ) ? \'+\' : \'\' }}\n\t\t\t\t\t{{quoteRecord.quote.change|sviNumber:2:true}}\n\t\t\t\t\t({{quoteRecord.quote.pctChange|percent:2}})\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="row extendedQuote" data-ng-show="!quoteRecord.unknownSymbol && quoteRecord.instrument.securityType != \'MutualFund\'">\n\t\t\t\t<div class="col-xs-4 bid">\n\t\t\t\t\t<div class="ask-container">\n\t\t\t\t\t\t<div class="value-container">\n\t\t\t\t\t\t\t<div class="dim">{{labels.bidXSize}}</div>\n\t\t\t\t\t\t\t<span class="bright">{{quoteRecord.quote.bidPrice|sviNumber:2:true}} x {{quoteRecord.quote.extendedQuote.bidSize|sviNumber:2}}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class="badge"\n\t\t\t\t\t\t\t  data-ng-if="quoteRecord.quote.extendedQuote.bidPriceExchange && quote.length === 1"\n\t\t\t\t\t\t\t  data-trigger="click"\n\t\t\t\t\t\t\t  data-container=".svi-bs"\n\t\t\t\t\t\t\t  data-auto-close="1"\n\t\t\t\t\t\t\t  data-bs-popover\n\t\t\t\t\t\t\t  data-toggle="tooltip"\n\t\t\t\t\t\t\t  data-placement="bottom"\n\t\t\t\t\t\t\t  href=""\n\t\t\t\t\t\t\t  data-popover-template=""\n\t\t\t\t\t\t\t  data-content="{{quoteRecord.quote.extendedQuote.bidPriceExchange.split(\':\')[1]}}"\n\t\t\t\t\t\t>{{quoteRecord.quote.extendedQuote.bidPriceExchange.split(\':\')[0]}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-4 ask">\n\t\t\t\t\t<div class="ask-container">\n\t\t\t\t\t\t<div class="value-container">\n\t\t\t\t\t\t\t<div class="dim">{{labels.askXSize}}</div>\n\t\t\t\t\t\t\t<span class="bright">{{quoteRecord.quote.askPrice|sviNumber:2:true}} x {{quoteRecord.quote.extendedQuote.askSize|sviNumber:2}}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class="badge"\n\t\t\t\t\t\t\t  data-ng-if="quoteRecord.quote.extendedQuote.askPriceExchange && quote.length === 1"\n\t\t\t\t\t\t\t  data-trigger="click"\n\t\t\t\t\t\t\t  data-container=".svi-bs"\n\t\t\t\t\t\t\t  data-auto-close="1"\n\t\t\t\t\t\t\t  data-bs-popover\n\t\t\t\t\t\t\t  data-toggle="tooltip"\n\t\t\t\t\t\t\t  data-placement="bottom"\n\t\t\t\t\t\t\t  href=""\n\t\t\t\t\t\t\t  data-content="{{quoteRecord.quote.extendedQuote.askPriceExchange.split(\':\')[1]}}"\n\t\t\t\t\t\t>{{quoteRecord.quote.extendedQuote.askPriceExchange.split(\':\')[0]}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="col-xs-4 vol">\n\t\t\t\t\t<span class="dim">{{labels.vol}}</span>\n\t\t\t\t\t<br />\n\t\t\t\t\t<span class="bright">{{quoteRecord.quote.extendedQuote.volume|sviNumber:0:true}}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("priceHistoryChart/priceHistoryChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("priceHistoryChart/priceHistoryChart.tpl.html",'<div class="svi-directive svi-price-history-chart" id="{{::id}}">\n    <h3 class="title" data-ng-bind="labels.priceHistoryChartTitle" data-ng-show="showTitle"></h3>\n    <h4 class="symbol" data-ng-bind="symbol" data-ng-show="showSymbol"></h4>\n    <div data-svi-loader data-callback="setLoader" class="loader-floating"></div>\n    <div class="dropdown-wrapper frequency" data-ng-if="showFrequencySelection">\n        <div class="dropdown-title" data-ng-bind="labels.frequency"></div>\n        <div class="dropdown" role="presentation">\n            <button class="btn btn-default dropdown-toggle highcharts-menu-item"\n                    type="button"\n                    id="chart-type-button"\n                    data-toggle="dropdown"\n                    aria-haspopup="true"\n                    aria-expanded="true"\n            >\n                {{selectedFrequency.text}}\n                <span class="caret"></span>\n            </button>\n            <ul class="dropdown-menu dropdown-menu-right chart-type-dropdown">\n                <li data-ng-repeat="frequency in frequencyOptions">\n                    <a href=""\n                       class="highcharts-menu-item dropdown-item"\n                       data-ng-click="selectFrequency(frequency)"\n                    >\n                        <span data-ng-bind="frequency.text"\n                              class="highcharts-menu-item-title"></span>\n                    </a>\n                </li>\n            </ul>\n        </div>\n    </div>\n    <div class="marker-hours-toggler" data-ng-show="showActiveMarketHoursToggler">\n        <label>\n            <input type="checkbox" data-ng-model="showAfterMarketActivity">\n            {{labels.afterMarketTradingActivity}}\n        </label>\n    </div>\n    <div class="chart-wrapper">\n        <div class="chart-inner">\n            <a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n            <div class="chart"></div>\n        </div>\n    </div>\n    <div data-ng-if="showDisclaimer" class="disclaimer">\n        <span data-ng-bind="labels.disclaimer"></span>: {{symbol}}\n    </div>\n</div>\n')}]),angular.module("priceHistoryChart/priceHistoryWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("priceHistoryChart/priceHistoryWidget.tpl.html",'<div class="svi-directive svi-price-history-widget" data-svi-widget data-title="labels.priceHistoryChartTitle" id="{{::id}}">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div data-svi-loader data-callback="setLoader" class="loader-floating" data-ignore-invisible="true"></div>\n                    <h4 class="symbol" data-ng-bind="symbol" data-ng-show="showSymbol"></h4>\n                    <div class="dropdown-wrapper frequency" data-ng-if="showFrequencySelection">\n                        <div class="dropdown-title" data-ng-bind="labels.frequency"></div>\n                        <div class="dropdown" role="presentation">\n                            <button class="btn btn-default dropdown-toggle highcharts-menu-item"\n                                    type="button"\n                                    id="chart-type-button"\n                                    data-toggle="dropdown"\n                                    aria-haspopup="true"\n                                    aria-expanded="true"\n                            >\n                                {{selectedFrequency.text}}\n                                <span class="caret"></span>\n                            </button>\n                            <ul class="dropdown-menu dropdown-menu-right chart-type-dropdown">\n                                <li data-ng-repeat="frequency in frequencyOptions">\n                                    <a href=""\n                                       class="highcharts-menu-item dropdown-item"\n                                       data-ng-click="selectFrequency(frequency)"\n                                    >\n                        <span data-ng-bind="frequency.text"\n                              class="highcharts-menu-item-title"></span>\n                                    </a>\n                                </li>\n                            </ul>\n                        </div>\n                    </div>\n                    <div class="marker-hours-toggler" data-ng-show="showActiveMarketHoursToggler">\n                        <label>\n                            <input type="checkbox" data-ng-model="showAfterMarketActivity">\n                            {{labels.afterMarketTradingActivity}}\n                        </label>\n                    </div>\n                    <div class="chart-wrapper">\n                        <div class="chart-inner">\n                            <a class="svi-visually-hidden" data-svi-skip-link="#{{::id}} .highcharts-contextbutton">Skip to chart export menu.</a>\n                            <div class="chart"></div>\n                        </div>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>\n')}]),angular.module("snapQuote/popover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("snapQuote/popover.tpl.html",'<div class="svi-directive svi-snap-quote-popover popover" id="{{::id}}" data-svi-click-outside="api.hideQuote()">\n\t<div class="arrow"></div>\n\t<div class="popover-content">\n\t\t<div data-svi-detailed-quote\n\t\t     data-template="newPopover"\n\t\t     data-symbol="{{title}}"\n\t\t     data-use-cache="false"\n\t\t     data-id="{{::id}}"></div>\n\t</div>\n\t<a class="svi-visually-hidden"\n       data-svi-skip-link=".svi-snap-quote .tt-input"\n       data-callback="api.hideQuote"\n       data-ng-bind="labels.returnFromQuotePopup"></a>\n</div>\n')}]),angular.module("snapQuote/snapQuote.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("snapQuote/snapQuote.tpl.html",'<div class="svi-directive svi-snap-quote">\n\t<div data-svi-input-symbol\n\t     data-id="{{::id}}"\n\t     data-comm="inputSymbolComm"\n\t     data-placeholder="{{labels.snapQuotePlaceholder}}"\n\t     data-input-cls="form-control"\n\t     data-ng-model="symbol"\n\t     data-osi="{{osi}}"\n\t     data-ng-model-options="{allowInvalid: true}"\n\t     data-enable-lookup="{{symbolLookup}}"\n\t     data-autocomplete-event-name="GET.SNAP.QUOTE.POPOVER"\n\t     data-manual-submit="true"></div>\n\t<button class="btn btn-sm btn-primary quote-button"\n\t        data-ng-click="api.go()"\n\t        aria-label="{{labels.snapQuoteGo}}">\n\t\t<span class="glyphicon glyphicon-chevron-right"></span>\n\t</button>\n\t<div class="svi-visually-hidden"\n\t     aria-live="polite"\n\t     data-ng-bind="ariaMessage"></div>\n</div>\n')}]),angular.module("sparklineChart/sparklineChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("sparklineChart/sparklineChart.tpl.html",'<div class="svi-directive svi-sparkline-chart" id="{{::id}}">\n\t<div data-svi-loader data-callback="setLoader" class="loader-floating"></div>\n\t<div class="chart-wrapper">\n\t\t<div class="chart-inner">\n\t\t\t<div class="sparkline-chart"></div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("symbolLookup/popover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolLookup/popover.tpl.html",'<div class="svi-directive svi-symbol-lookup-popover popover" id="{{::id}}" data-svi-click-outside="api.hideSearch()">\n\t<div class="arrow"></div>\n\t<div class="popover-content">\n\t\t<div data-svi-symbol-lookup-grid data-search="{{title}}" data-id="{{::id}}"></div>\n\t</div>\n</div>')}]),angular.module("symbolLookup/symbolLookup.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolLookup/symbolLookup.tpl.html",'<div class="svi-directive svi-symbol-lookup">\n\t<input type="text" aria-label="symbol lookup" name="{{name}}" data-ng-class="inputCls" data-ng-model="value" placeholder="{{labels.symbolLookupInputPlaceholder}}"/>\n</div>')}]),angular.module("symbolLookupGrid/symbolLookupGrid.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolLookupGrid/symbolLookupGrid.tpl.html",'<div class="svi-directive svi-symbol-lookup-grid row">\n    <div data-svi-loader data-callback="setLoader"></div>\n\n    <div class="col-md-12" data-ng-show="symbols.length">\n        <div class="svi-visually-hidden" aria-live="polite" data-ng-bind="ariaMsg"></div>\n        <table class="table table-striped svi-symbol-lookup-grid-table">\n            <thead>\n                <tr>\n                    <th data-svi-column-header data-sortable="false" data-text="labels.symbol"></th>\n                    <th data-svi-column-header data-sortable="false" data-text="labels.companyName"></th>\n                    <th data-svi-column-header data-sortable="false" data-text="labels.exchange" class="hidden-xs"></th>\n                </tr>\n            </thead>\n            <tbody>\n                <tr data-ng-repeat="item in symbols">\n                    <td><span data-ng-bind-html="item.symbol|ellipsis:10:true" data-ng-click="api.selectSymbol(item.symbol)"></span></td>\n\t\t\t\t\t<td><span data-ng-bind-html="item.name|ellipsis:32:true" data-ng-click="api.selectSymbol(item.symbol)"></span></td>\n\t\t\t\t\t<td class="hidden-xs"><span data-ng-bind="item.exchange" data-ng-click="api.selectSymbol(item.symbol)"></span></td>\n                </tr>\n            </tbody>\n        </table>\n    </div>\n\n\t<div class="paging-bottom" data-ng-show="pageSize && showPaging">\n\t\t<div class="col-md-12" data-svi-paging-control data-event-id="SYMBOL_LOOKUP" data-current-page="currentPage" data-total-pages="totalPages" data-max-buttons="6"></div>\n\t</div>\n</div>')}]),angular.module("symbolNews/symbolNews.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolNews/symbolNews.tpl.html",'<div class="svi-directive svi-symbol-news">\n\t\t<h3 class="title" data-ng-show="showTitle && (allowOverall || hasSymbol())">\n\t\t\t{{title}}\n\t\t\t<div class="pull-right" data-ng-show="allowOverall && hasSymbol() && showSymbol">\n\t\t\t\t{{symbol}}\n\t\t\t\t<div data-ng-click="symbol=\'\'" class="super-close pull-right" title="{{labels.symbolNewsReturnToOverview}}" aria-label="{{labels.symbolNewsReturnToOverview}}">x</div>\n\t\t\t</div>\n\t\t</h3>\n\t%NEWS_CONTENT%\n</div>')}]),angular.module("symbolNews/symbolNewsContent.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolNews/symbolNewsContent.tpl.html",'<div data-svi-loader data-callback="api.setLoader" data-ignore-invisible="true"></div>\n<span data-ng-show="!showOnlyNewsTextFlag">\n\t<div data-svi-tabs data-arrows-enabled="false" data-auto-height="true" data-ng-if="showSourceFilter" data-ng-class="{ \'two-columns\': horizontal }" >\n    <div data-ng-repeat="type in newsTypes"\n         class="item" data-tab-title="{{labels[type]}}"\n         data-svi-symbol-news\n         data-symbol="{{symbol}}"\n         data-event-name="{{eventName}}"\n         data-allow-overall="{{allowOverall}}"\n         data-show-title="false"\n         data-show-source-filter="false"\n         data-use-modal="{{useModal}}"\n         data-show-only-news-text="{{showOnlyNewsText}}"\n         data-event-to-show-only-news-text="{{\'.EVENT.\' + $index}}"\n         data-news-type="{{type}}"\n         data-event-id="{{eventId}}"\n         data-limit="{{limit}}"\n         data-limit-display="{{limitDisplay}}"></div>\n\t</div>\n\n\t<div data-ng-if="!showSourceFilter">\n\t    <div data-ng-show="newsItems">\n\t        <div class="panel-group news-headlines-container" id="accordion-{{::id}}">\n\t            <div class="panel panel-default"\n\t                 data-ng-repeat="item in newsItems | limitTo : (((showMore || limitDisplay == 0) ? limit : limitDisplay) || 9999)">\n\t                <div class="panel-heading">\n\t                    <div class="panel-title">\n\t                        <div class="news-source" data-ng-bind="::item.source"></div>\n\t                        <div class="news-date" data-ng-bind="::(item.dateTime | date:\'MM/dd/yyyy hh:mm a\')"></div>\n\t                        <a data-ng-if="useModal"\n\t                           class="story-link" data-ng-class="{ \'has-image\': item.image.imageURL}"\n\t                           data-toggle="modal" role="button"\n\t                           id="{{::id}}-story-{{item.storyID}}"\n\t                           data-ng-click="displayModal(item.storyID, item.headline, item.dateTime)"\n\t                           data-parent="#accordion-{{::id}}"\n\t                           href="" data-target="#{{::id}}-storyModal">\n\t                            <span role="presentation" class="news-headline" data-ng-bind-html="::(item.headline | trustedHtml)"></span>\n\t                        </a>\n\t                        <a data-ng-if="!useModal && !showOnlyNewsText"\n\t                           class="story-link" data-ng-class="{ \'has-image\': item.image.imageURL}"\n\t                           id="{{::id}}-story-{{item.storyID}}-inpage"\n\t                           role="button" data-toggle="collapse"\n\t                           data-parent="#accordion-{{::id}}"\n\t                           href="#{{::id}}-panel-{{item.storyID}}">\n\t                            <span role="presentation" aria-level="4" class="news-headline" data-ng-bind-html="::(item.headline | trustedHtml)"></span>\n\t                        </a>\n\t\t                    <a data-ng-if="!useModal && showOnlyNewsText"\n\t\t                       class="story-link" data-ng-class="{ \'has-image\': item.image.imageURL}"\n\t\t                       id="{{::id}}-story-{{item.storyID}}-inpage"\n\t\t                       data-ng-click="displayOnlyText(item.storyID, item.headline, item.dateTime)"\n\t\t                       role="button"\n\t\t                       href="">\n\t                            <span role="presentation" aria-level="4" class="news-headline" data-ng-bind-html="::(item.headline | trustedHtml)"></span>\n\t                        </a>\n\t                        <p data-ng-if="::item.summary" class="news-summary" data-ng-bind-html="::(item.summary | trustedHtml)"></p>\n\t                    </div>\n\t                </div>\n\t                <div data-ng-if="!useModal" id="{{::id}}-panel-{{item.storyID}}"\n\t                     class="panel-collapse collapse">\n\t                    <div class="panel-body story-container" id="{{::id}}-story-{{item.storyID}}">\n\t                        <div class="loader">\n\t                            <div class="well spinner"><i class="fa fa-2x fa-spinner fa-spin"></i> <span\n\t\t\t                            data-ng-bind="labels.loading"></span>...\n\t                            </div>\n\t                        </div>\n\t                    </div>\n\t                </div>\n\t            </div>\n\t        </div>\n\t        <div class="more-less-banner" data-ng-show="limitDisplay > 0">\n\t            <button type="button" class="btn btn-lg btn-link" aria-expanded="{{ showMore ? \'true\' : \'false\'}}"\n\t                    data-ng-click="showMoreLess()" aria-controls="{{::id}}">\n\t                {{ showMore ? labels.less : labels.more }}\n\t                <span class="glyphicon" data-ng-class="{\'glyphicon-chevron-up\': showMore, \'glyphicon-chevron-down\': !showMore}"></span>\n\t            </button>\n\t            <div class="svi-visually-hidden" aria-live="polite">{{ describShowMoreLess }}</div>\n\t        </div>\n\t    </div>\n\t</div>\n</span>\n<div class="show-only-news-text" data-ng-show="showOnlyNewsTextFlag">\n\t<div class="loader" data-ng-show="showLoader">\n\t\t<div class="well spinner"><i class="fa fa-2x fa-spinner fa-spin"></i> <span data-ng-bind="labels.loading" class="ng-binding">Loading</span>...</div>\n\t</div>\n\t<a href="javascript:void(0)" class="back-to-all-news-links" data-ng-show="!showLoader && storyHtmlNewsParts.length > 1" data-ng-click="returnToNewsList()" data-ng-bind="labels.backToAllNews"></a>\n\t<hr data-ng-show="!showLoader && storyHtmlNewsParts.length > 1" />\n\t<div class="news-title" data-ng-bind-html="headline" data-ng-if="!showLoader && prevNewsStoryIndex === false"></div>\n\t<div class="single-news-date" data-ng-bind="dateTime | date:\'MM/dd/yyyy hh:mm a\'" data-ng-if="!showLoader && prevNewsStoryIndex === false"></div>\n\n\t<a href="javascript:void(0)" class="prev-next-links" data-ng-if="prevNewsStoryIndex !== false" data-ng-click="showPrevNewsPart(prevNewsStoryIndex)">\n\t\t<i class="glyphicon glyphicon-chevron-up"></i>\n\t\t<span data-ng-bind="labels.readAbove"></span>\n\t</a>\n\t<div class="news-text-wrapper" data-ng-bind-html="storyHtml"></div>\n\t<a href="javascript:void(0)" class="prev-next-links" data-ng-if="nextNewsStoryIndex !== false" data-ng-click="showNextNewsPart(nextNewsStoryIndex)">\n\t\t<span data-ng-bind="labels.readMore"></span> <i class="glyphicon glyphicon-chevron-down"></i>\n\t</a>\n\t<hr data-ng-show="!showLoader" />\n\t<a href="javascript:void(0)" class="back-to-all-news-links" data-ng-show="!showLoader" data-ng-click="returnToNewsList()" data-ng-bind="labels.backToAllNews"></a>\n</div>\n')}]),angular.module("symbolNews/symbolNewsModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolNews/symbolNewsModal.tpl.html",'<div class="svi-directive modal svi-news-modal" data-backdrop-limit="1" tabindex="-1" role="dialog" id="{{::id}}-storyModal" aria-labelledby="{{::id}}-modalTitle">\n\t<div class="modal-dialog modal-lg" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 id="{{::id}}-modalTitle" class="modal-title" data-ng-bind-html="title|ellipsis:60"></h1>\n\t\t\t\t<button class="close dim glyphicon glyphicon-remove pointer" data-dismiss="modal" role="button" tabindex="0" aria-label="Close"></button>\n\t\t\t</div>\n\t\t\t<div class="modal-body" id="{{::id}}">\n\t\t\t\t<div class="loader" data-ng-show="showLoader">\n\t\t\t\t\t<div class="well spinner"><i class="fa fa-2x fa-spinner fa-spin"></i> <span data-ng-bind="labels.loading" class="ng-binding">Loading</span>...</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="modal-news-title" data-ng-bind-html="title" data-ng-if="!showLoader"></div>\n\t\t\t\t<div class="single-news-date" data-ng-bind="dateTime | date:\'MM/dd/yyyy hh:mm a\'" data-ng-if="!showLoader"></div>\n\t\t\t\t<div class="story-container" id="{{::id}}-story"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-footer">\n\t\t\t\t <button type="button" class="btn btn-primary close-modal" data-dismiss="modal" data-ng-bind="close"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("symbolNews/symbolNewsTwoColumns.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolNews/symbolNewsTwoColumns.tpl.html",'<div class="svi-directive svi-symbol-news" data-svi-widget data-title="title" data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    %NEWS_CONTENT%\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("symbolNews/symbolNewsWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolNews/symbolNewsWidget.tpl.html",'<div class="svi-directive svi-symbol-news" data-svi-widget data-title="title" data-include-loader="false" data-max-size="{{maxSize}}">\n\t<svi:widget-front>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<h4 class="pull-right" data-ng-show="allowOverall && hasSymbol()">\n\t\t\t\t\t\t{{symbol}}\n\t\t\t\t\t\t<div data-ng-click="symbol=\'\'" class="super-close pull-right" title="{{labels.symbolNewsReturnToOverview}}" aria-label="{{labels.symbolNewsReturnToOverview}}">x</div>\n\t\t\t\t\t</h4>\n\t\t\t\t\t%NEWS_CONTENT%\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("symbolOrderStatus/symbolOrderStatus.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolOrderStatus/symbolOrderStatus.tpl.html",'<div class="svi-directive svi-symbol-order-status">\n    <h3 class="title" data-ng-bind="labels.symbolOrderStatusTitle" data-ng-show="showTitle"></h3>\n    <div data-svi-loader data-callback="setLoader"></div>\n    <div data-ng-show="loaded">\n        <table class="table table-striped svi-symbol-order-status-grid-table" data-ng-model="symbolOrderStatus">\n            <thead>\n            <tr>\n                <th data-ng-bind-html="labels.date"></th>\n                <th data-ng-bind-html="labels.description"></th>\n                <th data-ng-bind-html="labels.status"></th>\n            </tr>\n            </thead>\n            <tbody>\n            <tr data-ng-repeat="order in orders">\n                <td data-ng-bind-html="order.originDateTime|fancyDate"></td>\n                <td>\x3c!-- these html comments are here to prevent extra whitespace\n                    --\x3e<span data-ng-bind="order.order.action|transactionType"></span> \x3c!--\n                    --\x3e<span data-ng-bind="getDesc(order)"></span> \x3c!--\n                    --\x3eQTY <span data-ng-bind="order.order.quantity|sviNumber:3"></span> \x3c!--\n                    --\x3e<span data-ng-if="order.order.orderType != \'Limit\' && order.order.orderType != \'Stop\' && order.order.orderType != \'StopLimit\'"\n                          data-ng-bind="order.order.orderType|labels:labels"></span>\x3c!--\n                    --\x3e<span data-ng-if="order.order.orderType == \'Limit\'">{{order.order.orderType|labels:labels}} {{order.order.price|sviCurrency}}</span>\x3c!--\n                    --\x3e<span data-ng-if="order.order.orderType == \'Stop\'">{{order.order.orderType|labels:labels}} {{order.order.stopPrice|sviCurrency}}</span>\x3c!--\n                    --\x3e<span data-ng-if="order.order.orderType == \'StopLimit\'">{{\'Stop\'|labels:labels}} {{order.order.stopPrice|sviCurrency}} {{\'Limit\'|labels:labels}} {{order.order.price|sviCurrency}}</span> \x3c!--\n                    --\x3e<span data-ng-if="order.order.duration == \'GTD\'">{{order.order.duration|labels:labels}} {{order.order.expireDate|sviDate}}</span>\x3c!--\n                    --\x3e<span data-ng-if="order.order.duration != \'GTD\'" data-ng-bind="order.order.duration|labels:labels"></span>\x3c!--\n                --\x3e</td>\n                <td data-ng-bind-html="order.orderStatus|labels:labels"></td>\n            </tr>\n            </tbody>\n        </table>\n    </div>\n</div>')}]),angular.module("symbolOrderStatus/symbolOrderStatusWidget.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("symbolOrderStatus/symbolOrderStatusWidget.tpl.html",'<div class="svi-directive svi-symbol-order-status-history" data-svi-widget data-title="labels.symbolOrderStatusTitle"\n     data-include-loader="false">\n    <svi:widget-front>\n        <div class="list-body">\n            <ul class="list-group">\n                <li class="list-group-item">\n                    <div class="loader" data-svi-loader data-callback="setLoader"></div>\n                    <div class="svi-symbol-order-status-grid-table-wrapper" data-ng-if="loaded">\n                        <table class="table table-striped svi-symbol-order-status-grid-table" data-ng-model="symbolOrderStatus">\n                            <thead>\n                            <tr>\n                                <th data-ng-bind-html="labels.date"></th>\n                                <th data-ng-bind-html="labels.description"></th>\n                                <th data-ng-bind-html="labels.status"></th>\n                            </tr>\n                            </thead>\n                            <tbody>\n                            <tr data-ng-repeat="order in orders">\n                                <td data-ng-bind-html="order.originDateTime|fancyDate"></td>\n                                <td>\n                                    <span data-ng-bind="order.order.action|transactionType"></span>\n                                    <span data-ng-bind="getDesc(order)"></span>\n                                    <span data-ng-bind="order.order.quantity|sviNumber:3"></span>\n                                    <span data-ng-if="order.order.orderType != \'Limit\' && order.order.orderType != \'Stop\' && order.order.orderType != \'StopLimit\'"\n                                          data-ng-bind="order.order.orderType|labels:labels"></span>\n                                    <span data-ng-if="order.order.orderType == \'Limit\'">{{order.order.orderType | labels:labels}} {{order.order.price | sviCurrency}}</span>\n                                    <span data-ng-if="order.order.orderType == \'Stop\'">{{order.order.orderType | labels:labels}} {{order.order.stopPrice | sviCurrency}}</span>\n                                    <span data-ng-if="order.order.orderType == \'StopLimit\'">\n                                        {{\'Stop\' | labels:labels}} {{order.order.stopPrice | sviCurrency}} {{\'Limit\' | labels:labels}} {{order.order.price | sviCurrency}}\n                                    </span>\n                                    <span data-ng-if="order.order.duration == \'GTD\'">{{order.order.duration | labels:labels}} {{order.order.expireDate | sviDate}}</span>\n                                    <span data-ng-if="order.order.duration != \'GTD\'"\n                                          data-ng-bind="order.order.duration|labels:labels"></span>\n                                </td>\n                                <td data-ng-bind-html="order.orderStatus|labels:labels"></td>\n                            </tr>\n                            </tbody>\n                        </table>\n                    </div>\n                </li>\n            </ul>\n        </div>\n    </svi:widget-front>\n</div>')}]),angular.module("watchlist/deleteWatchlistPopover.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("watchlist/deleteWatchlistPopover.tpl.html",'<div class="svi-directive svi-delete-watchlist-popover popover">\n\t<div class="arrow"></div>\n\t<div class="popover-content">\n\t\t<p data-ng-bind="title"></p>\n\t\t<div class="watchlist-confirm-buttons">\n\t\t\t<button type="button" data-ng-click="api.deleteWatchlist()" class="btn btn-danger watchlist-confirm-delete" data-ng-bind="labels.watchlistDelete"></button>\n\t\t\t<button type="button" data-ng-click="api.hideDeleteWatchlistPopover()" class="btn btn-default watchlist-confirm-cancel" data-ng-bind="labels.watchlistConfirmCancel"></button>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("watchlist/watchlist.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("watchlist/watchlist.tpl.html",'<div class="svi-directive svi-watchlist" data-svi-widget data-title="labels.watchlistTitle" data-min-size="{{minWidgetSize}}" data-include-loader="false">\n\t<svi:widget-front>\n\t\t<div class="loader" data-svi-loader data-callback="setLoader"></div>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item alert alert-warning" data-ng-if="!loader.showSpinner && !watchlist.length" data-ng-bind="labels.watchlistNoSymbols"></li>\n\t\t\t\t<li class="list-group-item" data-ng-if="watchlist.length">\n\t\t\t\t\t<table class="table table-striped svi-watchlist-grid-table">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th data-svi-column-header data-sortable="false" data-text="labels.symbol"></th>\n\t\t\t\t\t\t\t<th class="currency" data-svi-column-header data-sortable="false" data-text="labels.lastPrice"></th>\n\t\t\t\t\t\t\t<th class="currency" data-svi-column-header data-sortable="false" data-text="labels.change"></th>\n\t\t\t\t\t\t\t<th class="number" data-svi-column-header data-sortable="false" data-text="labels.pctChange"></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr data-ng-repeat="item in watchlist">\n\t\t\t\t\t\t\t<td role="rowheader" class="symbol-wrapper" data-svi-symbol  data-instrument="item.instrument" data-display-length="8"></td>\n\t\t\t\t\t\t\t<td class="currency hidden-xs" data-ng-bind-html="item.quote.lastPrice|sviCurrency"></td>\n\t\t\t\t\t\t\t<td class="currency hidden-sm hidden-md hidden-lg" data-ng-bind-html="item.quote.lastPrice|sviCurrency:null:null:{0:2,6:0}"></td>\n\t\t\t\t\t\t\t<td class="currency" data-ng-bind-html="item.quote.change|currencyChange"></td>\n\t\t\t\t\t\t\t<td class="number" data-ng-bind-html="item.quote.pctChange|percentIndicator"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t<div class="disclaimer" data-ng-bind="labels.watchlistDelayedQuoteDisclaimer"></div>\n\t\t\t\t</li>\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="setSymbolLoader"></div>\n\t\t\t\t\t<div class="add-symbol" data-ng-if="::(!viewMode)" data-ng-show="!symbolLoader.showSpinner">\n\t\t\t\t\t\t<form data-ng-submit="api.addSymbol()">\n\t\t\t\t\t\t\t<div data-svi-input-symbol class="col-xs-9 col-sm-10"\n\t\t\t\t\t\t\t\t data-comm="inputSymbolComm"\n\t\t\t\t\t\t\t\t data-placeholder="{{labels.watchlistEntryPlaceholder}}"\n\t\t\t\t\t\t\t\t data-input-cls="form-control"\n\t\t\t\t\t\t\t\t data-enable-lookup="false"\n\t\t\t\t\t\t\t\t data-ng-model="data.symbolFront"\n\t\t\t\t\t\t\t\t data-ng-model-options="{allowInvalid: true}"></div>\n\t\t\t\t\t\t\t<button class="col-xs-3 col-sm-2 btn btn-sm btn-primary watchlist-add-button" type="submit">\n\t\t\t\t\t\t\t\t<span class="glyphicon glyphicon-plus"></span>&nbsp;{{labels.watchlistAddSymbolBtn}}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n\t<svi:widget-back>\n\t\t<div class="list-body">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader data-callback="setWatchlistLoader"></div>\n\t\t\t\t\t<div class="form-group" data-ng-if="!watchlistLoader.showSpinner">\n\t\t\t\t\t\t<label class="control-label" data-ng-bind="labels.watchlistList"></label>\n\t\t\t\t\t\t<div class="watchlist-select btn-group dropdown">\n\t\t\t\t\t\t\t<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">\n\t\t\t\t\t\t\t\t{{watchlistName}} {{watchlistName == defaultWatchlist ? labels.watchlistDefaultIndicator : \'\'}}\n\t\t\t\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<ul class="dropdown-menu">\n\t\t\t\t\t\t\t\t<li data-ng-repeat="option in watchlistList">\n\t\t\t\t\t\t\t\t\t<a tabindex="-1" href="" data-ng-click="api.switchWatchlist(option.name)">{{option.name}} - {{option.securities.length}} {{labels.watchlistSecurities}} {{option.name == defaultWatchlist ? labels.watchlistDefaultIndicator : \'\'}}</a>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<form data-ng-submit="api.createWatchlist(data.newWatchlistName)">\n\t\t\t\t\t\t<div class="watchlist-create input-group" data-ng-show="!watchlistLoader.showSpinner">\n\t\t\t\t\t\t\t<input type="text"\n\t\t\t\t\t\t\t\t   aria-label="watchlist create entry"\n\t\t\t\t\t\t\t\t   class="form-control watchlist-create-entry"\n\t\t\t\t\t\t\t\t   maxlength="25"\n\t\t\t\t\t\t\t\t   data-ng-model="data.newWatchlistName"\n\t\t\t\t\t\t\t\t   placeholder="{{labels.createWatchlistPlaceholder}}" />\n\t\t\t\t\t\t\t\t\t<span class="input-group-btn">\n\t\t\t\t\t\t\t\t\t\t<button class="btn btn-primary watchlist-create-button" type="submit">\n\t\t\t\t\t\t\t\t\t\t\t<span class="glyphicon glyphicon-plus"></span>&nbsp;{{labels.createWatchlistBtn}}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t</li>\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="loader" data-svi-loader\n\t\t\t\t\t\t data-comm="{ showSpinner: loader.showSpinner, message: loader.message, warning: loader.warning, error: loader.error, retrying: loader.retrying }"></div>\n\t\t\t\t\t<div class="alert alert-warning" data-ng-if="!loader.showSpinner && !watchlist.length" data-ng-bind="labels.watchlistNoSymbols"></div>\n\t\t\t\t\t<div class="watchlist-list" data-ng-if="!loader.showSpinner && watchlist.length">\n\t\t\t\t\t\t<table class="table table-striped svi-watchlist-edit-table">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th data-svi-column-header data-sortable="false" data-text="labels.symbol"></th>\n\t\t\t\t\t\t\t\t<th class="remove-symbol" data-svi-column-header data-sortable="false" data-text="labels.remove"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr data-ng-repeat="item in watchlist">\n\t\t\t\t\t\t\t\t<td role="rowheader" data-svi-symbol data-instrument="item.instrument" data-display-length="30"></td>\n\t\t\t\t\t\t\t\t<td class="remove-symbol"><span class="glyphicon glyphicon-remove" data-ng-click="api.removeSymbol(item.instrument.symbol)"></span></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class="loader" data-svi-loader\n\t\t\t\t\t\t data-comm="{ showSpinner: symbolLoader.showSpinner, message: symbolLoader.message, warning: symbolLoader.warning, error: symbolLoader.error, retrying: symbolLoader.retrying }"></div>\n\t\t\t\t\t<div class="add-symbol" data-ng-show="!symbolLoader.showSpinner">\n\t\t\t\t\t\t<form data-ng-submit="api.addSymbol()">\n\t\t\t\t\t\t\t<div data-svi-input-symbol class="col-xs-9 col-sm-10"\n\t\t\t\t\t\t\t\t data-comm="inputSymbolCommBack"\n\t\t\t\t\t\t\t\t data-placeholder="{{labels.watchlistEntryPlaceholder}}"\n\t\t\t\t\t\t\t\t data-input-cls="form-control"\n\t\t\t\t\t\t\t\t data-enable-lookup="false"\n\t\t\t\t\t\t\t\t data-ng-model="data.symbolBack"\n\t\t\t\t\t\t\t\t data-ng-model-options="{allowInvalid: true}"></div>\n\t\t\t\t\t\t\t<button class="col-xs-3 col-sm-2 btn btn-sm btn-primary watchlist-add-button" type="submit">\n\t\t\t\t\t\t\t\t<span class="glyphicon glyphicon-plus"></span>&nbsp;{{labels.watchlistAddSymbolBtn}}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<div class="form-group">\n\t\t\t\t\t\t<label class="control-label watchlist-buttons-label" data-ng-bind="labels.watchlistActions"></label>\n\t\t\t\t\t\t<div class="watchlist-buttons">\n\t\t\t\t\t\t\t<button type="button" data-ng-click="api.showDeleteWatchlistPopover()" class="btn btn-danger watchlist-delete" data-ng-bind="labels.watchlistDelete"></button>\n\t\t\t\t\t\t\t<button type="button" data-ng-click="api.setDefaultWatchlist()" class="btn btn-info watchlist-default" data-ng-bind="labels.setDefaultWatchlist"></button>\n\t\t\t\t\t\t\t<button type="button" data-ng-click="api.hideSettings()" class="btn btn-primary pull-right watchlist-view" data-ng-bind="labels.viewWatchlist"></button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-back>\n\t<svi:widget-shortcuts>\n\t\t<span data-ng-if="::(!viewMode)" class="settingsButton settings-icon glyphicon glyphicon-cog" data-ng-click="api.toggleSettings()" role="button" type="button" aria-label="{{labels.watchlistView}}"></span>\n\t</svi:widget-shortcuts>\n</div>')}]),angular.module("templates-trading",["bonusTrades/bonusTrades.tpl.html","bonusTradesModal/bonusTradesModal.tpl.html","prospectusDisplay/prospectusDisplay.tpl.html","prospectusDisplay/prospectusDisplayModal.tpl.html","tradeMenu/tradeMenu.tpl.html","tradePricing/tradePricing.tpl.html","tradeWidget/tradeWidgetInline.tpl.html","tradeWidget/tradeWidgetModal.tpl.html","tradeWidget/tradeWidgetTradingForm.tpl.html"]),angular.module("bonusTrades/bonusTrades.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("bonusTrades/bonusTrades.tpl.html",'<div class="svi-directive bonus-trades" data-ng-show="bonusTrades && bonusTrades.wasEligible">\n\t<h3 data-ng-if="::showTitle" class="header-title title" data-ng-bind="labels.bonusTradesTitle"></h3>\n\t<div data-svi-loader data-callback="setLoader" data-ignore-invisible="true"></div>\n\t<dl class="dl-horizontal col-md-12 col-sm-12 col-xs-12">\n\t\t<dt class="bonus-trades-count col-md-6 col-sm-6 col-xs-6" data-ng-bind="labels.bonusTrades"></dt>\n\t\t<dd class="bonus-trades-count col-md-6 col-sm-6 col-xs-6"><a href="" data-bs-tooltip data-title="{{labels.bonusTradesLinkTooltip}}" aria-label="{{labels.bonusTradesLinkTooltip}}" data-ng-bind="bonusTrades.number" data-ng-click="launchDetailModal();"></a></dd>\n\t\t<dt data-ng-if="showExpiration" class="bonus-trades-expiration col-md-6 col-sm-6 col-xs-6" data-ng-bind="labels.bonusTradesExpiryDate"></dt>\n\t\t<dd data-ng-if="showExpiration" class="bonus-trades-expiration col-md-6 col-sm-6 col-xs-6" data-ng-bind="bonusTrades.expiration|sviDate"></dd>\n\t</dl>\n</div>')}]),angular.module("bonusTradesModal/bonusTradesModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("bonusTradesModal/bonusTradesModal.tpl.html",'<div class="svi-directive svi-bonus-trades-modal" data-svi-modal data-event-name="BONUS_TRADES" data-title="{{getTitle()}}" data-size="lg">\n\t<svi:modal-body>\n\t\t<div data-svi-loader data-callback="setLoader" data-ignore-invisible="true"></div>\n\t\t<div data-ng-if="bonusTrades && bonusTrades.eligibility.length > 0">\n\t\t\t<dl class="dl-horizontal">\n\t\t\t\t<dt class="bonus-trades-eligible" data-ng-bind="::labels.bonusTradesDetailEligible"></dt>\n\t\t\t\t<dd class="bonus-trades-eligible" data-ng-bind="bonusTrades.eligibility[0].eligibleForBonusTradesNow|sviBoolean"></dd>\n\t\t\t\t<dt class="bonus-trades-count" data-ng-bind="::labels.bonusTrades"></dt>\n\t\t\t\t<dd class="bonus-trades-count" data-ng-bind="bonusTrades.eligibility[0].availableBonusTrades"></dd>\n\t\t\t\t<dt data-ng-if="::showExpiration" class="bonus-trades-expiration" data-ng-bind="::labels.bonusTradesExpiryDate"></dt>\n\t\t\t\t<dd data-ng-if="::showExpiration" class="bonus-trades-expiration" data-ng-bind="bonusTrades.eligibility[0].expirationDate|sviDate"></dd>\n\t\t\t\t<dt class="bonus-trades-used" data-ng-bind="::labels.bonusTradesUsedThisMonth"></dt>\n\t\t\t\t<dd class="bonus-trades-used" data-ng-bind="bonusTrades.bonusTradesUsedThisMonth"></dd>\n\t\t\t</dl>\n\t\t</div>\n\t\t<div data-ng-if="bonusTrades && bonusTrades.eligibility.length == 0">\n\t\t\t<dl class="dl-horizontal">\n\t\t\t\t<dt class="bonus-trades-eligible" data-ng-bind="::labels.bonusTradesDetailEligible"></dt>\n\t\t\t\t<dd class="bonus-trades-eligible" data-ng-bind="::false|sviBoolean"></dd>\n\t\t\t\t<dt class="bonus-trades-used" data-ng-bind="::labels.bonusTradesUsedThisMonth"></dt>\n\t\t\t\t<dd class="bonus-trades-used" data-ng-bind="bonusTrades.bonusTradesUsedThisMonth"></dd>\n\t\t\t</dl>\n\t\t</div>\n\t\t<hr/>\n\t\t<h3 data-ng-show="bonusTrades" data-ng-bind="::labels.bonusTradesActivity"></h3>\n\t\t<div data-ng-if="bonusTrades && bonusTrades.orderStatus.length == 0" class="well" data-ng-bind="::labels.bonusTradesNoActivity"></div>\n\t\t<div data-ng-if="bonusTrades && bonusTrades.orderStatus.length > 0" class="bonus-trades-orders">\n\t\t\t<table class="table table-striped bonus-trades-orders-grid-table">\n\t\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="orderDate" data-text="labels.orderDate" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="orderDate"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="orderID" data-text="labels.orderID" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="orderID"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="order.action" data-text="labels.action" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="action"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="order.instrument.symbol" data-text="labels.symbol" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="symbol"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="order.instrument.desc" data-text="labels.desc" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="desc"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="order.quantity" data-text="labels.quantity" data-sorted-field="sortField" data-sorted-dir="sortDir" class="number" data-col-name="quantity"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="order.orderType" data-text="labels.orderType" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="orderType"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="order.duration" data-text="labels.duration" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="duration"></th>\n\t\t\t\t\t<th data-svi-column-header data-event-id="BT_ACTIVITY" data-sortable="{{sortable}}" data-sort-field="orderStatus" data-text="labels.orderStatus" data-sorted-field="sortField" data-sorted-dir="sortDir" data-col-name="orderStatus"></th>\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t<tr data-ng-repeat="order in bonusTrades.orderStatus">\n\t\t\t\t\t<td data-ng-bind="order.orderDate|sviDate:\'medium\'" class="date" data-col-name="orderDate"></td>\n\t\t\t\t\t<td data-ng-bind="order.orderID" data-col-name="orderID"></td>\n\t\t\t\t\t<td data-ng-bind="order.order.action|labels:labels" data-col-name="action"></td>\n\t\t\t\t\t<td data-svi-symbol data-instrument="order.order.instrument" data-col-name="symbol"></td>\n\t\t\t\t\t<td class="col-md-2" data-ng-bind="order.order.instrument.desc" data-col-name="desc"></td>\n\t\t\t\t\t<td data-ng-bind="order.order.quantity|sviNumber" class="number" data-col-name="quantity"></td>\n\t\t\t\t\t<td data-ng-bind="order.order.orderType|labels" data-col-name="orderType"></td>\n\t\t\t\t\t<td data-col-name="duration">\n\t\t\t\t\t\t\t<span data-ng-if="order.order.duration == \'GTD\'">\n\t\t\t\t\t\t\t\t{{order.order.duration|labels:labels}} {{order.order.expireDate|sviDate}}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span data-ng-if="order.order.duration != \'GTD\'" data-ng-bind="order.order.duration|labels:labels"></span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td data-ng-bind="order.orderStatus|labels" data-col-name="orderStatus"></td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t</svi:modal-body>\n</div>')}]),angular.module("prospectusDisplay/prospectusDisplay.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("prospectusDisplay/prospectusDisplay.tpl.html",'<span class="svi-directive svi-prospectus-display">\n\t<button data-ng-if="prospectusUrl" type="button" data-ng-if="options.showDisclosures" data-ng-click="api.show()" name="prospectus-display" class="btn btn-link prospectus-display-link" data-toggle="modal" data-target="#{{::id}}-prospectusDisplayModal">{{labels.prospectusLink}}</button>\n\t<span data-ng-if="!prospectusUrl" class="prospectus-display-link noUrl" data-ng-bind="labels.prospectusLink"></span>\n</span>')}]),angular.module("prospectusDisplay/prospectusDisplayModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("prospectusDisplay/prospectusDisplayModal.tpl.html",'<div class="svi-directive modal svi-prospectus-display-modal" data-backdrop-limit="1" tabindex="-1" data-backdrop="false" role="dialog" id="{{::id}}-prospectusDisplayModal" aria-labelledby="{{::id}}-modalTitle">\n\t<div class="modal-dialog modal-lg" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 id="{{::id}}-modalTitle" class="modal-title">{{labels.prospectusTitle}}: {{symbol}}</h1>\n\t\t\t\t<button type="button" class="close dim glyphicon glyphicon-remove pointer" data-ng-click="api.hide()" aria-label="Close"></button>\n\t\t\t</div>\n\t\t\t<div class="modal-body">\n\t\t\t\t<iframe data-ng-if="prospectusUrl"\n\t\t\t\t\t\tsrc="{{prospectusUrl}}"\n\t\t\t\t\t\tframeborder="0"\n\t\t\t\t\t\theight="{{height}}"\n\t\t\t\t\t\twidth="{{width}}"\n\t\t\t\t></iframe>\n\t\t\t</div>\n\t\t\t<div class="modal-footer">\n\t\t\t\t<button type="button" class="btn btn-primary" data-ng-click="api.hide()" data-ng-bind="labels.close"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]),angular.module("tradeMenu/tradeMenu.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("tradeMenu/tradeMenu.tpl.html",'<div class="svi-directive svi-trade-menu hidden-xs">\n\t<div data-svi-loader data-ignore-invisible="true" data-ng-show="!config.length"></div>\n\t<div data-svi-action-menu data-ng-if="config.length"\n\t\t data-label="{{labels.tradeMenuLabel}}"\n\t\t data-aria-label="{{labels.tradeMenuLabel}}"\n\t\t data-comm="actionMenuComm"\n\t\t data-icon="none"\n\t\t data-items="config"\n\t\t data-button-class="btn btn-primary"\n\t\t data-fix-dropdown="true"\n\t\t data-menu-class="dropdown-menu-left"></div>\n</div>')}]),angular.module("tradePricing/tradePricing.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("tradePricing/tradePricing.tpl.html",'<div data-ng-show="pricing !== null" class="svi-directive trade-pricing">\n\t<h4 class="header-title" data-ng-bind="labels.tradePricingTitle"></h4>\n\t<div data-svi-loader data-callback="setLoader" data-ignore-invisible="true"></div>\n\t<div data-ng-show="pricing">\n\t\t<dl class="dl-horizontal">\n\t\t\t<dt data-ng-repeat-start="item in pricing" data-ng-bind="item.name"></dt>\n\t\t\t<dd data-ng-repeat-end data-ng-bind="item.commission"></dd>\n\t\t</dl>\n\t</div>\n</div>')}]),angular.module("tradeWidget/tradeWidgetInline.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("tradeWidget/tradeWidgetInline.tpl.html",'<div class="svi-directive svi-trade-widget tw-inline">\n\t<div data-svi-loader data-callback="setSubmitLoader" data-max-retries="0" class="col-sm-12"></div>\n\t<div data-svi-loader data-callback="setBalancesLoader" data-hidden="true" class="col-sm-12"></div>\n\t<div data-svi-loader data-callback="setHoldingsLoader" data-hidden="true" class="col-sm-12"></div>\n\t%TRADING_FORM%\n</div>')}]),angular.module("tradeWidget/tradeWidgetModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("tradeWidget/tradeWidgetModal.tpl.html",'<div class="svi-directive svi-trade-widget tradeWidget tw-modal modal fade" tabindex="-1" role="dialog" aria-labelledby="tradeWidgetModal">\n\t<div class="modal-dialog modal-md" role="document">\n\t\t<div class="modal-content pull-left">\n\t\t\t<div class="modal-header quote">\n\t\t\t\t<div class="pull-right dim close pointer" data-ng-click="close()" data-ng-class="{disabled: (orderStep != entry && submitLoader.showSpinner)}" aria-label="Close"></div>\n\t\t\t\t<h1 id="tradeWidgetModal" data-ng-show="showTitle()" class="bright super" data-ng-bind="labels.titlePlaceholder"></h1>\n\t\t\t\t<div data-ng-show="!!symbol || !!exchangeToSymbol" data-svi-detailed-quote\n\t\t\t\t\t data-template="tradeWidget"\n\t\t\t\t\t data-symbol="{{symbol}}"\n\t\t\t\t\t data-event-name="{{::symbolEvent}}"\n\t\t\t\t\t data-delayed="false"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-body pull-left">\n\t\t\t\t<div data-svi-loader data-callback="setSubmitLoader" data-max-retries="0" class="col-sm-12"></div>\n\t\t\t\t<div data-svi-loader data-callback="setBalancesLoader" data-hidden="true" class="col-sm-12"></div>\n\t\t\t\t<div data-svi-loader data-callback="setHoldingsLoader" data-hidden="true" class="col-sm-12"></div>\n\t\t\t\t%TRADING_FORM%\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("tradeWidget/tradeWidgetTradingForm.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("tradeWidget/tradeWidgetTradingForm.tpl.html",'<form name="tradingForm" action="{{formAction}}" autocomplete="off" novalidate class="col-sm-12">\n    <input type="hidden" name="quantityType" data-ng-model="quantityType"/>\n    <div data-ng-show="errors.length > 0" class="form-group errors col-sm-12">\n        <div class="alert alert-danger">\n            <p data-ng-repeat="error in errors" data-ng-bind="error.errorMessage" role="alert"></p>\n        </div>\n    </div>\n    <div data-ng-show="warnings.length > 0" class="form-group warnings col-sm-12">\n        <div class="alert alert-warning">\n            <p data-ng-repeat="warning in warnings" data-ng-bind="warning.warningMessage" role="alert"></p>\n            <input type="checkbox" name="overrideWarnings" id="{{::id}}-overrideWarnings" value="true"\n                   data-ng-model="overrideWarnings"/>\n            <label class="control-label" for="{{::id}}-overrideWarnings"\n                   data-ng-bind="labels.overrideWarnings || \'override warnings\'"></label>\n        </div>\n    </div>\n    <div data-ng-show="orderStep == \'entry\'">\n        <input type="hidden" name="token" data-ng-model="id"/>\n        <div data-ng-if="visible && allowAccountEdit" class="form-group col-sm-12">\n            <div data-ng-if="investmentType == \'Stock\'" id="{{::id}}-account" data-svi-account-dropdown\n                 data-filter-by="acctStockTradeList" data-init-event="false"\n                 data-dropdown-classes="glance_masked"></div>\n            <div data-ng-if="investmentType == \'Option\'" id="{{::id}}-account" data-svi-account-dropdown\n                 data-filter-by="acctOptionTradeList" data-init-event="false"\n                 data-dropdown-classes="glance_masked"></div>\n            <div data-ng-if="investmentType == \'MutualFund\'" id="{{::id}}-account" data-svi-account-dropdown\n                 data-filter-by="acctFundTradeList" data-init-event="false" data-dropdown-classes="glance_masked"></div>\n        </div>\n        <input type="hidden" name="currentAccount" data-ng-model="account"/>\n        <div class="form-group accountNumber col-sm-12 glance_masked" data-ng-show="!allowAccountEdit">\n            <strong class="control-label">{{labels.account}}:</strong>\n            {{account|sviAccount}}\n        </div>\n        <div class="form-group buyingPower col-sm-12"\n             data-ng-class="{\'has-warning\': insufficientFunds}"\n             data-ng-show="fundsAvail">\n            <strong class="control-label">{{fundsAvailLabel}}:</strong>\n            {{fundsAvail|sviCurrency}}\n        </div>\n        <div class="form-group col-sm-12" data-ng-show="buyingPower || buyingPower === 0">\n            <strong class="control-label">{{buyingPowerLabel}}:</strong>\n            {{buyingPower|sviCurrency}}\n        </div>\n        <div class="form-group col-sm-12"\n             data-ng-class="fundsAvail ? \'bonusTrades\' : \'bonusTradesOnly\'"\n             data-ng-show="showBonusTrades()">\n            <strong class="control-label">{{labels.bonusTrades}}:</strong>\n            {{bonusTrades.number|number}}\n        </div>\n        <div class="form-group col-sm-12" data-ng-show="allowSymbolEdit" data-svi-show-input-errors="symbol">\n            <label class="control-label" for="{{::id}}-symbol" data-ng-bind="labels.symbol"></label>\n            <div data-svi-input-symbol\n                 data-comm="inputSymbolComm"\n                 data-input-cls="form-control"\n                 data-ng-model="symbol"\n                 data-ng-model-options="{allowInvalid: true}"\n                 data-debounce-delay="1000"\n                 data-lookup-placement="bottom"\n                 data-capitalize="true"></div>\n            <span class="on-error lookup-enabled glyphicon glyphicon-ban-circle form-control-feedback"></span>\n            <div id="symbolAlertMsg" role="alert">\n                <div class="on-error help-block" data-ng-bind="labels.fieldInvalid"></div>\n            </div>\n        </div>\n        <div class="form-group col-sm-12">\n            <label class="control-label" for="{{::id}}-side" data-ng-bind="labels.side"></label>\n            <select class="form-control" id="{{::id}}-side" name="side" data-ng-model="side" data-ng-required="true"\n                    data-ng-options="o.value as o.label for o in options.side"\n                    data-ng-disabled="account === null || symbol === \'\'|| mode != \'place\'"></select>\n        </div>\n        <input data-ng-show="!allowSymbolEdit" type="hidden" name="symbol" data-ng-model="symbol" required/>\n        <div class="form-group col-sm-12"\n             data-ng-show="investmentType == \'MutualFund\' && mode == \'place\' && (side == \'X\' || side == \'Y\')"\n             data-svi-show-input-errors="exchangeToSymbol">\n            <label class="control-label" for="{{::id}}-exchangeToSymbol"\n                   data-ng-bind="labels.exchangeToSymbol || \'exchange To Symbol\'"></label>\n            <div data-svi-input-symbol\n                 data-comm="inputExchangeSymbolComm"\n                 data-input-cls="form-control"\n                 data-ng-model="exchangeToSymbol"\n                 data-ng-model-options="{allowInvalid: true}"\n                 data-name="exchangeToSymbol"\n                 data-debounce-delay="1000"\n                 data-lookup-placement="bottom"\n                 data-capitalize="true"\n                 data-ng-disabled="account === null || symbol === \'\'"></div>\n            <span class="on-error lookup-enabled glyphicon glyphicon-ban-circle form-control-feedback"></span>\n            <div class="on-error help-block" data-ng-bind="labels.fieldInvalid" role="alert"></div>\n        </div>\n        <div class="form-group col-sm-12"\n             data-ng-show="investmentType == \'MutualFund\' && mode != \'place\' && (side == \'X\' || side == \'Y\')">\n            <strong class="control-label"\n                    data-ng-bind="(labels.exchangeToSymbol || \'exchange To Symbol\') + \':\'"></strong>\n            {{exchangeToSymbol}}\n        </div>\n        <div class="form-inline col-sm-12 investAmount" data-ng-show="showInvestAmount()">\n            <div class="note">Optional</div>\n            <div class="form-group well well-sm" data-svi-show-input-errors="investAmount" data-add-feedback="false">\n                <label class="control-label col-sm-5" for="{{::id}}-investAmount">{{labels.investAmount}}: <span\n                        class="glyphicon glyphicon-info-sign investInfo" data-container=".investAmount"\n                        title="{{labels.investCalcInfo}}" aria-label="{{labels.investCalcInfo}}"></span></label>\n                <div class="input-group col-sm-7">\n                    <span class="input-group-addon">$</span>\n                    <input type="number" class="form-control" id="{{::id}}-investAmount" name="investAmount"\n                           data-ng-model="investAmount" min="0" step="any"\n                           data-ng-disabled="account === null || symbol === \'\'"/>\n                    <span class="input-group-btn">\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-default" data-ng-click="investToQty()"\n                                                    data-ng-bind="labels.investToQty"\n                                                    data-ng-class="{ disabled: account === null || symbol === \'\'}"></button>\n\t\t\t\t\t\t\t\t\t</span>\n                </div>\n                <div class="on-error help-block" data-on-error="errors.number || errors.min"\n                     data-ng-bind="labels.invalidInvestAmount" role="alert"></div>\n            </div>\n        </div>\n        <div class="form-group col-sm-3 quantityType" data-ng-show="showQuantityTypeDropdown()">\n            <label for="{{::id}}-quantityType">{{labels.quantityType}}</label>\n            <div data-svi-filter-dropdown\n                 data-event-id="TRADEWIDGET.QUANTITY.TYPE"\n                 data-state-id="{{::id}}-quantityType"\n                 data-ng-model="quantityType"\n                 data-options="{{options.quantityType | json }}"\n                 data-comm="{ disabled: account === null || symbol === \'\' || !allowQtyEdit, options: options.quantityType }"></div>\n        </div>\n        <div data-ng-show="investmentType != \'MutualFund\'" class="col-sm-12">\n            <div class="form-group quantity" data-svi-show-input-errors="qty"\n                 data-additional-scope="{\'insufficientFunds\':insufficientFunds, \'insufficientShares\':insufficientShares}">\n                <label class="control-label" for="{{::id}}-qty" data-ng-bind="labels.qty"></label>\n                <div class="input-group">\n                    <input type="number" class="form-control" id="{{::id}}-qty" name="qty" placeholder="{{labels.qty}}"\n                           data-ng-model="qty" required min="1" data-svi-valid-integer\n                           data-ng-focus="clearField(\'qty\', true)"\n                           data-ng-disabled="account === null || symbol === \'\' || !allowQtyEdit"/>\n                    <span class="input-group-btn" data-ng-show="showSharesToQtyButton()">\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-default"\n                                                    data-ng-click="maxSharesToQty()" data-ng-switch="side"\n                                                    title="{{labels.maxSharesToQty}}"\n                                                    data-ng-class="{ disabled: account === null || symbol === \'\' || !allowQtyEdit}"\n                                                    data-ng-disabled="account === null || symbol === \'\' || !allowQtyEdit">\n\t\t\t\t\t\t\t\t\t\t\t<span data-ng-switch-when="2">{{labels.sellAllStart}}{{maxShares}}{{labels.sellAllEnd}}</span>\n\t\t\t\t\t\t\t\t\t\t\t<span data-ng-switch-when="C">{{labels.btcAllStart}}{{maxShares}}{{labels.btcAllEnd}}</span>\n\t\t\t\t\t\t\t\t\t\t\t<span data-ng-switch-default>{{labels.maxSharesStart}}{{maxShares}}{{labels.maxSharesEnd}}</span>\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</span>\n                    <span class="input-group-addon" data-ng-if="showBalancesLoader()"><i\n                            class="fa fa-spinner fa-spin"></i> <span\n                            data-ng-bind="labels.loadingBalances"></span></span>\n                    <span class="input-group-addon" data-ng-if="showHoldingsLoader()"><i\n                            class="fa fa-spinner fa-spin"></i> <span\n                            data-ng-bind="labels.loadingHoldings"></span></span>\n                </div>\n                <span class="on-warning glyphicon glyphicon-warning-sign form-control-feedback"\n                      data-on-warning="insufficientFunds || insufficientShares"></span>\n                <span class="on-error glyphicon glyphicon-ban-circle form-control-feedback"></span>\n                <div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1"\n                     data-ng-bind="labels.fieldRequired" role="alert"></div>\n                <div class="on-error help-block" data-on-error="errors.integer || errors.min"\n                     data-ng-bind="labels.fieldInvalid" role="alert"></div>\n                <div class="on-warning help-block" data-on-warning="insufficientFunds"\n                     data-ng-bind="labels.insufficientFunds" role="alert"></div>\n                <div class="on-warning help-block" data-on-warning="insufficientShares"\n                     data-ng-bind="labels.insufficientShares" role="alert"></div>\n            </div>\n        </div>\n        <div class="col-sm-9 pad-left-10" data-ng-show="investmentType == \'MutualFund\' && side != \'L\' && side != \'X\'">\n            <div class="form-group fundQuantity" data-svi-show-input-errors="fundQty"\n                 data-additional-scope="{\'insufficientFunds\':insufficientFunds, \'insufficientShares\':insufficientShares}">\n                <label class="control-label" for="{{::id}}-fundQty"\n                       data-ng-bind="labels.fundQty || \'fund quantity\'"></label>\n                <div class="input-group">\n                    <span data-ng-show="showQuantityTypeDollars()" class="input-group-addon">$</span>\n                    <input type="number" class="form-control" id="{{::id}}-fundQty" name="fundQty"\n                           placeholder="{{labels.fundQty}}" required data-ng-model="fundQty"\n                           data-ng-focus="clearField(\'fundQty\', true)"\n                           data-ng-disabled="account === null || symbol === \'\' || !allowQtyEdit"/>\n                    <span class="input-group-btn" data-ng-show="showSharesToQtyButton()">\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-default"\n                                                    data-ng-click="maxSharesToFundQty()" data-ng-switch="side"\n                                                    title="{{labels.maxSharesToQty}}"\n                                                    aria-label="{{labels.maxSharesToQty}} {{labels.maxSharesStart}}{{maxShares|number}}"\n                                                    data-ng-class="{ disabled: account === null || symbol === \'\' || !allowQtyEdit}"\n                                                    data-ng-disabled="account === null || symbol === \'\' || !allowQtyEdit">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{labels.maxSharesStart}}{{maxShares|number}}\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</span>\n                    <span class="input-group-addon" data-ng-if="showBalancesLoader()"><i\n                            class="fa fa-spinner fa-spin"></i> <span\n                            data-ng-bind="labels.loadingBalances"></span></span>\n                    <span class="input-group-addon" data-ng-if="showHoldingsLoader()"><i\n                            class="fa fa-spinner fa-spin"></i> <span\n                            data-ng-bind="labels.loadingHoldings"></span></span>\n                </div>\n                <span class="on-warning glyphicon glyphicon-warning-sign form-control-feedback"\n                      data-on-warning="insufficientFunds || insufficientShares"></span>\n                <span class="on-error glyphicon glyphicon-ban-circle form-control-feedback"></span>\n                <div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1"\n                     data-ng-bind="labels.fieldRequired" role="alert"></div>\n                <div class="on-error help-block" data-on-error="errors.number || errors.positiveNumber"\n                     data-ng-bind="labels.fieldInvalid" role="alert"></div>\n                <div class="on-warning help-block" data-on-warning="insufficientFunds"\n                     data-ng-bind="labels.insufficientFunds" role="alert"></div>\n                <div class="on-warning help-block" data-on-warning="insufficientShares"\n                     data-ng-bind="labels.insufficientShares" role="alert"></div>\n            </div>\n        </div>\n        <div class="form-group has-warning col-sm-12"\n             data-ng-show="investmentType == \'MutualFund\' && (side == \'L\' || side == \'X\') && insufficientShares">\n            <div class="col-sm-1 on-warning help-block show glyphicon glyphicon-warning-sign"></div>\n            <div class="col-sm-11 on-warning help-block show" data-ng-bind="labels.insufficientShares"></div>\n        </div>\n        <div class="form-group" data-ng-class="(price == \'1\' || price == \'4\') ? \'col-sm-12\' : \'col-sm-6\'"\n             data-ng-show="investmentType != \'MutualFund\'">\n            <label class="control-label" for="{{::id}}-price" data-ng-bind="labels.price"></label>\n            <select class="form-control" id="{{::id}}-price" name="price" data-ng-model="price" data-ng-required="true"\n                    data-ng-options="o.value as o.label for o in options.price"\n                    data-ng-disabled="account === null || symbol === \'\'"></select>\n        </div>\n        <div class="trade-prices-wrapper" data-ng-class="(price == \'1\' || price == \'4\') ? \'col-sm-12\' : \'\'">\n            <div class="form-group col-sm-6"\n                 data-ng-show="(price == \'3\' || price == \'4\') && investmentType != \'MutualFund\'"\n                 data-svi-show-input-errors="stop">\n                <label class="control-label" for="{{::id}}-stop" data-ng-bind="labels.stop"></label>\n                <div class="input-group">\n                    <span class="input-group-addon">$</span>\n                    <input type="number" class="form-control" id="{{::id}}-stop" name="stop" data-ng-model="stop"\n                           step="{{spinnerStep}}"\n                           data-ng-required="price == \'3\' || price == \'4\'"\n                           data-ng-disabled="account === null || symbol === \'\'"/>\n                </div>\n                <span class="on-error glyphicon glyphicon-ban-circle form-control-feedback"></span>\n                <div class="on-error help-block" data-ng-bind="labels.fieldInvalid" role="alert"></div>\n            </div>\n            <div class="form-group col-sm-6"\n                 data-ng-show="(price == \'2\' || price == \'4\') && investmentType != \'MutualFund\'"\n                 data-svi-show-input-errors="limit">\n                <label class="control-label" for="{{::id}}-limit" data-ng-bind="labels.limit"></label>\n                <div class="input-group">\n                    <span class="input-group-addon">$</span>\n                    <input type="number" class="form-control" id="{{::id}}-limit" name="limit" data-ng-model="limit"\n                           step="{{spinnerStep}}"\n                           data-ng-required="price == \'2\' || price == \'4\'"\n                           data-ng-click="clearField(\'limit\', true, $event)"\n                           data-ng-focus="focusSelect($event)"\n                           data-ng-disabled="account === null || symbol === \'\'"/>\n                </div>\n                <span class="on-error glyphicon glyphicon-ban-circle form-control-feedback"></span>\n                <div class="on-error help-block" data-on-error="errors.number || errors.validLimit"\n                     data-ng-bind="labels.fieldInvalid" role="alert"></div>\n            </div>\n        </div>\n        <div class="trade-prices-wrapper" data-ng-class="(price == \'1\' || price == \'4\') ? \'col-sm-12\' : \'\'">\n            <div class="form-group col-sm-6" data-ng-show="investmentType != \'MutualFund\'">\n                <label class="control-label" for="{{::id}}-timeInForce" data-ng-bind="labels.timeInForce"></label>\n                <select class="form-control" id="{{::id}}-timeInForce" name="timeInForce" data-ng-model="timeInForce"\n                        data-ng-required="true"\n                        data-ng-options="o.value as o.label for o in options.timeInForce"\n                        data-ng-disabled="account === null || symbol === \'\'"></select>\n            </div>\n            <div class="form-group col-sm-6" data-ng-show="investmentType != \'MutualFund\'">\n                <label class="control-label" for="{{::id}}-instructions" data-ng-bind="labels.instructions"></label>\n                <select class="form-control" id="{{::id}}-instructions" name="instructions" data-ng-model="instructions"\n                        data-ng-options="o.value as o.label for o in options.instructions"\n                        data-ng-disabled="account === null || symbol === \'\'"></select>\n            </div>\n        </div>\n        <div class="form-group col-sm-12" data-ng-show="showDisposalMethodDropdown()">\n            <label class="control-label" for="{{::id}}-disposalMethod" data-ng-bind="labels.disposalMethod"></label>\n            <select class="form-control" id="{{::id}}-disposalMethod" name="disposalMethod"\n                    data-ng-model="disposalMethod"\n                    data-ng-options="o.value as o.label for o in options.disposalMethodDropdown"\n                    data-ng-disabled="account === null || symbol === \'\'"></select>\n        </div>\n\n        <div data-ng-show="side != \'L\' && side != \'2\' && side != \'Y\' && side != \'X\' && investmentType == \'MutualFund\'"\n             class="form-group col-sm-12 pad-top-10">\n            <div class="well well-sm fundElections initialPurchaseBox">\n                <label class="control-label"\n                       for="{{::id}}-initialPurchase"\n                       data-ng-class="{\'initial-purchase-modal-label\': template === \'Modal\' && hasEmptyInitialPurchaseValue}"\n                       data-ng-bind="hasEmptyInitialPurchaseValue ? labels.isInitialPurchaseRequired : labels.isInitialPurchase"></label>\n                <div data-svi-filter-dropdown\n                     class="initialPurchaseSelect"\n                     name="initialPurchase"\n                     data-state-id="{{::id}}-initialPurchase"\n                     data-event-id="TRADEWIDGET.INITIAL.PURCHASE"\n                     data-ng-model="initialPurchase"\n                     data-options="{{options.initialPurchase}}"\n                     data-comm="{options: options.initialPurchase }"\n                     data-has-error="hasInitialPurchaseError"></div>\n                <a data-bs-popover\n                   data-ng-if="hasEmptyInitialPurchaseValue"\n                   data-ng-bind="labels.whyAsk"\n                   data-trigger="click"\n                   data-placement="bottom"\n                   data-auto-close="1"\n                   data-content="Initial Purchase means you do not already own this mutual fund in the account. Answer “Yes” if you do not currently own this mutual fund in your account."\n                   href=""\n                   class="sub-title help-text-link why-ask"></a>\n            </div>\n            <div data-ng-if="hasEmptyInitialPurchaseValue && hasInitialPurchaseError"\n                 class="initialPurchase-error-message">\n                {{ labels.initialPurchaseRequiredError }}\n            </div>\n        </div>\n\n        <div data-ng-show="side != \'L\' && side != \'2\' && side != \'Y\' && side != \'X\' && investmentType == \'MutualFund\' && (!options.reinvestRequiresInitialPurchase || initialPurchase == true)"\n             class="form-group col-sm-12 pad-top-10">\n            <div class="well well-sm fundElections">\n                <div>\n                    <input type="checkbox" name="reinvestDiv" id="{{::id}}-reinvestDiv" value="{{reinvestDiv}}"\n                           data-ng-model="reinvestDiv" data-ng-disabled="account === null || symbol === \'\'"/>\n                    <label class="control-label reinvestDiv" for="{{::id}}-reinvestDiv"\n                           data-ng-bind="labels.reinvestDiv || \'reinvest my dividends\'"></label>\n                </div>\n                <div>\n                    <input type="checkbox" name="reinvestCap" id="{{::id}}-reinvestCap" value="{{reinvestCap}}"\n                           data-ng-model="reinvestCap" data-ng-disabled="account === null || symbol === \'\'"/>\n                    <label class="control-label reinvestCap" for="{{::id}}-reinvestCap"\n                           data-ng-bind="labels.reinvestCap || \'reinvest my capital\'"></label>\n                </div>\n            </div>\n        </div>\n\n        <div class="form-group estimatedCost col-sm-12" data-ng-show="showEstimatedCostCalculation()"\n             data-ng-class="{\'has-warning\': insufficientFunds || insufficientShares }">\n            <strong class="control-label" data-ng-show="isBuySide()">{{labels.estimatedCost}}:</strong>\n            <strong class="control-label" data-ng-show="isSellSide()">{{labels.estimatedProceeds}}:</strong>\n            <span data-ng-bind="estimatedCost|sviCurrency"></span>\n        </div>\n        <div data-ng-show="options.showProspectus && side != \'L\' && side != \'2\' && investmentType == \'MutualFund\'"\n             class="form-group col-sm-12" data-svi-show-input-errors="readProspectus" data-show-immediately="true">\n            <div class="well well-sm prospectus">\n                <div class="input-group">\n                    <input type="checkbox" name="readProspectus" id="{{::id}}-readProspectus" value="{{readProspectus}}"\n                           data-ng-model="readProspectus" data-ng-checked="readProspectus"\n                           data-ng-required="options.showProspectus && side != \'L\' && side != \'2\' && investmentType == \'MutualFund\'"\n                           data-ng-disabled="account === null || symbol === \'\'"/>\n                    <label data-ng-if="options.prospectusUrl" class="control-label readProspectus"\n                           for="{{::id}}-readProspectus">\n                        {{labels.readProspectus1}}<span data-svi-prospectus-display data-symbol="{{symbol}}"\n                                                        data-url="{{options.prospectusUrl}}"\n                                                        data-event-name="{{::symbolEvent}}"></span>{{labels.readProspectus2}}\n                    </label>\n                    <label data-ng-if="!options.prospectusUrl" class="control-label readProspectus"\n                           for="{{::id}}-readProspectus"\n                           data-ng-bind="labels.readProspectus || \'read prospectus\'"></label>\n                </div>\n            </div>\n        </div>\n        <div class="form-group button-section col-sm-12">\n            <div class="svi-visually-hidden" aria-live="polite" data-ng-bind="formInvalidMsg"></div>\n            <div class="main-buttons">\n                <div>\n                    <button type="button"\n                            data-ng-click="preview($event)"\n                            name="preview"\n                            class="btn btn-primary"\n                            data-ng-class="{disabled: account === null || tradingForm.$invalid || submitLoader.showSpinner || (hasEmptyInitialPurchaseValue && initialPurchase === EMPTY_VALUE && investmentType === \'MutualFund\' && isBuySide())}"\n                            aria-live="polite"\n                    >\n                        <i data-ng-show="submitLoader.showSpinner"\n                           class="fa fa-spinner fa-spin"></i>\n                        {{labels.previewOrder}}\n                    </button>\n                    <button type="button" data-ng-if="template == \'Modal\'" data-ng-click="close()" name="close"\n                            class="btn btn-default">{{labels.close}}\n                    </button>\n                </div>\n                <button type="button" data-ng-click="reset()" name="close" class="btn"\n                        data-ng-class="{\'btn-link\':template == \'Modal\', \'btn-default\':template != \'Modal\'}">\n                    {{labels.reset}}\n                </button>\n            </div>\n            <button type="button" data-ng-click="advancedOrder()" name="advanced" class="btn btn-info"\n                    data-ng-if="options.advancedOrdersUrl" data-ng-class="{disabled: submitLoader.showSpinner}">\n                {{labels.advancedOrdersLink}}\n            </button>\n            <button type="button" data-ng-if="showTradeDisclosure()" data-ng-click="disclosures()" name="disclosures"\n                    class="btn btn-link pull-right btn-hide" data-ng-class="{\'btn-show\': showTradeDisclosure()}">\n                {{labels.tradeDisclosure}}\n            </button>\n        </div>\n    </div>\n    <div data-ng-show="orderStep != \'entry\'">\n        <div data-ng-show="orderStep == \'confirm\'" class="form-group orderConfirmation col-sm-12">\n            <div class="alert alert-success">\n                <span class="glyphicon glyphicon-ok-circle"></span>\n                {{labels[\'orderConfirmSuccess\'+mode]}}\n            </div>\n        </div>\n        <div class="form-group account col-sm-12 glance_masked">\n            <strong class="control-label">{{labels.account}}:</strong>\n            {{accountDisplay}}\n        </div>\n        <div class="form-group buyingPower col-sm-12" data-ng-show="fundsAvail">\n            <strong class="control-label">{{fundsAvailLabel}}:</strong>\n            {{fundsAvail|sviCurrency}}\n        </div>\n        <div class="form-group col-sm-12" data-ng-show="buyingPower || buyingPower === 0">\n            <strong class="control-label">{{buyingPowerLabel}}:</strong>\n            {{buyingPower|sviCurrency}}\n        </div>\n        <div class="form-group orderDetails col-sm-12">\n            <strong class="control-label">{{labels.orderDetails}}:</strong>\n            <div class="alert alert-info" data-ng-if="investmentType != \'MutualFund\'">\n                <strong data-ng-bind="side|selectDisplay:options.side"></strong> <strong data-ng-bind="qty"></strong>\n                <span data-ng-if="investmentType == \'Option\'" data-ng-bind="labels.contractsOf"></span>\n                <span data-ng-if="investmentType != \'Option\'"\n                      data-ng-bind="quantityType == \'dollars\' ? labels.dollarsOf : labels.sharesOf"></span>\n                <strong data-ng-bind="symbol"></strong> {{ labels.previewDetailsAt }} <strong\n                    data-ng-bind="price|selectDisplay:options.price"></strong>\n                <span data-ng-if="price == \'1\'">{{ labels.previewDetailsPrice }}.</span>\n                <span data-ng-if="price == \'3\'">{{ labels.previewDetailsPrice }} <strong\n                        data-ng-bind="stop|sviCurrency"></strong>.</span>\n                <span data-ng-if="price == \'2\' || price == \'4\'">\n\t\t\t\t\t\t\t\t\t{{ labels.previewDetailsPrice }}\n\t\t\t\t\t\t\t\t\t<strong data-ng-bind="stop|sviCurrency" data-ng-if="price == \'4\'"></strong>\n\t\t\t\t\t\t\t\t\t<strong data-ng-bind="limit|sviCurrency"\n                                            data-ng-if="price == \'2\' || price == \'4\'"></strong>.\n\t\t\t\t\t\t\t</span>\n                {{ labels.timeInForce }}: <strong data-ng-bind="timeInForce|selectDisplay:options.timeInForce"></strong>.\n                <br/>\n                {{ labels.instructions }}: <strong\n                    data-ng-bind="instructions|selectDisplay:options.instructions"></strong>.\n            </div>\n            <div class="alert alert-info" data-ng-if="investmentType == \'MutualFund\'">\n                <strong data-ng-bind="side|selectDisplay:options.side"></strong>\n                <strong data-ng-if="side != \'X\' && side != \'L\'" data-ng-bind="fundQty"></strong>\n                {{ (side == \'X\' || side == \'L\') ? \'\' : ( (quantityType == \'dollars\' && side != \'X\' && side != \'L\') ?\n                labels.dollarsOf : labels.sharesOf ) }}\n                <strong data-ng-bind="symbol"></strong>\n                {{ (side == \'X\' || side == \'Y\') ? labels.previewDetailsTo : \'\' }}\n                <strong data-ng-if="side == \'X\' || side == \'Y\'" data-ng-bind="exchangeToSymbol"></strong>\n            </div>\n        </div>\n        <div data-ng-show="origOrderId" class="form-group origOrderId col-sm-12">\n            <strong class="control-label">{{labels.origOrderId}}:</strong>\n            {{origOrderId}}\n        </div>\n        <div data-ng-show="orderStep == \'confirm\' && orderId" class="form-group orderId col-sm-12">\n            <strong class="control-label">{{labels.orderId}}:</strong>\n            {{orderId}}\n        </div>\n        <div data-ng-show="orderStep == \'confirm\' && orderStatus" class="form-group orderStatus col-sm-12">\n            <strong class="control-label">{{labels.orderStatus}}:</strong>\n            {{orderStatus|labels:labels}}\n        </div>\n        <div data-ng-if="options.showFees" class="form-group col-sm-12 commissionAndFees">\n            <strong class="control-label">{{labels.fee}}:</strong>\n            <div class="pull-right" data-ng-bind="commission|sviCurrency"></div>\n        </div>\n        <div data-ng-if="options.showFees && (postage > 0)" class="form-group col-sm-12 commissionAndFees">\n            <strong class="control-label">{{labels.commissionAndFees}}:</strong>\n            <div class="pull-right" data-ng-bind="postage|sviCurrency"></div>\n        </div>\n        <div data-ng-show="!options.showFees && (commission + postage) > 0"\n             class="form-group col-sm-12 commissionAndFees">\n            <strong class="control-label">{{labels.commissionAndFees}}:</strong>\n            <div class="pull-right" data-ng-bind="(commission + postage)|sviCurrency"></div>\n        </div>\n        <div data-ng-show="(tradeValue != 0 || tradeValue) && (isBuySide() || isSellSide())"\n             class="form-group col-sm-12">\n            <strong class="control-label" data-ng-show="isBuySide()">{{labels.estimatedTotalCost}}:</strong>\n            <strong class="control-label" data-ng-show="isSellSide()">{{labels.estimatedTotalProceeds}}:</strong>\n            <strong class="pull-right" data-ng-bind="tradeValue|sviCurrency"></strong>\n        </div>\n        <div data-ng-show="side != \'L\' && side != \'2\' && side != \'Y\' && side != \'X\' && investmentType == \'MutualFund\'"\n             class="col-sm-12 pad-top-10">\n            <div class="well well-sm fundElections">\n                <div class="initialPurchaseBox">\n                    <span class="initialPurchase" data-ng-bind="labels.initialPurchase"></span>: <strong\n                        data-ng-bind="initialPurchase|sviBoolean"></strong>\n                </div>\n                <div data-ng-show="!options.reinvestRequiresInitialPurchase || initialPurchase == true">\n                    <span class="reinvestDiv" data-ng-bind="labels.reinvestDiv"></span>: <strong\n                        data-ng-bind="reinvestDiv|sviBoolean"></strong>\n                </div>\n                <div data-ng-show="!options.reinvestRequiresInitialPurchase || initialPurchase == true">\n                    <span class="reinvestCap" data-ng-bind="labels.reinvestCap"></span>: <strong\n                        data-ng-bind="reinvestCap|sviBoolean"></strong>\n                </div>\n            </div>\n        </div>\n        <div data-ng-show="options.showProspectus && side != \'L\' && side != \'2\' && investmentType == \'MutualFund\'"\n             class="col-sm-12">\n            <div class="well well-sm prospectus">\n                <div>\n                    <strong data-ng-bind="readProspectus|sviBoolean"></strong>:\n                    <span class="readProspectus" data-ng-bind="labels.readProspectus"></span>\n                </div>\n            </div>\n        </div>\n        <div class="hidden">\n            \x3c!-- don\'t mess with this it fixes an autofill bug --\x3e\n            <input type="text" name="username" id="{{::id}}-username" autocomplete="username"\n                   aria-label="username (unused)"/>\n        </div>\n        <div class="form-group col-sm-12" data-ng-show="orderStep == \'preview\' && useTradingPassword"\n             data-svi-show-input-errors="tradingPassword">\n            <label class="control-label" for="{{::id}}-tradingPassword" data-ng-bind="labels.tradingPassword"></label>\n            <input type="password" class="form-control" id="{{::id}}-tradingPassword" name="tradingPassword"\n                   placeholder="{{labels.tradingPassword}}" data-ng-model="tradingPassword"\n                   data-ng-required="orderStep == \'preview\' && useTradingPassword"/>\n            <span class="on-error glyphicon glyphicon-ban-circle form-control-feedback"></span>\n            <div class="on-error help-block" data-ng-bind="labels.fieldInvalid" role="alert"></div>\n        </div>\n        <div data-ng-show="orderStep == \'preview\'" class="form-group button-section col-sm-12">\n            <button type="button" data-ng-click="submit()" name="submit" class="btn btn-primary"\n                    data-ng-class="{disabled: account === null || tradingForm.$invalid || submitLoader.showSpinner}"><i\n                    data-ng-show="submitLoader.showSpinner" class="fa fa-spinner fa-spin"></i>\n                {{labels[\'submitOrder\'+mode]}}\n            </button>\n            <button data-ng-if="mode != \'cancel\'" type="button" data-ng-click="modify()" name="modify"\n                    class="btn btn-default" data-ng-class="{disabled: submitLoader.showSpinner}">{{labels.modifyOrder}}\n            </button>\n            <button data-ng-if="template == \'Modal\'" type="button" data-ng-click="close()" name="close"\n                    class="btn btn-default" data-ng-class="{disabled: submitLoader.showSpinner}">{{labels.close}}\n            </button>\n        </div>\n        <div data-ng-show="orderStep == \'confirm\'" class="form-group button-section col-sm-12">\n            <button data-ng-if="template == \'Modal\'" type="button" data-ng-click="close()" name="close"\n                    class="btn btn-primary" data-ng-class="{disabled: submitLoader.showSpinner}">{{labels.close}}\n            </button>\n            <button type="button" data-ng-click="showOrderStatus()" name="showOrderStatus" class="btn btn-default">\n                {{labels.showOrderStatus}}\n            </button>\n        </div>\n    </div>\n</form>')}]),angular.module("templates-user",["combinedAgreements/combinedAgreementsForm.tpl.html","combinedAgreements/combinedAgreementsInline.tpl.html","combinedAgreements/combinedAgreementsModal.tpl.html","rtqAgreement/rtqAgreement.tpl.html","rtqAgreementText/nasdaq.tpl.html","rtqAgreementText/nyse.tpl.html","rtqAgreementText/opra.tpl.html","rtqAgreementText/rtqAgreementText.tpl.html","userAgreement/userAgreement.tpl.html","userAgreementText/content.tpl.html","userAgreementText/userAgreementText.tpl.html"]),angular.module("combinedAgreements/combinedAgreementsForm.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("combinedAgreements/combinedAgreementsForm.tpl.html",'<form novalidate class="combined-agreements-form col-sm-12" name="combinedAgreementsForm">\n\t<div data-svi-user-agreement data-ng-if="showUser"\n\t\tdata-combined-agreements-form="combinedAgreementsForm"\n\t\tdata-set-init="setInitUser"\n\t\tdata-set-get-submit-data="setGetUserSubmitData"\n\t/>\n\n\t<div data-ng-if="showBoth" class="separator" />\n\n\t<div data-svi-rtq-agreement data-ng-if="showRtq"\n\t\tdata-allow-skip-rtq="{{::allowSkipRtq}}"\n\t\tdata-first-name="{{::firstName}}"\n\t\tdata-last-name="{{::lastName}}"\n\t\tdata-country-us-only="{{::countryUsOnly}}"\n\t\tdata-country-us-menu="{{::countryUsMenu}}"\n\t\tdata-country-menu="{{::countryMenu}}"\n\t\tdata-state-menu="{{::stateMenu}}"\n\t\tdata-occupation-menu="{{::occupationMenu}}"\n\t\tdata-validation="{{::validation}}"\n\t\tdata-combined-agreements-form="combinedAgreementsForm"\n\t\tdata-set-init="setInitRtq"\n\t\tdata-set-get-submit-data="setGetRtqSubmitData"\n\t\tdata-on-change-show-submit="handleRtqChangeShowSubmit"\n\t/>\n\n\t<div data-svi-loader data-callback="setLoader"></div>\n\n\t<div class="section-buttons" data-ng-if="showSubmit">\n\t\t<button type="submit" ng-disabled="combinedAgreementsForm.$invalid || redirecting" data-ng-click="submit()" name="submit" class="btn btn-default" data-ng-class="{disabled: loader.showSpinner}">{{labels.submit}}</button>\n\t</div>\n</form>\n')}]),angular.module("combinedAgreements/combinedAgreementsInline.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("combinedAgreements/combinedAgreementsInline.tpl.html",'<div class="svi-directive svi-combined-agreements-inline">\n\t%AGREEMENTS_FORM%\n</div>\n')}]),angular.module("combinedAgreements/combinedAgreementsModal.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("combinedAgreements/combinedAgreementsModal.tpl.html",'<div class="svi-directive svi-combined-agreements-modal tw-modal modal fade" tabindex="-1" aria-labelledby="{{::id}}-modalTitle">\n\t<div class="modal-dialog modal-lg" role="document">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h1 id="{{::id}}-modalTitle" class="modal-title" data-ng-bind="labels.modalTitle"></h1>\n\t\t\t\t<div class="close dim glyphicon glyphicon-remove pointer" data-ng-click="close()" aria-label="Close"></div>\n\t\t\t</div>\n\t\t\t<div class="modal-body">\n\t\t\t\t%AGREEMENTS_FORM%\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("rtqAgreement/rtqAgreement.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("rtqAgreement/rtqAgreement.tpl.html",'<div class="svi-rtq-agreement-skip" data-ng-if="allowSkipRtq">\n\t<div data-svi-show-input-errors="enableRtq">\n\t\t<label data-ng-if="labels.enableRtqDescription">{{::labels.enableRtqDescription}}</label>\n\t\t<input type="hidden" name="enableRtq" data-ng-required="true" data-ng-model="form.enableRtq" />\n\t\t<div class="choices" id="{{::id}}-enableRtq">\n\t\t\t<label class="control-label">{{::labels.enableRtq}}</label>\n\t\t\t<div>\n\t\t\t\t<label class="radio-inline">\n\t\t\t\t\t<input type="radio" name="enableRtq_Y" id="{{::id}}-enableRtq-Y" value="Y" data-ng-model="form.enableRtqTemp" data-ng-change="updateEnableRtq()">{{::labels.enableRtqY}}\n\t\t\t\t</label>\n\t\t\t\t<label class="radio-inline">\n\t\t\t\t\t<input type="radio" name="enableRtq_N" id="{{::id}}-enableRtq-N" value="N" data-ng-model="form.enableRtqTemp" data-ng-change="updateEnableRtq()">{{::labels.enableRtqN}}\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t</div>\n</div>\n\n<div class="svi-directive svi-rtq-agreement" data-ng-if="!allowSkipRtq || form.enableRtq === \'Y\'">\n\t<h2 class="title">{{::labels.title}}</h2>\n\n\t<div class="intro">\n\t\tReal-Time quotes are a key component of your personal investing experience. These quotes are sourced directly from the Exchanges by <strong class="svi-x">InvestCloud, Inc.</strong>, the platform provider. The Exchanges require each user to: 1) indicate if they are a Securities Industry Professional; 2) agree to the terms of the Subscriber Agreements and 3) provide a Subscriber Profile.\n\t</div>\n\n\t<div class="block section-subscriber-status">\n\t\t<div class="header">\n\t\t\t1. Indicate if you are a Professional Subscriber\n\t\t</div>\n\t\t<div class="body">\n\t\t\t<p>The Exchanges consider you to be a Professional Subscriber if any of the following statements are true:</p>\n\t\t\t<ul class="non-prof-def">\n\t\t\t\t<li>You use, or plan to use, quote data for any reason other than your own personal use.</li>\n\t\t\t\t<li>You are registered with FINRA, the SEC, or CFTC, any state securities agency, or any securities or commodities exchange or association.</li>\n\t\t\t\t<li>You are employed or registered as an Investment Advisor.</li>\n\t\t\t\t<li>You are employed by a bank, insurance company, or other non registered organization performing a job function that requires you to use quote data for any reason other than your own personal use.</li>\n\t\t\t</ul>\n\t\t\t<p>If none of these apply to you, you are considered a Non-Professional Subscriber.</p>\n\n\t\t\t<div class="pro-or-not" data-svi-show-input-errors="proOrNot">\n\t\t\t\t<input type="hidden" name="proOrNot" data-ng-required="true" data-ng-model="form.proOrNot" />\n\t\t\t\t<div id="{{::id}}-proOrNot">\n\t\t\t\t\t<div class="radio">\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type="radio" name="proOrNot_Y" id="{{::id}}-proOrNot-Y" value="Y" data-ng-model="form.proOrNotTemp" data-ng-change="updateProOrNot()">{{::labels.proOrNotY}}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="radio">\n\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t<input type="radio" name="proOrNot_N" id="{{::id}}-proOrNot-N" value="N" data-ng-model="form.proOrNotTemp" data-ng-change="updateProOrNot()">{{::labels.proOrNotN}}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<div class="block section-agreement-text">\n\t\t<div class="header">\n\t\t\t2. Accept the terms of the NYSE, NASDAQ OMX and OPRA Market Data Agreements \n\t\t\t<a href="/Web/PDF/rtqAgreement.pdf" download="rtqAgreement.pdf">Download</a>\n\t\t</div>\n\t\t<div class="body scroll-box">\n\t\t\t<a class="svi-visually-hidden" data-svi-skip-link=".section-market-agreements">Skip to end of agreement</a>\n\t\t\t<div data-svi-rtq-agreement-text></div>\n\t\t</div>\n\t</div>\n\n\t<div class="section-market-agreements section-buttons">\n\t\t<input type="hidden" name="marketAgreements" data-ng-required="true" data-ng-model="form.marketAgreements" />\n\t\t<button type="submit" ng-disabled="!form.proOrNot || form.marketAgreements" data-ng-click="acceptMarketAgreements()" name="acceptMarketAgreements" class="btn btn-default" data-ng-class="{disabled: !form.proOrNot || form.marketAgreements}">{{labels.acceptMarketAgreements}}</button>\n\t</div>\n\n\t<div class="block section-personal-info" data-ng-if="form.marketAgreements">\n\t\t<div class="header">\n\t\t\t3. Create your Subscriber Profile\n\t\t</div>\n\t\t<div class="body form-horizontal">\n\t\t\t<div class="form-group" data-svi-show-input-errors="firstname">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-firstname">{{::labels.firstname}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<input type="text" id="{{::id}}-firstname" name="firstname" data-ng-pattern="validation.firstnameRegex" data-ng-required="true" data-ng-model="form.firstname" class="form-control" maxlength="40" />\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="lastname">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-lastname">{{::labels.lastname}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<input type="text" id="{{::id}}-lastname" name="lastname" data-ng-pattern="validation.lastnameRegex" data-ng-required="true" data-ng-model="form.lastname" class="form-control" maxlength="80" />\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="address">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-address">{{::labels.address}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<input type="text" id="{{::id}}-address" name="address" data-ng-pattern="validation.addressRegex" data-ng-required="true" data-ng-model="form.address" class="form-control" maxlength="140" />\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="address2">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-address2">{{::labels.address2}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<input type="text" id="{{::id}}-address2" name="address2" data-ng-pattern="validation.address2Regex" data-ng-model="form.address2" class="form-control" maxlength="140" />\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="city">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-city">{{::labels.city}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<input type="text" id="{{::id}}-city" name="city" data-ng-pattern="validation.cityRegex" data-ng-required="true" data-ng-model="form.city" class="form-control" maxlength="140" />\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="country" data-ng-if="countryUsOnly">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-country">{{::labels.country}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<select class="form-control" id="{{::id}}-country" name="country" data-ng-required="true" data-ng-model="form.country"\n\t\t\t\t\t\tdata-ng-options="o.value as o.display for o in countryUsMenu"></select>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="country" data-ng-if="!countryUsOnly">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-country">{{::labels.country}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<select class="form-control" id="{{::id}}-country" name="country" data-ng-required="true" data-ng-model="form.country"\n\t\t\t\t\t\tdata-ng-options="o.value as o.display for o in countryMenu"></select>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="state" data-ng-if="!form.country || form.country === \'US\'">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-state">{{::labels.state}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<select class="form-control" id="{{::id}}-state" name="state" data-ng-required="true" data-ng-model="form.state"\n\t\t\t\t\t\tdata-ng-options="o.value as o.display for o in stateMenu"></select>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="zip" data-ng-if="!form.country || form.country === \'US\'">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-zip">{{::labels.zip}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<input type="text" id="{{::id}}-zip" name="zip" data-ng-pattern="validation.zipRegex" data-ng-required="true" data-ng-model="form.zip" class="form-control" maxlength="140" />\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="province" data-ng-if="form.country && form.country !== \'US\'">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-province">{{::labels.province}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<input type="text" id="{{::id}}-province" name="province" data-ng-pattern="validation.provinceRegex" data-ng-required="true" data-ng-model="form.province" class="form-control" maxlength="140" />\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group" data-svi-show-input-errors="postal" data-ng-if="form.country && form.country !== \'US\'">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-postal">{{::labels.postal}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<input type="text" id="{{::id}}-postal" name="postal" data-ng-pattern="validation.postalRegex" data-ng-required="true" data-ng-model="form.postal" class="form-control" maxlength="140" />\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="form-group occupation" data-svi-show-input-errors="occupation">\n\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-occupation">{{::labels.occupation}}</label>\n\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t<select data-svi-occupation data-pro-or-not="form.proOrNot" class="form-control" id="{{::id}}-occupation" name="occupation" data-ng-required="true" data-ng-model="form.occupation"\n\t\t\t\t\t\tdata-ng-options="o.value as o.display for o in occupationMenu"></select>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.profSubscriberOccupation && errors.errorCount == 1" data-ng-bind="labels.profSubscriberOccupation"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-employer-info" data-ng-if="form.marketAgreements && showEmployerInfo">\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employer">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employer">{{::labels.employer}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-employer" name="employer" data-ng-pattern="validation.employerRegex" data-ng-required="true" data-ng-model="form.employer" class="form-control" maxlength="80" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerAddress">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerAddress">{{::labels.employerAddress}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-employerAddress" name="employerAddress" data-ng-pattern="validation.addressRegex" data-ng-required="true" data-ng-model="form.employerAddress" class="form-control" maxlength="140" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerAddress2">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerAddress2">{{::labels.employerAddress2}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-employerAddress2" name="employerAddress2" data-ng-pattern="validation.address2Regex" data-ng-model="form.employerAddress2" class="form-control" maxlength="140" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerCity">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerCity">{{::labels.employerCity}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-employerCity" name="employerCity" data-ng-pattern="validation.cityRegex" data-ng-required="true" data-ng-model="form.employerCity" class="form-control" maxlength="140" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerCountry" data-ng-if="countryUsOnly">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerCountry">{{::labels.employerCountry}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<select class="form-control" id="{{::id}}-employerCountry" name="employerCountry" data-ng-required="true" data-ng-model="form.employerCountry"\n\t\t\t\t\t\t\tdata-ng-options="o.value as o.display for o in countryUsMenu"></select>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerCountry" data-ng-if="!countryUsOnly">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerCountry">{{::labels.employerCountry}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<select class="form-control" id="{{::id}}-employerCountry" name="employerCountry" data-ng-required="true" data-ng-model="form.employerCountry"\n\t\t\t\t\t\t\tdata-ng-options="o.value as o.display for o in countryMenu"></select>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerState" data-ng-if="!form.employerCountry || form.employerCountry === \'US\'">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerState">{{::labels.employerState}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<select class="form-control" id="{{::id}}-employerState" name="employerState" data-ng-required="true" data-ng-model="form.employerState"\n\t\t\t\t\t\t\tdata-ng-options="o.value as o.display for o in stateMenu"></select>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerZip" data-ng-if="!form.employerCountry || form.employerCountry === \'US\'">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerZip">{{::labels.employerZip}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-employerZip" name="employerZip" data-ng-pattern="validation.zipRegex" data-ng-required="true" data-ng-model="form.employerZip" class="form-control" maxlength="140" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerProvince" data-ng-if="form.employerCountry && form.employerCountry !== \'US\'">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerProvince">{{::labels.employerProvince}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-employerProvince" name="employerProvince" data-ng-pattern="validation.provinceRegex" data-ng-required="true" data-ng-model="form.employerProvince" class="form-control" maxlength="140" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="employerPostal" data-ng-if="form.employerCountry && form.employerCountry !== \'US\'">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-employerPostal">{{::labels.employerPostal}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-employerPostal" name="employerPostal" data-ng-pattern="validation.postalRegex" data-ng-required="true" data-ng-model="form.employerPostal" class="form-control" maxlength="140" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="jobTitle">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-jobTitle">{{::labels.jobTitle}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-jobTitle" name="jobTitle" data-ng-pattern="validation.jobTitleRegex" data-ng-required="true" data-ng-model="form.jobTitle" class="form-control" maxlength="140" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="form-group" data-svi-show-input-errors="jobDesc">\n\t\t\t\t\t<label class="col-sm-4 control-label" for="{{::id}}-jobDesc">{{::labels.jobDesc}}</label>\n\t\t\t\t\t<div class="col-sm-8">\n\t\t\t\t\t\t<input type="text" id="{{::id}}-jobDesc" name="jobDesc" data-ng-pattern="validation.jobDescRegex" data-ng-required="true" data-ng-model="form.jobDesc" class="form-control" maxlength="140" />\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t\t\t\t\t\t<div class="on-error help-block" data-on-error="errors.pattern && errors.errorCount == 1" data-ng-bind="labels.fieldInvalid"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n')}]),angular.module("rtqAgreementText/nasdaq.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("rtqAgreementText/nasdaq.tpl.html",'<h3 class="svi-x important">On-Line Nasdaq Subscriber Agreement</h3>\n\n<div>\n\t<h4>DISCLOSURE - PLEASE READ</h4>\n\t\n\t<p class="svi-x">Subscribers must sign a contract entitled The Nasdaq Stock Market, Inc. ("Nasdaq") Subscriber Agreement ("Agreement") in order to receive Information [see definition in Paragraph [1] of the Agreement] from Nasdaq. While all terms are important, please particularly note the following. For more information regarding each term, the paragraph number at the end of each term refers to the paragraph in the Agreement where more information can be located.</p>\n\t\n\t<p class="svi-x"><strong class="svi-x">RESTRICTIONS ON USES &amp; TRANSFER:</strong> Subscribers may not provide access to Information or transfer the Agreement to others. The Information is only for personal non-professional use or, if you are a Professional Subscriber (see definition in Paragraph [1] of the Agreement) for internal business use and/or personal use. [Paragraph 3]</p>\n\t\n\t<p class="svi-x"><strong class="svi-x">MOST TYPES OF DAMAGES ARE EXCLUDED AND REMAINING DAMAGES ARE LIMITED:</strong> Nasdaq is not liable for trading losses, lost profits or incidental, consequential or other indirect damages, even if the Information is untimely or incorrect. Other damages (if any), are strictly limited (in contract, tort, or otherwise) to a capped amount. [Paragraphs 9 and 10]</p>\n\t\n\t<p class="svi-x"><strong class="svi-x">NO IMPLIED OR STATUTORY WARRANTIES OR DUTIES:</strong> All warranties and duties (if any) are eliminated. There are no express warranties except for a Limited Warranty regarding efforts only. STOCK QUOTES MIGHT NOT BE CURRENT OR ACCURATE. [Paragraph 9]</p>\n\t\n\t<p class="svi-x"><strong class="svi-x">SUBSCRIBERS PROVIDE AN INDEMNITY:</strong> Subscriber indemnifies and holds harmless Nasdaq for any Claims or Losses (see definition in Paragraph [1] of the Agreement) resulting from Subscriber\'s breach of the Agreement, for Subscriber\'s infringement of a third party\'s intellectual property rights, or from any third party suit related to Subscriber\'s use or receipt of the Information. [Paragraph 13 and 14]</p>\n\t\n\t<p class="svi-x"><strong class="svi-x">MARYLAND LAWS AND COURTS APPLY:</strong> Everything relating to the Agreement is governed by the laws of the United States and the State of Maryland and any disputes can only be heard in Maryland. [Paragraph 23]</p>\n\t\n\t<p class="svi-x"><strong class="svi-x">NO ORAL AMENDMENTS &amp; ONLY NASDAQ MAY AMEND:</strong> The Agreement may not be altered orally and may be altered by Nasdaq pursuant to an Agreement procedure which includes notice either to Subscriber or to Vendor. Failure to terminate the Agreement before, or use of Information after, an amendment will be Subscriber\'s consent (or confirmation of an earlier consent) to the amendment. [Paragraph 17 and 21]</p>\n\t\n\t<p class="svi-x"><strong class="svi-x">VENDORS CAN IMPACT SUBSCRIBER\'S RIGHTS BUT NOT NASDAQ\'S RIGHTS:</strong> Vendor does not have authority to change the Agreement. Vendors are obligated to provide notice of Nasdaq changes to Subscriber, but if they do not, Nasdaq\'s notice to Vendor is still effective, as to Subscriber including notice of cancellation. [Above Paragraph 1 and Paragraph 17]</p>\n\t\n\t<p class="svi-x">The Agreement appears below. If you are at least 18 years old, sign it as either a Professional or a Non-Professional Subscriber by signing your name or other symbol of your signature on the "Signature" line in the appropriate signature part(s) below.</p>\n</div>\n\n<h4>Nasdaq Subscriber Agreement</h4>\n\n<div>\n\t<p>THE VENDOR AND ITS AGENTS MAY NOT MODIFY OR WAIVE ANY TERM OF THIS AGREEMENT. ANY ATTEMPT TO MODIFY THIS AGREEMENT, EXCEPT BY NASDAQ, IS VOID.\n\t\n\t<p>1. The word "Nasdaq" means The Nasdaq Stock Market, Inc. and its affiliates. The word "Information" means certain data and other information: relating to securities or other financial instruments, products, vehicles or devices; or relating to Persons regulated by Nasdaq or to activities of Nasdaq; or gathered by Nasdaq from other sources. The word "or" includes the word "and". The phrase "Claims or Losses" means any and all liabilities, obligations, losses, damages, penalties, claims, actions, suits, costs, judgments, settlements, and expenses of whatever nature, whether incurred by or issued against an indemnified party or a third party, including, without limitation, (1) indirect, special, punitive, consequential or incidental loss or damage, (including, but not limited to, trading losses, loss of anticipated profits, loss by reason of shutdown in operation or increased expenses of operation, or other indirect loss or damage) and (2) administrative costs, investigatory costs, litigation costs, and auditors\' and attorneys\' and fees and disbursements (including in-house personnel). The word "Person" means any natural person, proprietorship, corporation, partnership, or other entity whatsoever. The phrase "Non-Professional Subscriber" means any natural person who is neither: (a) registered or qualified in any capacity with the SEC, the Commodities Futures Trading Commission, any state securities agency, any securities exchange or association, or any commodities or futures contract market or association; (b) engaged as an "investment advisor" as that term is defined in Section 201 (11) of the Investment Advisors Act of 1940 (whether or not registered or qualified under that Act); nor, (c) employed by a bank or other organization exempt from registration under federal or state securities laws to perform functions that would require registration or qualification if such functions were performed for an organization not so exempt. The phrase "Professional Subscriber" means all other persons who do not meet the definition of Non-Professional Subscriber. When it appears alone, the word "Subscriber" encompasses all Non-Professional and Professional Subscribers. The phrase "Vendor\'s Service" means the service from a vendor, including the data processing equipment, software, and communications facilities related thereto, for receiving, processing, transmitting, using and disseminating the Information to or by Subscriber.</p>\n\t\n\t<p>2. Subscriber is granted the right to receive from Nasdaq the Information under the terms stated herein or in the NASD Rules. "NASD Rules" shall mean all applicable laws (including intellectual property, communications, and securities laws), statutes, and regulations, the rules and regulations of the SEC, the rules and regulations of Nasdaq including, but not limited to, those requirements established by Nasdaq\'s rule filings (with such SEC approval as may be required), Nasdaq\'s decisions and interpretations and any User Guides, or successors of the components of the NASD Rules, as they may exist at the time. For Professional Subscriber, if any payment is due directly to Nasdaq under this Agreement, payment in full is due Nasdaq in immediately available U.S. funds, within 30 days of the date of an invoice, whether or not use is made of, or access is made to, the Information. Interest shall be due from the date of the invoice to the time that the amount(s) that are due have been paid. Subscriber shall assume full and complete responsibility for the payment of any taxes, charges or assessments imposed on Subscriber or Nasdaq (except for U.S. federal, state, or local income taxes, if any, imposed on Nasdaq) by any foreign or domestic national, state, provincial or local governmental bodies, or subdivisions thereof, and any penalties or interest, relating to the provision of the Information to Subscriber.</p>\n\t\n\t<p>3. The Information is licensed only for the personal use of the Non-Professional Subscriber and the internal business use and/or personal use of the Professional Subscriber. By representing to Vendor that Subscriber is a non-professional, or by continuing to receive the Information at a non-professional subscriber rate, Subscriber is affirming to Vendor and Nasdaq that Subscriber meets the definition of Non-Professional Subscriber as set forth in paragraph 1 above. Subscriber will promptly give written notice to Vendor of any change in the name or place of residence or place of business at which the Information is received. Subscriber may not sell, lease, furnish or otherwise permit or provide access to the Information to any other Person or to any other office, or place. Subscriber will not engage in the operation of any illegal business; use or permit anyone else to use the Information, or any part thereof, for any illegal purpose; or violate any NASD Rule. Professional Subscribers may, on a non-continuous basis, furnish limited amounts of the Information to customers: in written advertisements, correspondence, or other literature; or during voice telephonic conversations not entailing computerized voice, automated information inquiry systems, or similar technologies. Subscriber may not present the Information rendered in any unfair, misleading, or discriminatory format. Subscriber shall take reasonable security precautions to prevent unauthorized Persons from gaining access to the Information.</p>\n\t\n\t<p>4. Subscriber acknowledges that Nasdaq, in its sole discretion, may from time to time make modifications to its system or the Information. Such modifications may require corresponding changes to be made in Vendor\'s Service. Changes or the failure to make timely changes by Vendor or Subscriber may sever or affect Subscriber\'s access to or use of the Information. Nasdaq shall not be responsible for such effects.</p>\n\t\n\t<p>5. Nasdaq grants to Subscriber a nonexclusive, non-transferable license during the term of the Agreement to receive and use the Information transmitted to it by Vendor and thereafter to use such Information for any purpose not inconsistent with the terms of the Agreement or with the NASD Rules. Subscriber acknowledges and agrees that Nasdaq has proprietary rights in the Information that originates on or derives from markets regulated or operated by Nasdaq and compilation or other rights in Information gathered from other sources. Subscriber further acknowledges and agrees that Nasdaq\'s third party Information providers have exclusive proprietary rights in their respective Information. In the event of any misappropriation or misuse, Nasdaq or its third party information providers shall have the right to obtain injunctive relief for its respective materials. Subscriber will attribute source as appropriate under all the circumstances.</p>\n\t\n\t<p>6. Subscriber acknowledges that Nasdaq, as a subsidiary of NASD, when required to do so by NASD in fulfillment of NASD\'s statutory obligations, may by notice to Vendor unilaterally limit or terminate the right of any or all Persons to receive or use the Information, and that Vendor will immediately comply with any such notice and will terminate or limit the furnishing of the Information and confirm such compliance by notice to Nasdaq. Any affected Person will have available to it such procedural protections as are provided by the Exchange Act and applicable rules there under. Neither Nasdaq nor NASD shall have any liability when complying with such NASD notice.</p>\n\t\n\t<p>7. Professional Subscriber shall make its premises available to Nasdaq for physical inspection of Vendor\'s Service and of Professional Subscriber\'s use of the Information (including review of any records regarding use of, or access to, the Information and the number and locations of all devices that receive Information), all at reasonable times, upon reasonable notice, to ensure compliance with this Agreement. Non-professional Subscriber shall comply promptly with any reasonable request from Nasdaq for information regarding the Non-Professional Subscriber\'s receipt, processing, display and redistribution of the Information.</p>\n\t\n\t<p>8. To the extent permitted by applicable law, Subscriber acknowledges and agrees that the termination of the Vendor\'s Service for failure to make payments shall not be deemed or considered to be, and Subscriber waives any right to represent or assert that any such exercise constitutes, an act or omission or an improper denial or limitation of access by Nasdaq to any service or facility operated by Nasdaq as contemplated in Section 11A of the Exchange Act, or any other provision of the Exchange Act, or any rule, regulation, or interpretation adopted there under.</p>\n\t\n\t<p>9. NASDAQ\'S WARRANTIES/DISCLAIMER OF WARRANTIES. NASDAQ SHALL ENDEAVOR TO OFFER THE INFORMATION AS PROMPTLY AND ACCURATELY AS IS REASONABLY PRACTICABLE. IN THE EVENT THAT THE INFORMATION IS NOT AVAILABLE AS A RESULT OF A FAILURE BY NASDAQ TO PERFORM ITS OBLIGATIONS UNDER THIS AGREEMENT, NASDAQ WILL ENDEAVOR, GIVING DUE REGARD FOR THE COST, TIME, AND EFFECT ON OTHER USERS, TO CORRECT ANY SUCH FAILURE. IN THE EVENT THAT THE INFORMATION IS NOT AVAILABLE, IS DELAYED, IS INTERRUPTED, IS INCOMPLETE, OR IS NOT ACCURATE OR IS OTHERWISE MATERIALLY AFFECTED FOR A CONTINUOUS PERIOD OF FOUR (4) HOURS OR MORE DURING THE TIME THAT NASDAQ REGULARLY TRANSMITS THE INFORMATION DUE TO THE FAULT OF NASDAQ (EXCEPT FOR A REASON PERMITTED IN THIS AGREEMENT OR IN NASDAQ\'S AGREEMENT WITH THE VENDOR), SUBSCRIBER\'S OR ANY OTHER PERSON\'S EXCLUSIVE REMEDY AGAINST NASDAQ SHALL BE (A) IF SUBSCRIBER OR ANY OTHER PERSON CONTINUES TO RECEIVE THE INFORMATION OR ANY OTHER DATA AND/OR INFORMATION OFFERED BY NASDAQ, A PRORATED MONTH\'S CREDIT OF ANY MONIES DUE, IF ANY, FOR THE AFFECTED INFORMATION DIRECTLY TO NASDAQ FROM SUBSCRIBER, OR, IF APPLICABLE, FROM SAID OTHER PERSON, FOR THE PERIOD AT ISSUE OR, (B) IF SUBSCRIBER OR ANY OTHER PERSON NO LONGER RECEIVES EITHER THE INFORMATION OR ANY OTHER DATA AND/OR INFORMATION OFFERED BY NASDAQ, A PRORATED MONTH\'S REFUND OF ANY MONIES DUE FOR THE AFFECTED INFORMATION DIRECTLY TO NASDAQ FROM SUBSCRIBER, OR, IF APPLICABLE, FROM SAID OTHER PERSON, FOR THE PERIOD AT ISSUE. SUCH CREDIT OR REFUND SHALL, IF APPLICABLE, BE REQUESTED BY WRITTEN NOTICE TO NASDAQ WITH ALL PERTINENT DETAILS. <strong class="svi-x">BEYOND THE WARRANTIES STATED IN THIS SECTION, THERE ARE NO OTHER WARRANTIES OF ANY KIND, EXPRESS, IMPLIED OR STATUTORY (INCLUDING, WITHOUT LIMITATION, TIMELINESS, TRUTHFULNESS, SEQUENCE, COMPLETENESS, ACCURACY, FREEDOM FROM INTERRUPTION), ANY IMPLIED WARRANTIES ARISING FROM TRADE USAGE, COURSE OF DEALING, OR COURSE OF PERFORMANCE, OR THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE OR PURPOSE.</strong></p>\n\t\n\t<p>\n\t\t<strong class="svi-x">10. NASDAQ\'S LIMITATION OF LIABILITY.</strong>\n\t\t<ul>\n\t\t\t<li>(A) EXCEPT AS MAY OTHERWISE BE SET FORTH HEREIN, NASDAQ SHALL NOT BE LIABLE TO SUBSCRIBER, ITS VENDOR OR ANY OTHER PERSON FOR INDIRECT, SPECIAL, PUNITIVE, CONSEQUENTIAL, OR INCIDENTAL LOSS OR DAMAGE (INCLUDING, BUT NOT LIMITED TO, TRADING LOSSES, LOSS OF ANTICIPATED PROFITS, LOSS BY REASON OF SHUTDOWN IN OPERATION OR INCREASED EXPENSES OF OPERATION, COST OF COVER, OR OTHER INDIRECT LOSS OR DAMAGE) OF ANY NATURE ARISING FROM ANY CAUSE WHATSOEVER, EVEN IF NASDAQ HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</li>\n\t\t\t<li>(B) NASDAQ SHALL NOT BE LIABLE TO SUBSCRIBER OR ANY OTHER PERSON FOR ANY UNAVAILABILITY, INTERRUPTION, DELAY, INCOMPLETENESS, OR INACCURACY OF THE INFORMATION THAT LASTS LESS THAN FOUR (4) CONTINUOUS HOURS DURING THE TIME THAT NASDAQ REGULARLY TRANSMITS THE INFORMATION OR IF THE INFORMATION IS MATERIALLY AFFECTED FOR LESS THAN FOUR (4) CONTINUOUS HOURS DURING THE TIME THAT NASDAQ REGULARLY TRANSMITS THE INFORMATION.</li>\n\t\t\t<li>(C) IF NASDAQ IS FOR ANY REASON HELD LIABLE TO SUBSCRIBER OR TO ANY OTHER PERSON, WHETHER IN TORT OR IN CONTRACT, THE LIABILITY OF NASDAQ WITHIN A SINGLE YEAR (FROM THE EFFECTIVE DATE OF THE AGREEMENT) OF THE AGREEMENT [COMBINED WITH THE TOTAL OF ALL CLAIMS OR LOSSES OF SUBSCRIBER\'S VENDOR, AND ANY OTHER PERSON CLAIMING THROUGH, ON BEHALF OF, OR AS HARMED BY SUBSCRIBER] IS LIMITED TO AN AMOUNT OF SUBSCRIBER\'S DAMAGES THAT ARE ACTUALLY INCURRED BY SUBSCRIBER IN REASONABLE RELIANCE, AND WHICH AMOUNT DOES NOT EXCEED THE LESSER OF: (I) IF SUBSCRIBER OR ANY OTHER PERSON CONTINUES TO RECEIVE THE INFORMATION OR ANY OTHER DATA AND/OR INFORMATION OFFERED BY NASDAQ, A PRORATED MONTH\'S CREDIT OF ANY MONIES DUE DIRECTLY TO NASDAQ FROM SUBSCRIBER, OR, IF APPLICABLE, FROM ANY OTHER PERSON, FOR THE INFORMATION AT ISSUE DURING THE PERIOD AT ISSUE OR, IF SUBSCRIBER OR ANY OTHER PERSON NO LONGER RECEIVES EITHER THE INFORMATION OR ANY OTHER DATA AND/OR INFORMATION OFFERED BY NASDAQ, A REFUND OF ANY MONIES DUE DIRECTLY TO NASDAQ FROM SUBSCRIBER, OR, IF APPLICABLE, FROM ANY OTHER PERSON, FOR THE INFORMATION AT ISSUE DURING THE PERIOD AT ISSUE; OR (II) $500.00.</li>\n\t\t\t<li>(D) THIS SECTION SHALL NOT RELIEVE NASDAQ, SUBSCRIBER OR ANY OTHER PERSON FROM LIABILITY FOR DAMAGES THAT RESULT FROM THEIR OWN GROSS NEGLIGENCE OR WILLFUL TORTUOUS MISCONDUCT, OR FROM PERSONAL INJURY OR WRONGFUL DEATH CLAIMS.</li>\n\t\t\t<li>(E) SUBSCRIBER AND NASDAQ UNDERSTAND AND AGREE THAT THE TERMS OF THIS SECTION REFLECT A REASONABLE ALLOCATION OF RISK AND LIMITATION OF LIABILITY.</li>\n\t\t</ul>\n\t</p>\n\t\n\t<p><strong class="svi-x">11. THIRD PARTY INFORMATION PROVIDERS\' DISCLAIMERS OF WARRANTIES/LIMITATIONS OF LIABILITIES. NASDAQ\'S THIRD PARTY INFORMATION PROVIDERS MAKE NO WARRANTIES OF ANY KIND, EXPRESS, IMPLIED OR STATUTORY (INCLUDING, WITHOUT LIMITATION, TIMELINESS, TRUTHFULNESS, SEQUENCE, COMPLETENESS, ACCURACY, FREEDOM FROM INTERRUPTION), ANY IMPLIED WARRANTIES ARISING FROM TRADE USAGE, COURSE OF DEALING, OR COURSE OF PERFORMANCE, OR THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE OR PURPOSE AND THEY SHALL HAVE NO LIABILITY FOR THE ACCURACY OF, OR FOR DELAYS OR OMISSIONS IN, ANY OF THE INFORMATION PROVIDED BY THEM.</strong> NASDAQ\'S THIRD PARTY INFORMATION PROVIDERS SHALL ALSO HAVE NO LIABILITY FOR ANY DAMAGES, WHETHER DIRECT OR INDIRECT, WHETHER LOST PROFITS, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OF THE SUBSCRIBER OR ANY OTHER PERSON SEEKING RELIEF THROUGH SUBSCRIBER, EVEN IF THE THIRD PARTY INFORMATION PROVIDERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL THE LIABILITY OF THE THIRD PARTY INFORMATION PROVIDERS OR THEIR AFFILIATES TO SUBSCRIBER OR ANY OTHER PERSON SEEKING RELIEF THROUGH SUBSCRIBER PURSUANT TO ANY CAUSE OF ACTION, WHETHER IN CONTRACT, TORT, OR OTHERWISE, EXCEED THE FEE PAID BY SUBSCRIBER OR ANY OTHER PERSON SEEKING RELIEF THROUGH SUBSCRIBER, AS APPLICABLE.</p>\n\t\n\t<p>12. Notwithstanding any other term or condition of this Agreement, Nasdaq, its third party information providers or Subscriber shall not be obligated to perform or observe their respective obligations undertaken in this Agreement (except for obligations to make payments hereunder and regulatory obligations) if prevented or hindered from doing so by any circumstances found to be beyond their control.</p>\n\t\n\t<p>13. Subscriber will indemnify and hold harmless Nasdaq and its employees, officers, directors, and other agents from any and all Claims or Losses imposed on, incurred by or asserted as a result of or relating to: (a) any noncompliance by Subscriber with the terms and conditions hereof; (b) any third-party actions related to Subscriber\'s receipt and use of the Information, whether authorized or unauthorized under the Agreement.</p>\n\t\n\t<p>14. Each party warrants and represents and will indemnify and hold harmless (and in every case, Nasdaq shall be permitted to solely defend and settle) another party (including Nasdaq) and their officers, directors, employees, and other agents, against any Claims or Losses arising from, involving, or relating to a claim of infringement or other violation of an intellectual property right by the indemnifying party, its actions or omissions, equipment, or other property. This right is conditioned on the indemnified party giving prompt written notice to the indemnifying party (as does not prejudice the defense) of the Claims or Losses and providing cooperation in the defense of the Claims or Losses (without waiver of attorney-client, work-product or other legal privilege, or disclosure of information legally required to be kept confidential).</p>\n\t\n\t<p>15. Subscriber agrees that Nasdaq may enforce the terms of this Agreement against any Person, whether or not Vendor or Subscriber is a party to any such action or against Subscriber itself. In any action there shall be available injunctive relief or damages, with the prevailing party being awarded costs and attorneys\' fees (including in-house counsel).</p>\n\t\n\t<p>16. In the event of any conflict between the terms of this Agreement and of the Vendor\'s agreement, the terms of this Agreement shall prevail as between Nasdaq and Subscriber.</p>\n\t\n\t<p>17. In addition to terminations permitted under the Vendor\'s agreement, this Agreement may be terminated by Subscriber on 30 days written notice to Vendor and by Nasdaq on 30 days written notice either to Vendor or Subscriber. Nasdaq may also alter any term of this Agreement on 60 days written notice either to Vendor or Subscriber, and any use after such date is deemed acceptance of the new terms. In the event of Subscriber breach, discovery of the untruth of any representation of Subscriber, or where directed by NASD in its regulatory authority, Nasdaq may terminate this Agreement on not less than three (3) days written notice to Subscriber provided either by Nasdaq or Vendor.</p>\n\t\n\t<p>18. Nasdaq does not endorse or approve any equipment, Vendor, or Vendor\'s Service.</p>\n\t\n\t<p>19. Natural persons executing this Agreement warrant and represent that they are at least eighteen (18) years of age. Subscriber and the Person executing this Agreement on behalf of Subscriber which is a proprietorship, corporation, partnership or other entity, represent that such Person is duly authorized by all necessary and appropriate corporate or other action to execute the Agreement on behalf of Subscriber.</p>\n\t\n\t<p>20. All notices, invoices, and other communications required to be given in writing under this Agreement shall be directed to: The Nasdaq Stock Market, Inc., 1735 K Street, NW, Washington, DC 20006, Attn.: Manager: Market Data Distribution, or to Subscriber at the last address known to the Vendor, and shall be deemed to have been duly given upon actual receipt by the parties, or upon constructive receipt if sent by certified mail, postage pre-paid, return receipt requested, at such address or to such other address as any party hereto shall hereafter specify by written notice to the other party or parties hereto.</p>\n\t\n\t<p>21. Except as otherwise provided herein, no provision of this Agreement may be amended, modified, or waived, unless by an instrument in writing executed by a duly authorized signatory of the party against whom enforcement of such amendment, modification, or waiver is sought. No failure on the part of Nasdaq or Subscriber to exercise, no delay in exercising, and no course of dealing with respect to any right, power, or privilege under this Agreement shall operate as a waiver thereof, nor shall any single or partial exercise of any such right, power, or privilege preclude any other or further exercise thereof or the exercise of any other right, power, or privilege under this Agreement. If any of the provisions of this Agreement, or application thereof to any Person or circumstance, shall to any extent be held invalid or unenforceable, the remainder of this Agreement, or the application of such terms or provisions to Persons or circumstances other than those as to which they are held invalid or unenforceable, shall not be affected thereby and each such term and provision of this Agreement shall be valid and enforceable to the fullest extent permitted by law.</p>\n\t\n\t<p>22. The terms of this Agreement apply to those obligations that survive any cancellation, termination, or rescission, namely, obligations relating to intellectual property, indemnification, limitation of liability, warranties, disclaimer of warranties, and Exchange Act related provisions.</p>\n\t\n\t<p>23. This Agreement shall be deemed to have been made in the United States in the State of Maryland and shall be construed and enforced in accordance with, and the validity and performance hereof shall be governed by, the laws of the State of Maryland, without reference to principles of conflicts of laws thereof. Subscriber hereby consents to submit to the jurisdiction of the courts of or for the State of Maryland in connection with any action or proceeding instituted relating to this Agreement.</p>\n</div>\n')}]),angular.module("rtqAgreementText/nyse.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("rtqAgreementText/nyse.tpl.html",'<h3 class="svi-x important"> NYSE Exchange &ndash; Subscriber Agreement</h3>\n\n<div>\n\t<p class="svi-x">The New York Stock Exchange requires the following agreement to be completed before <strong class="svi-x">InvestCloud, Inc.</strong> can provide real-time data. Since the agreement is submitted electronically, please print these pages for your records. You are required to complete the required fields in order to confirm your agreement to these terms. We cannot process your registration without this confirmation.</p>\n\t\n\t<h4>\n\t\tAGREEMENT FOR MARKET DATA<br />\n\t\tDISPLAY SERVICES<br />\n\t\t(Usage-Based Services/Nonprofessional Subscriber Status)<br />\n\t\t(Electronic Version)\n\t</h4>\n\t\n\t<p class="svi-x">InvestCloud, Inc. ("Vendor") agrees to make "Market Data" available to you pursuant to the terms and conditions set forth in this agreement. By executing this Agreement in the space indicated below, you ("Subscriber") agree to comply with those terms and conditions. Section 1 sets forth terms and conditions of general applicability. Section 2 applies insofar as Subscriber receives and uses Market Data made available pursuant to this Agreement.</p>\n\t\n\t<h4>SECTION 1: TERMS AND CONDITIONS OF GENERAL APPLICABILITY</h4>\n\t\n\t<p class="svi-x"><strong>1. MARKET DATA DEFINITION </strong>- For all purposes of this Agreement, "Market Data" means (a) last sale information and quotation information relating to securities that are admitted to dealings on the New York Stock Exchange ("NYSE"), (b) such bond and other equity last sale and quotation information, and such index and other market information, as United States-registered national securities exchanges and national securities associations (each, an "Authorizing SRO") may make available and as the NYSE may from time to time designate as "Market Data"; and (c) all information that derives from any such information.</p>\n\t\n\t<p class="svi-x"><strong>2. PROPRIETARY NATURE OF DATA</strong> - Subscriber understands and acknowledges that each Authorizing SRO and Other Data Disseminator has a proprietary interest in the Market Data that originates on or derives from it or its market(s).</p>\n\t\n\t<p class="svi-x"><strong>3. ENFORCEMENT</strong> - Subscriber understands and acknowledges that (a) the Authorizing SROs are third-party beneficiaries under this Agreement and (b) the Authorizing SROs or their authorized representative(s) may enforce this Agreement, by legal proceedings or otherwise, against Subscriber or any person that obtains Market Data that is made available pursuant to this Agreement other than as this Agreement contemplates. Subscriber shall pay the reasonable attorney\'s fees that any Authorizing SRO incurs in enforcing this Agreement against Subscriber.</p>\n\t\n\t<p class="svi-x"><strong>4. DATA NOT GUARANTEED</strong> - Subscriber understands that no Authorizing SRO, no other entity whose information is made available over the Authorizing SROs\' facilities (an "Other Data Disseminator") and no information processor that assists any Authorizing SRO or Other Data Disseminator in making Market Data available (collectively, the "Disseminating Parties") guarantees the timeliness, sequence, accuracy or completeness of Market Data or of other market information or messages disseminated by any Disseminating Party. Neither Subscriber nor any other person shall hold any Disseminating Party liable in any way for (a) any inaccuracy, error or delay in, or omission of, (i) any such data, information or message or (ii) the transmission or delivery of any such data, information or message, or (b) any loss or damage arising from or occasioned by (i) any such inaccuracy, error, delay or omission, (ii) non- performance or (iii) interruption in any such data, information or message, due either to any negligent act or omission by any Disseminating Party, to any "force majeure" (e.g., flood, extraordinary weather conditions, earthquake or other act of God, fire, war, insurrection, riot, labor dispute, accident, action of government, communications or power failure, equipment or software malfunction) or to any other cause beyond the reasonable control of any Disseminating Party</p>\n\t\n\t<p class="svi-x"><strong>5. PERMITTED USE</strong> - Subscriber shall not furnish Market Data to any other person or entity. If Subscriber receives Market Data other than as a Nonprofessional Subscriber, it shall use Market Data only for its individual use in its business.</p>\n\t\n\t<p class="svi-x"><strong>6. DISSEMINATION DISCONTINUANCE OR MODIFICATION</strong> - Subscriber understands and acknowledges that, at any time, the Authorizing SROs may discontinue disseminating any category of Market Data, may change or eliminate any transmission method and may change transmission speeds or other signal characteristics. The Authorizing SROs shall not be liable for any resulting liability, loss or damages that may arise therefrom.</p>\n\t\n\t<p class="svi-x"><strong>7. DURATION; SURVIVAL</strong> - This Agreement remains in effect for so long as Subscriber has the ability to receive Market Data as contemplated by this Agreement. In addition, Vendor may terminate this Agreement at any time, whether at the direction of the Authorizing SROs or otherwise. Paragraphs 2, 3 and 4, and the first two sentences of Paragraph 8, survive any termination of this Agreement.</p>\n\t\n\t<p class="svi-x"><strong>8. MISCELLANEOUS</strong> - The laws of the State of New York shall govern this Agreement and it shall be interpreted in accordance with those laws. This Agreement is subject to the Securities Exchange Act of 1934, the rules promulgated under that act, and the joint-industry plans entered into pursuant to that act. This writing contains the entire agreement between the parties in respect of its subject matter. Subscriber may not assign all or any part of this Agreement to any other person. The person executing this Agreement below represents and warrants that he or she has legal capacity to contract and, if that person is executing this Agreement on behalf of a proprietorship or a business, partnership or other organization, represents and warrants that he or she has actual authority to bind the organization.</p>\n</div>\n')}]),angular.module("rtqAgreementText/opra.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("rtqAgreementText/opra.tpl.html",'<h3 class="svi-x important">\n\tOPTIONS PRICE REPORTING AUTHORITY<br />\n\t(Options Last Sale and Quotation Information)\n</h3>\n\n<p class="svi-x">IMPORTANT NOTICE: THIS SUBSCRIBER AGREEMENT (THIS "AGREEMENT") IS AN AGREEMENT BETWEEN YOU AND INVESTCLOUD, INC. FOR YOU TO RECEIVE INFORMATION PUBLISHED BY THE OPTIONS PRICE REPORTING AUTHORITY, LLC ("OPRA"). PLEASE READ THIS AGREEMENT CAREFULLY. AFTER YOU HAVE READ THIS AGREEMENT, PLEASE INDICATE YOUR AGREEMENT TO BE BOUND BY ITS TERMS AND CONDITIONS BY CLICKING ON THE "I AGREE" BUTTON AT THE END. IF YOU DO NOT AGREE TO THESE TERMS AND CONDITIONS, YOU WILL BE UNABLE TO RECEIVE THE INFORMATION.</p>\n\n<p class="svi-x">By completing and submitting this Agreement, you are applying to receive from <strong class="svi-x">InvestCloud, Inc.</strong> ("Vendor") a market data service (the "Service") providing access to current options last sale information, current options quotation information and related information ("Options Information") published by the Options Price Reporting Authority ("OPRA") pursuant to a Plan declared effective by the Securities and Exchange Commission. The "OPRA Participants" are those national securities exchanges who, from time to time, are parties to this Plan. Those persons who act from time to time as data processors on behalf of OPRA are referred to herein as "OPRA"s Processor."</p>\n\n<p class="svi-x">2. You shall receive the Service and the Options Information included therein solely for your own use, and you shall not retransmit or otherwise furnish the Options Information to any other person.</p>\n\n<p class="svi-x">3. You acknowledge that the Options Information is and shall remain the property of the respective exchange or other market on which a reported transaction took place or a reported quotation was entered.</p>\n\n<p class="svi-x">4. DISCLAIMER OF LIABILITY - NEITHER VENDOR, OPRA, OPRA\'S PROCESSOR NOR ANY OPRA PARTICIPANT GUARANTEES THE TIMELINESS, SEQUENCE, ACCURACY OR COMPLETENESS OF ANY OF THE OPRA DATA SUPPLIED TO YOU HEREUNDER AND NEITHER VENDOR, OPRA, OPRA\'S PROCESSOR NOR ANY OPRA PARTICIPANT SHALL BE LIABLE IN ANY WAY, TO YOU OR TO ANY OTHER PERSON, FOR ANY LOSS, DAMAGES, COST OR EXPENSE WHICH MAY ARISE FROM ANY FAILURE OF PERFORMANCE BY VENDOR, OPRA, OPRA\'S PROCESSOR OR ANY OPRA PARTICIPANT, OR FROM ANY DELAYS, INACCURACIES, ERRORS IN OR OMISSIONS OF, ANY OF THE OPRA DATA OR IN THE TRANSMISSION OR DELIVERY THEREOF, WHETHER OR NOT DUE TO ANY NEGLIGENT ACT OR OMISSION ON THE PART OF VENDOR, OPRA, OPRA\'S PROCESSOR OR ANY OPRA PARTICIPANT. IN NO EVENT SHALL VENDOR, OPRA, OPRA\'S PROCESSOR OR ANY PARTICIPANT BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, TRADING LOSSES, OR DAMAGES RESULTING FROM INCONVENIENCE OR LOSS OF USE OF THE SERVICE.</p>\n\n<p class="svi-x">5. The terms and conditions of this Agreement may be modified at any time upon notice to you. If you do not assent to the terms of any such modified Agreement at or prior to the time you next attempt to access the Service, this Agreement shall automatically be terminated.</p>\n\n<p class="svi-x">6. Your privilege of receiving the Options Information hereunder may be terminated by you or by Vendor upon 30 days written notice from the terminating party to the other party, and may be terminated immediately upon a determination by Vendor or OPRA that you are not in compliance with this Agreement.</p>\n\n<p class="svi-x">7. Nothing herein shall be deemed to prevent or restrict OPRA, OPRA\'s Processor or any OPRA Participant from discontinuing to furnish Options Information for dissemination or from making such changes in the speed of transmission, the characteristics of the electrical signals representing the Options Information or the manner of disseminating the same, as OPRA shall from time to time determine to be appropriate, with or without notice to you. You shall not hold OPRA, OPRA\'s Processor, or any OPRA Participant liable for any resulting liability, loss or damage that may arise there from.</p>\n\n<p class="svi-x">8. You agree to inform Vendor promptly in writing at its address set forth above of any changes in the information provided herein and to furnish Vendor any additional information requested by it in connection with your receipt of the Options Information.</p>\n\n<p class="svi-x">9. The parties acknowledge and agree that this Agreement is for the express benefit of OPRA, OPRA\'s Processor and each OPRA Participant.</p>\n\n<p class="svi-x">10. The provisions of Sections 3, 4 and 9 survive any termination of this Agreement and remain in full force and effect.</p>\n')}]),angular.module("rtqAgreementText/rtqAgreementText.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("rtqAgreementText/rtqAgreementText.tpl.html",'<div class="svi-directive rtq-agreement-text">\n\t<div data-ng-include="\'rtqAgreementText/nyse.tpl.html\'"></div>\n\t<div data-ng-include="\'rtqAgreementText/opra.tpl.html\'"></div>\n\t<div data-ng-include="\'rtqAgreementText/nasdaq.tpl.html\'"></div>\n</div>\n')}]),angular.module("userAgreement/userAgreement.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("userAgreement/userAgreement.tpl.html",'<div class="svi-directive svi-user-agreement">\n\t<h2 class="title">{{::labels.title}}</h2>\n\n\t<div class="block section-agreement-text">\n\t\t<div class="header">\n\t\t\t{{::labels.instructions}}\n\t\t</div>\n\t\t<div class="body scroll-box user-agreement-text">\n\t\t\t<a class="svi-visually-hidden" data-svi-skip-link=".section-agree">Skip to end of agreement</a>\n\t\t\t<div data-svi-user-agreement-text></div>\n\t\t</div>\n\t</div>\n\n\t<div class="section-agree" data-svi-show-input-errors="userAgreement">\n\t\t<input type="checkbox" name="userAgreement" id="{{::id}}-user-checkbox" data-ng-required="true" data-ng-model="form.userAgreement" />\n\t\t<label class="control-label" for="{{::id}}-user-checkbox">{{::labels.agreeCheckbox}}</label>\n\t\t<div class="on-error help-block" data-on-error="errors.required && errors.errorCount == 1" data-ng-bind="labels.fieldRequired"></div>\n\t</div>\n</div>')}]),angular.module("userAgreementText/content.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("userAgreementText/content.tpl.html",'In consideration of Company d/b/a Company ("Company") and its agents and assigns (collectively "You" and/or "Your") opening one or more accounts (the "Accounts") on My behalf, I represent and agree with respect to all accounts, whether upon margin or cash, as follows:<br />\n<br />\n1. Representation as to Capacity. If an individual, I am of legal age under the laws of the State where I reside and authorized to enter into this agreement and, except as otherwise disclosed to You, I am not an employee of any exchange or the NASD and I am not an employee or associated person of a member firm of any exchange or of a member firm of the NASD. I will promptly notify You if I become so employed or associated. To the extent that I have not already disclosed to You the following, I will notify You in writing if I, My spouse or immediate family member living in My household become a director, 10% beneficial shareholder, or an affiliate of a publicly traded company. If an entity, I am duly formed, validly existing and in good standing in My state of organization, have full power and authority to enter and perform this agreement, and the persons signing the Account application are fully authorized to act on My behalf. No person, except Myself (or any person named in a separate agreement), has any interest in the Account opened pursuant to this Agreement. I acknowledge that unless You receive written objection from Me, under SEC Rule 14b-1(c), You may provide My name, address, and security positions to requesting companies in which I hold securities.<br />\n2. Authorization. I appoint You as My agent for the purpose of carrying out My directions to You in accordance with the terms and conditions of My agreement with You for My Account and risk with respect to the purchase or sale of securities. To carry out Your duties, You are authorized to open or close brokerage accounts, place and withdraw orders and take such other steps as are reasonable to carry out My directions. All transactions will be done only on My order or the order of My authorized delegate except as described in paragraph 9. Company provides Internet trading and brokerage services through Web sites. I agree to receive and transmit financial information through such electronic means. My use or My grant of access to My Account to any third party to access information or place transactions in My Account is at My sole risk. If I authorize or allow third parties to gain access to Your services, including My Accounts, I will cooperate in defending and indemnifying You against any liability, costs or damages arising out of claims or suits by such third parties based upon or relating to such access and use. Company does not warrant against loss of use or any direct, indirect or consequential damages or losses to Me caused by My assent, expressed or implied, to a third party access to My Account or information, including access provided through any other third party systems or sites. I will immediately notify You in writing if I become aware of any loss, theft or unauthorized use of My password and Account number.<br />\n3. Roles and Responsibilities. I understand that You and Your employees 1) provide no investment advice in connection with this Account ; 2) do not give advice or offer any opinion with respect to the suitability of any transaction, security or order; 3) do not solicit orders; 4) do not act as a principal or make a market in any security, equity or mutual fund; 5) do not make discretionary investments on behalf of Your clients; and 6) do not provide internally generated research, and that the availability of research reports through Company\'s websites does not constitute a recommendation to enter in any of the securities transactions or to engage in any of the investment strategies presented in such reports.<br />\nI am solely responsible for any and all orders placed in My Account(s). I am a self-directed investor and all orders entered are unsolicited and based on My own investment decisions or the investment decision of My duly authorized representative. I understand that all investments involve risk, that losses may exceed the principal invested, and that the past performance of a security, industry, sector, market, or financial product does not guarantee future results or returns.<br />\n4. Clearing Status. I understand that You introduce My account and transactions on a fully disclosed basis, and that You have entered into a clearing arrangement with Legent Clearing LLC ("Legent" and/or "the Clearing Agent"), to perform certain services. I understand that Legent carries My Account(s) as clearing broker pursuant to a Brokerage Services Agreement, also referred to as a Clearing Agreement, between Company and Legent, and that Legent will clear all transactions under this Agreement pursuant to that Clearing Agreement. I agree that Legent is only responsible for the execution, clearing and bookkeeping of transactions made and is not otherwise responsible for the conduct of Company.<br />\nUntil receipt from Me of written notice to the contrary, Legent may accept from Company, without inquiry or investigation, i) orders for the purchase or sale of securities and other property on margin, if I have elected to have a margin Account, or otherwise, and (ii) any other instructions concerning said accounts. Legent shall look solely to Company unless otherwise directed by Company, and not to Me with respect to any such orders or instructions; except that I understand that Legent will deliver confirmations, statements, and all written or other notices, including margin maintenance calls if applicable, with respect to My Account directly to Me with copies to Company, and that Legent will look directly to Me or Company for delivery of margin, payment, or securities. I agree to hold Legent harmless from and against any losses, costs or expenses arising in connection with the delivery or receipt of any such communication(s), provided Legent has acted in accordance with the above. The foregoing shall be effective as to My Account until written notice to the contrary is received from Me by Legent or Company.<br />\nI further understand that transactions may be executed by Legent or other broker-dealers.<br />\nYou will respond to inquiries I may make concerning My Account and if any inquiry is in the form of a complaint regarding Company, Legent will be responsible for i) promptly notifying Company about the complaint; ii) providing Me with an acknowledgement that Legent has done this; and iii) providing a copy of My complaint to Company\'s designated examining authority.<br />\nI understand and agree that any rights that either Legent or Company have under this Agreement may be exercised by either Legent or Company or may be assigned to the other, and that Legent and Company may enforce any rights under this Agreement independently or jointly.<br />\n5. Effect of Reports and Statements. I agree that reports of execution of orders and statements of My Account shall be conclusive if not objected to within ten (10) days after transmittal to Me by mail or otherwise. Such objection may be oral or in writing, but any oral objection must be immediately confirmed in writing.<br />\nI will immediately notify You in writing or any failure by Me to receive a message from You.<br />\n6. Important Information About Procedures for Opening a New Account. To help the government fight the funding of terrorism and money laundering activities, Federal law requires all financial institutions to obtain, verify, and record information that identifies each person who opens an Account. What this means for Me: When I open an Account, You will ask for My name, address, date of birth and other information that will allow us to identify Me. You may also ask to see My driver\'s license or other identifying documents and subsequently make copies for the records.<br />\n7. SIPC and Other Insurance Coverage. I understand that You are a member of the Securities Investor Protection Corporation (SIPC), which provides protection for accounts up to $500,000 (including $100,000 for claims of cash) per client as defined by SIPC rules. An explanatory brochure is available upon request or at www.sipc.org or via telephone at (202) 371-8300. I understand that Legent has acquired an additional $24.5 million coverage through a third party insurance company. This brings the total protection to $25 million with a limitation of $1 million on claims for cash balances for each client (as defined by SIPC rules). I understand that such coverage does not include transactions or trading losses or declines in the value of securities.<br />\n8. Telephone Recordings. I understand and agree that any telephone conversation with You will or may be recorded for accuracy and I consent to such recording. Unless otherwise agreed in writing, You do not consent to the recording of telephone conversations by any third party or Me. I acknowledge and understand that not all telephone lines or calls are recorded by You, and You do not guarantee that recordings of any particular telephone calls will be retained or capable of being retrieved.<br />\n9. Oral Authorization. I agree that You shall be entitled to act upon any oral instructions given by Me so long as You reasonably believe such instruction was actually given by Me.<br />\n10. Payment of Indebtedness. In the event I become indebted to You in the course of operation of this Account, I agree that I will repay such indebtedness upon demand. I agree that if after demand I fail to pay the indebtedness, You may close My Account and liquidate any assets in My Account at Your discretion in an amount sufficient to pay My indebtedness. As security for any and all liabilities arising in favor of You, I pledge to You a first priority perfected security interest in all property held by You in any Account maintained by You for Me individually, jointly or in the name of another person or entity. You are hereby authorized to make whatever disposition of pledged property You may deem appropriate to realize the security afforded by this provision, and I will remain liable for any deficiency. I further agree that You shall be entitled to exercise the rights and remedies, with respect to the pledged property, generally afforded a secured party under the Uniform Commercial Code. The reasonable costs of collection of any debit balance and any unpaid deficiency in My accounts, including attorney\'s fees incurred by You, shall be reimbursed by Me to You.<br />\n11. Sell Orders; Deliveries and Settlements. Unless I expressly request and You grant me permission to place the order as a "short" sale, any order directing the sale of Property shall be deemed to be a "long" sale, and in connection with any such order, I represent that I am the owner of the property subject of such order and agree to deliver the property to You in negotiable form on or before the settlement date. In the event that I fail to deliver the property to You by the close of business on the settlement date, You are authorized, in Your discretion and without notice to Me, to i) delay settlement, ii) purchase comparable property to cover My position, or iii) cancel the transaction. You may also charge any loss (including Interest), commission and fees to My Account.<br />\n12. Buy Orders; Settlements. When I have directed that property be purchased, I agree to provide sufficient collected funds to cover such purchase on or before the settlement date. In the event that I fail to provide sufficient funds, You may, at Your option and without notice to Me, i) charge a reasonable rate of interest, ii) liquidate the property subject of the buy order, or iii) sell other property owned by Me and held in any Account. You may also charge any consequential loss to My Account.<br />\n13. Distributions. In the event that I sell a security prior to its ex-dividend/distribution date, and I receive the related cash/stock dividend or distribution in error, I direct You on My behalf to pay such dividend/distribution to the entitled purchaser of the securities I sold, and I guarantee to promptly reimburse You for, or deliver to You, said dividend or distribution.<br />\n14. Market Data; Waiver of Liability; Limitation of Liability. I understand that each participating national securities exchange or association asserts a proprietary interest in all of the market data it furnishes to parties that disseminate said data. I understand that neither Company nor any participating national securities exchange or association nor any supplier of market data guarantees the timeliness, sequence, accuracy, completeness, reliability or content of market information, or messages disseminated to or by any party. I understand that neither Company nor any participating national securities exchange or association nor any supplier of market data warrants that the service will be uninterrupted or error-free. I agree that my use of Company\'s web site or any Company service is at my sole risk. The Company service is provided on an "as is", "as available" basis without warranties of any kind, either express or implied, including, without limitation, those of merchantability and fitness for a particular purpose, other than those warranties which are implied by and incapable of exclusion, restriction or modification under the laws applicable to this agreement. I acknowledge and agree that neither the OPRA Participants ("Participants" and/or "Exchanges") nor the processor under the OPRA Plan (the "Disseminating Parties" and/or "Company") guarantee the timeliness, sequence, accuracy or completeness of Market Data or of other market information or messages disseminated by any Disseminating Party. I understand and acknowledge that each national securities exchange that is a participant in the OPRA Plan ("OPRA Participant") has a proprietary interest in the Market Data that originates on derives from it or its markets. For the purposes of this Section 14 only, "Market Data" means (a) options last sale reports, (b) options quotation information, (c) such index and other market information as the OPRA participants may from time to time make available, and (d) all information that derives from any such information. Neither I nor any other person shall hold any Disseminating Party liable in any way for (a) any inaccuracy , error or delay in, or omission from, i) any such data, information or message or ii) the transmission or deliver of any such data, information or message, or (b) any loss or damage arising from or occasioned by i) any such inaccuracy, error, delay or omission, ii) non-performance or iii) interruption in any such data, information or message, whether due to any negligent act or omission by any Disseminating Party, or to any "force majeure" (e.g., flood, extraordinary weather conditions, earthquake or other act of God, fire, war, insurrection, riot, labor dispute, accident, action of government, communications or power failure, equipment or software malfunction) or other cause beyond the reasonable control of any Disseminating Party. Neither You nor any disseminating party shall be liable, and I agree to indemnify and hold harmless Company and such Disseminating Party, for any inaccuracy, error or delay in, or omission of, (1) any such data, information or message, or (2) the transmission or delivery of any such data, information or message; or any loss or damage arising from or occasioned by i) any such inaccuracy, error, delay or omission, ii) non-performance, or iii) interruption in any such data, information or message, due either to any act or omission by Company or any Disseminating Party or to any "force majeure" (as defined above) or any other cause beyond the reasonable control of Company or any Disseminating Party.<br />\n15. Restrictions on Trading. I understand that You may, in Your discretion, prohibit or restrict the trading of securities, or the substitution of securities, in any of My accounts. I understand that You may execute all orders by Me on any exchange or market, unless I specifically instruct You to the contrary. In the event of a breach or default by Me under this Agreement, You shall have all rights and remedies available to a secured creditor under all applicable laws and in addition to the rights and remedies provided herein. I understand that You may at any time, at Your sole discretion and without prior notice to Me: prohibit or restrict My access to the use of the web site or related services and My ability to trade, You may refuse to accept any of My transactions, You may refuse to execute any of My transactions, and/or You may terminate My Account. The closing of an Account will not affect the rights and/or obligations of either party incurred prior to the date the Account is closed.<br />\n16. Governing and Applicable Law. This Agreement and all transactions made in My Account shall be governed by the laws of the State of New York, (regardless of the choice of law rules thereof) except to the extent governed by federal securities law, the Federal Arbitration Act, and to the constitution, rules, regulations, customs and usage of the exchanges or market (and its clearing house) where executed.<br />\n17. Ratification; Sub-Brokers and Agents; Extraordinary Events; Indemnification. You may employ sub-brokers or other agents in connection with the execution of any order or the consummation of any other transaction hereunder, and You shall be responsible only for reasonable care in their selection. I understand that You shall not be liable for loss caused directly or indirectly by government restrictions, exchange or market rulings, suspension of trading, war, strikes, natural disasters or any other conditions or causes beyond Your control or anticipation, including, but not limited to, delays in the transmission of orders due to breakdown or failure of transmission or communication facilities. I agree to indemnify and hold You harmless from any loss, damage or liability arising out of any transaction in which You act, directly or indirectly, as My agent, absent any willful or grossly negligent conduct by You.<br />\n18. Mutual Fund Transactions. In the event that I purchase or hold a mutual fund, I agree to read and understand the terms of its prospectus. I understand that certain mutual funds reserve the right to change their purchasing, switching or redemption procedures and/or suspend or postpone redemptions under certain market conditions. I further understand that any mutual fund order entered with You is placed by You on a best efforts basis as prescribed and recognized by the individual fund, and that You are not responsible for unexecuted orders due to the failure of any communication system. I agree to be fully responsible for the information contained within the mutual fund prospectus and to hold You harmless for any deficiencies contained therein. I authorize You to act as My agent in the purchase and redemption of fund shares.<br />\n19. Joint Account Authorization. My Account shall be held by you in joint tenancy with rights of survivorship, unless I notify You and provide the required documentation. If the Account is a joint Account, then in consideration of Your carrying a joint Account for the undersigned persons, we jointly and severally agree to be fully and completely responsible and liable for this Account and to pay on demand any balance due. Each of us, or any person authorized to act on behalf of the Account under a separate agreement, has full power and authority to make purchases and sales, withdraw funds and securities from, or to do anything else with reference to the Account. You are authorized and directed to act upon instructions received from any of us. We understand that tax reporting information is processed using the social security number of the person first named in the registration. Each of us agrees to hold Legent and its employees and agents harmless from and indemnify them against any losses, causes of action, damages and expenses (including attorney\'s fees) arising from or as the result of You, Your employees or agents following the instructions of any of us. You in Your sole discretion may at any time suspend all activity in the joint Account pending instructions from a court of competent jurisdiction or require that instructions pertaining to the joint Account or the property therein be in writing, signed by all of us. You may recover from the Account or from any of us such costs as You may incur, including reasonable attorney\'s fees, as the result of any dispute among us relating to or arising from the Account. Upon any event that causes a change in the ownership of the joint Account (divorce, death, assignment, etc.), all remaining accountholders or survivors shall immediately notify You in writing. You may take such actions in the Account as You deem advisable to protect against any tax, liability, penalty or loss under any present or future laws or otherwise. The estate of the decedent or departing accountholder shall be liable together with each of the remaining or surviving accountholders, jointly and severally, to You for any net debit balance or loss in the Account in any way resulting from any transactions initiated prior to notification to You or incurred in the liquidation of the Account or the adjustment of the interests of the respective parties. Notwithstanding the governing law provisions of Section 16 of this Agreement, the legal ownership of our accounts shall be governed by the internal laws of the state of residence. If the individuals who sign this Agreement are husband and wife and legal residents of a community or marital property state, any securities purchased through You will be registered in our respective names, as shown on the Account, followed by the words "husband and wife as community property" or "community property."<br />\n20. Definitions of the Word "Property". For all purposes of this agreement, the word "Property" means of all kinds, monies and all contracts, investments and options relating thereto, whether for present or future delivery, and all distributions, proceeds, products and accessions of all such property. This includes all such property held, maintained or carried by Legent in any manner for Me.<br />\n21. Effect of Attachment or Sequestration of Accounts. You shall not be liable for refusing to obey any orders given by or for Me with respect to any Account(s) that has or have been subject to an attachment or sequestration in any legal proceeding against Me, and You shall be under no obligation to contest the validity of any such attachment or sequestration.<br />\n22. Event of Death. It is further agreed that in the event of My death or the death of one of the joint Account holders, the representative of My estate or the survivor or survivors shall immediately give You written notice thereof, and You may, before or after receiving such notice, take such proceedings, require such papers and inheritance or estate tax waivers, retain such portion of and/or restrict transactions in the Account as You may deem advisable to protect You against any tax, liability, penalty or loss under any present or future laws or otherwise. Notwithstanding the above, in the event of My death or the death of one of the joint Account Holders, all open orders shall be canceled, but You shall not be responsible for any action taken on such orders prior to the actual receipt of notice of death. Further, You may in Your discretion close out any or all of My accounts without awaiting the appointment of a personal representative for My estate and without demand upon or notice to any such personal representative. The estate of any of the Account holders who shall have died shall be liable and each survivor shall continue to be liable, jointly and severally, to You for any net debit balance or loss in said Account in any way resulting from the completion of transactions initiated prior to the receipt by You of the written notice of the death of the decedent or incurred in the liquidation of the Account or the adjustment of the interests of the respective parties. Such notice shall not affect Your rights under this agreement to take any action that You could have taken if I had not died.<br />\n23. Tax Reporting. The proceeds of sales transactions and dividends paid will be reported to the Internal Revenue Service in accordance with applicable law.<br />\n24. Information Accuracy. I (a) certify that the information contained in this agreement, the Account application, and any other document that I furnish to You in connection with My Account(s) is complete, true and correct, and acknowledge that knowingly giving false information for the purpose of inducing You to extend credit is a federal crime, (b) authorize You to contact any individual or firm noted herein or on the documents referred to in subsection (a) of this Section and any other normal sources of debit or credit information, (c) authorize anyone so contacted to furnish such information to You as You may request, and (d) agree that this agreement, the Account application and any other document I furnish in connection with My Account is Your property, as the case may be. I shall promptly advise You of any changes to the information in such agreements and documents. You may retain this agreement, the Account application, and all other such documents and their respective records at Your sole discretion, whether or not credit is extended.<br />\n25. W-9 Certification. Under penalties of perjury. I certify that the taxpayer identification number shown above on this form is my correct taxpayer identification number. Unless, otherwise indicated, I certify that I am not subject to backup withholding and I am an U.S. Person (including an U.S. resident alien).<br />\n26. Credit information and investigation. I authorize You to obtain reports and provide information to others concerning My creditworthiness and business conduct. Upon My request, You agree to provide Me a copy of any report so obtained.<br />\n27. Equity Orders and Payment For Order Flow. Securities and Exchange Commission rules require all registered broker-dealers to disclose their policies regarding any "payment for order flow" arrangement in connection with the routing of customer orders. "Payment for order flow" includes, among other things, any monetary payment, service, property, or other benefit that results in remuneration, compensation, or consideration to a broker or dealer from any broker or dealer in return for directing orders. You transmit customer orders for execution to various exchanges or market centers based on a number of factors. These include: size of order, trading characteristics of the security, favorable execution prices (including the opportunity for price improvement) access to reliable market data, availability of efficient automated transaction processing and reduced execution costs through price concessions from the market centers. Certain of the market centers may execute orders at prices superior to the publicly quoted market in accordance with their rules or practices. While a customer may specify that an order be directed to a particular market center for execution, the order-routing policies, taking into consideration all of the factors listed above, are designed to result in favorable transaction processing for customers. The nature and source of any payments and /or credits received by You in connection with any specific transactions will be furnished upon written request.<br />\n28. Free Credit Balances. I authorize You and Legent to invest the free credit balances in My securities Account in money market funds as specified on My Account application and, without notice, to redeem My money market fund shares to the extent necessary to satisfy any debits arising in any of My securities accounts. Amounts not invested shall accrue and will be paid interest on the free credit balances. The interest paid will be calculated on a 365-day year and actual days elapsed. The interest rate will vary from time to time without prior notice, in accordance with changes in the "fed funds" rate.<br />\n29. Fees and Charges. I understand that there are charges for commissions and fees for executing buy and sell orders and for other services provided under this agreement. I agree to pay such commissions and fees at the then prevailing rate. I acknowledge that the prevailing rate of commissions and fees may change and that change may occur without notice. I agree to be bound by such changes. I specifically agree to pay a reasonable rate of interest on the principal amount of any debit balance carried with respect to the Account. Interest may be charged against My Account in connection with cash withdrawals, if the proceeds from a security sale are disbursed before the regular settlement date of the sale transaction; and late payments. If Company receives my payment for securities purchases in a cash account after settlement date, I shall be charged a late payment fee of $25 plus a daily interest charge on the debit balance until Company is fully paid. Charges will be calculated using a prevailing interest rate, currently set to "Broker\'s Call" + 1%. The charges shall accrue until paid and posted to My Account on the day following payment of the debit balance. Interest due on the Account is payable on demand. I also agree to pay such expenses incurred by You in connection with collection of any unpaid balance due on My accounts, including, but not limited to, attorney\'s fees allowed by law.<br />\nI authorize Company, at its discretion and without further prior notice, to utilize an electronic check process or Automated Clearing House (ACH) facility to draft funds in the amount of any of My checks payable to Company, its agents or assigns.<br />\n30. Arbitration.<br />\nA. The following general provisions apply to all arbitrations pursuant to this section:<br />\ni. Arbitration is final and binding on the parties. All parties to this agreement are waiving the right to sue each other in court, including the right to a trial by jury, except as provided by the rules of the arbitration forum in which a claim is filed.<br />\nii. Arbitration awards are generally final and binding; a party\'s ability to have a court reverse or modify an arbitration award is very limited.<br />\niii. Pre-arbitration discovery is generally more limited than and different from court proceedings. The ability of the parties to obtain documents, witness statements and other discovery is generally more limited in arbitration than in court proceedings.<br />\niv. The arbitrator\' award is not required to include factual findings or legal reasoning and any party\'s right to appeal or seek modification of rulings of the arbitrators is strictly limited. The arbitrators do not have to explain the reason(s) for their award.<br />\nv. The panel of arbitrators will typically include a minority of arbitrators who were or are affiliated with the securities industry.<br />\nvi. The rules of some arbitration forums may impose time limits for bringing a claim in arbitration. In some cases, a claim that is ineligible for arbitration may be brought to court.<br />\nvii. The rules of the arbitration forum in which the claim is filed, and any amendments thereto, shall be incorporated into this agreement.<br />\nB. Any controversy or claim arising out of or relating to this agreement shall be settled by arbitration in accordance with the rules then in effect by one of the following arbitration tribunals: i) the NASD, ii) the American Arbitration Association, as I may select. I understand that upon Your demand, I must select the arbitration tribunal within ten (10) calendar days after demand is made. I agree to provide written evidence (via certified mail) of that selection. In the event that I fail to make such selection; You shall be entitled to make the decision. You shall provide written evidence (via certified mail) of such selection to Me. I agree that any judgment upon an award rendered by arbitration may be entered in any court having proper jurisdiction.<br />\nC. This agreement to arbitrate constitutes a waiver of the right to seek a judicial forum unless such a waiver would be void under the federal securities laws. If I am a foreign national, non-resident alien, or if I do not reside in the United States, I agree to waive My right to file an action against You in any foreign venue.<br />\nD. No person shall bring a putative or certified class action to arbitration, nor seek to enforce any pre-dispute arbitration agreement against any person who has initiated in court a putative class action; or who is a member of a putative class who has not opted out of the class with respect to any claims encompassed by the putative class action until:<br />\nthe class certification is denied;<br />\nthe class is decertified; or<br />\nthe customer is excluded from the class by the court.<br />\nSuch forbearance to enforce an agreement to arbitrate shall not constitute a waiver of any rights under this agreement except to the extent stated herein.<br />\n<br />\n31. Electronic Delivery of Trade and Account Information; Notice.<br />\nAll communications, including Account statements, trade confirmations, margin calls, notices, disclosures, regulatory communications and other information, documents, data and records regarding My Account, or an alert that such communication has been posted to the secure section of Your website, and is available for viewing, may be sent to Me at the mailing address for the Account or E-mail address that I have given to You in My Account application (to either E-mail address in the case of joint accounts where each Account holder has given an E-mail address; notice to both E-mail addresses is not required) or at such other address as I may hereafter give You in writing or by E-mail at least ten (10) days prior to delivery, and all communications so sent, whether in writing or otherwise, shall be deemed given to Me personally, whether actually received or not.<br />\n32. Headings. The heading of each provision hereof is for descriptive purposes only and shall not be i) deemed to modify or qualify any of the rights or obligations set forth herein or ii) used to construe or interpret any of the provisions hereunder.<br />\n33. No Waiver; Cumulative Nature of Rights and Remedies. Your failure to insist at any time upon strict compliance with any term contained in this agreement, or any delay or failure on Your part to exercise any power or right given to You in this agreement, or a continued course of such conduct on Your part, shall at no time operate as a waiver of such power or right, nor shall any single or partial exercise preclude any other further exercise. All rights and remedies given to You in this agreement are cumulative and not exclusive of any other rights or remedies to which You are entitled.<br />\n34. Miscellaneous Provisions. The following provisions shall also govern this agreement:<br />\na. I hereby ratify and confirm all transactions heretofore made and entered into with Legent.<br />\nb. This agreement shall bind My heirs, assigns, executors, successors, conservators and administrators.<br />\nc. If any provision of this agreement shall be determined to be invalid, the remainder hereof shall remain in full force and effect.<br />\nd. This agreement may be terminated by either Myself, Company or Legent immediately upon verbal or written notice. I will remain liable to You for any charges due, whether arising before or after termination.<br />\ne. You may at any time amend this Agreement, by modifying or rescinding any existing provisions or conditions or by adding any new provision or condition, by clearly posting notice of such amendment on Company\'s web site or by providing written notice to Me. Continued use of Your services after such notice will constitute acknowledgment and acceptance of such amendment. f. I will notify You if any representation herein is or becomes materially inaccurate.<br />\ng. This Agreement represents the entire agreement between Me and You concerning the subject matter herein. Certain policies and/or procedures may be further outlined on the Company website, I agree to be bound by any and all such postings. I may not assign any right or obligations hereunder without first obtaining the prior written consent of an authorized officer of Company. h. Other Agreements<br />\nI agree and understand that other specific agreements, disclosures, terms and conditions apply to My use of the Company web site and My Account. It is My continuing obligation to understand such terms, and I agree to be bound by such terms as are in effect at the time of My use. Such agreements, disclosures, terms and conditions include, but are not limited to:<br />\n<br />\nMargin Agreement<br />\nMargin Disclosure Statement<br />\nOption Agreement<br />\nPrivacy Statement<br />\nReal Time Quotes<br />\nPayment for Order Flow<br />\nBusiness Continuity Plan Summary<br />\nOrder Routing<br />\nElectronic Trading System<br />\nDay Trading<br />\nExtended Hours Trading<br />\n<br />\n35. Severability. If any provisions or conditions of this agreement become inconsistent with any present or future law, rule or regulation of any applicable government, regulatory or self regulatory agency or body, or are deemed invalid or unenforceable by any court of competent jurisdiction, such provisions shall be deemed rescinded or modified, to the extent permitted by applicable law, to make this agreement in compliance with such law, rule or regulation, or to be valid and enforceable, but in all other respects, this agreement shall continue in full force or affect.<br />\n36. Electronic Signatures Disclosure. My intentional action in electronically signing this Customer Agreement or other documents governing My relationship with Company is valid evidence of My consent to be legally bound by these documents. The use of an electronic version of these documents fully satisfies any requirement that they be provided to me in writing. The electronic stored copy of the Account Application or other documents is considered to be the valid and enforceable record of the applicable document, admissible in judicial or administrative proceedings to the same extent as if the documents and records were originally generated and maintained in printed form.<br />\n37. International Customers. The products and services described in pages of this web site are only offered in jurisdictions where they may be legally offered. Not all securities, products, or services are available in all countries, and nothing on this site constitutes an offer or solicitation of these securities, products, or services in any jurisdiction where their offer or sale is not qualified or exempt from registration. I understand that Your products and services are intended for U.S. customers and may not be offered or available in other countries, including the Australia, Austria, Canada, France, Germany, Hong Kong, Italy, Japan, Malaysia, the Netherlands, Saudi Arabia, Singapore, Taiwan and the United Kingdom, among other jurisdictions. I understand that You, at Your sole discretion might accept unsolicited accounts from non-U.S. resident, depending on the country of residence and other factors. I understand that You are based in the United States, that You accept only U.S. currency in Your customer accounts.<br />\n<br />\nBY MY SIGNATURE ON THE ACCOUNT APPLICATION, I ACKNOWLEDGE THAT I HAVE RECEIVED, READ, UNDERSTAND AND AGREE TO THE TERMS SET FORTH IN THE FOREGOING AGREEMENT, AND THAT THIS AGREEMENT CONTAINS A PREDISPUTE ARBITRATION CLAUSE AT SECTION 30.<br />\n<br />\n&copy;Company dba Company\n')}]),angular.module("userAgreementText/userAgreementText.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("userAgreementText/userAgreementText.tpl.html",'<div class="svi-directive user-agreement-text">\n\t<div data-ng-include="\'userAgreementText/content.tpl.html\'"></div>\n</div>\n')}]),angular.module("templates-clientDirectives",["BOW/userAgreementText/content.tpl.html","DEM/userAgreementText/content.tpl.html","DAV/userAgreementText/content.tpl.html","FDB/userAgreementText/content.tpl.html","LPL/userAgreementText/content.tpl.html","RWB/balanceListGrid/balanceListGrid.tpl.html","RWB/holdingsContainer/holdingsContainer.tpl.html","RWB/marketIndicesChart/marketIndicesChart.tpl.html","RWB/portfolioSummary/portfolioSummary.tpl.html","STF/userAgreementText/content.tpl.html"]),angular.module("BOW/userAgreementText/content.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("BOW/userAgreementText/content.tpl.html",'<style>\n.title {\n\ttext-align: center;\n\tfont-weight: bold;\n\tbackground-color: #ccc;\n\tpadding: 4px 8px;\n\t}\nul{\n\tlist-style: disc;\n\tcolor: #000;\n}\nol {\n\tlist-style: decimal;\n\tcolor: #000;\n}\nli {\n\tmargin: 0 0 0 32px;\n}\nol.typeA { list-style: upper-alpha !important; }\nol.typei { list-style: lower-roman !important; }\nol.typeNone { list-style: none !important; }\nol.roman { list-style: lower-roman; }\n.roman li { font-weight: bold }\nol > li {\n\tmargin-bottom: 8px;\n}\nol > li > p {\n\tdisplay: inline-block;\n\tmargin: 0 0 0 16px;\n}\n.equal-width {\n\tcolor: #000;\n\tborder:solid 1px #666;\n\twidth: 600px;\n}\n.equal-width td {\n\t\twidth:25%;\n\t\tpadding:4px;\n\t\tvertical-align: top;\n\t\tborder-right: solid 1px #666;\n\t\tborder-bottom:solid 1px #666;\n}\n\n</style>\n\n<div class="userAgreementFormat">\n\t<p class="title">CLIENT AGREEMENT</p>\n\n\t<p>BancWest Investment Services (“BWIS”), is a securities broker-dealer and Investment Adviser, registered with the Securities and Exchange Commission ("SEC").  BWIS is also a member of the Financial Industry Regulatory Authority, Inc. (“FINRA”) and the Securities Investor Protection Corporation (“SIPC”). BWIS is a wholly-owned subsidiary of Bank of the West (“Bank”) which is a subsidiary of BNP Paribas (“BNP”).     BWIS utilizes a clearing broker and custodian, currently Pershing LLC, (“Clearing Broker”) to service your account. “BWIS” as used in this Agreement refers to both BWIS and its clearing broker, where applicable. “You,” “your,” or “yours” refers to the individual or entity that is the holder of a BWIS account.  This Agreement between you and BWIS (“the Agreement”) contains important terms and conditions that apply to your BWIS account and to the services BWIS provides.  Please read this Agreement carefully and retain it for future reference.</p>\n\n\t<p class="title"><b>GENERAL PROVISIONS, FEES & CHARGES</b></p>\n\n\t<p><b>ACCOUNT OPENING</b><br />\n\tYou represent that you are of the age of majority and have the legal right to enter into this Account Agreement.  You certify that no one except yourself has an interest in this or any of your BWIS accounts unless such interest is expressly referenced in the account’s title.</p>\n\n\t<p><b>ACCOUNT MINIMUMS</b><br />\n\tYou agree to maintain a minimum balance of $100 in your account.  If your account falls below that minimum balance, BWIS reserves the right to liquidate any positions, close the account and send you any proceeds remaining after fees are deducted.  A termination fee may be applicable.</p>\n\n\t<p><b>IDENTIFICATION INFORMATION AND CREDIT CHECKS</b><br />\n\tTo help the government fight terrorism and money laundering, federal law requires all financial organizations to obtain, verify, and record information that identifies each person who opens or has an ownership interest in an account.  When you open an account, BWIS will ask for your name, address, date of birth, and other information that will identify you.   BWIS may also ask you to provide a copy of your driver’s license or other identifying documents. You agree that the information you provide to BWIS on your account application or otherwise may be used to verify your identity and to perform credit checks or public records searches using internal sources and/or third-party vendors.</p>\n\n\t<p><b>CHECK DEPOSITS</b><br />\n\tIf you mail a check to BWIS’ home office at 13220 California Street, Suite 200, Omaha, NE 68154, your check will be processed or, if rejected, returned by mail by noon the next business day after BWIS receives the check. If information needed to complete the deposit is missing, BWIS may hold the check for up to five business days, during which time BWIS will reach out to you to obtain any additional documentation needed before the deposit can be accepted and credited to your account.</p>\n\n\t<p><b>ACCOUNTS WITH MULTIPLE OWNERS</b><br />\n\tIf this is a joint account or tenant in common account, the account(s) shall be held jointly with rights of survivorship (payable in full to the survivor) unless you notify BWIS otherwise and provide the documentation BWIS requires. Each joint tenant irrevocably appoints the other as attorney-in-fact to take all action on his or her behalf and to represent him or her in all respects in connection with this Agreement.  BWIS shall be fully protected in acting, but shall not be required to act, upon the instructions of either client.  Each client shall be liable, jointly and individually, for any amounts due to BWIS pursuant to this Agreement, whether incurred by either or both of you. We reserve the right to require a confirming instruction from the other account holder.</p>\n\n\t<p><b>ADDRESS</b><br />\n\tBWIS may send communications to you at the current address we have on file for you or by email if you have signed up for e-delivery of communications or request to communicate by email, unless you change that address by providing notice to BWIS in a manner satisfactory to BWIS. You agree to notify BWIS of any changes to your physical, mailing or email address in a timely fashion. All communications sent to your address or email on file, whether by mail, electronically, by facsimile or otherwise, shall be deemed given to you, whether actually received or not.</p>\n\n\t<p><b>FEES AND CHARGES</b><br />\n\tIn the normal course of business, there are commissions, fees and other charges that you are obligated to pay in connection with transactions, services or activity in your accounts. You agree to pay the charges set forth in BWIS’ fee schedules as amended from time to time.  You agree that BWIS can modify the fee schedules without prior notice.  You will receive a copy of the Fee Schedule at account opening. Fee schedules for all account types, including online accounts, are posted on the BWIS website. You may also request a copy of the Fee Schedule by contacting your BWIS representative or by writing to BWIS, Attn: Operations, 13220 California Street, Suite 200, Omaha, NE 68154 or call 1-800-338-3919.  BWIS reserves the right to mark-up certain fees charged by Pershing to compensate for internal costs.</p>\n\n\t<p><b>INFORMATION SHARING FOR PREFERRED PRICING </b><br />\n\tAt Bank of the West, we are committed to providing exceptional service to our most valued customers.  In order for us to determine your initial eligibility for various pricing schedules that may apply to your account(s) held at BWIS or affiliates, and to monitor your continued eligibility for these pricing schedules, we ask that you consent to the sharing of information related to your accounts at our affiliates, including but not limited to BWIS, Bank of the West, Bank of the West Trust Services, and BNP Paribas including your public and non-public personal information and financial information, such as information related to your personal assets, trust assets, investments, liabilities, and balances maintained at the bank, among BWIS, Bank of the West, Bank of the West Trust services, and any of our affiliates.  You may withdraw this consent at any time by informing your advisor, going to a local branch, or by calling BWIS at 1-800-338-3919, but the lack of information sharing may affect your eligibility for certain preferred pricing options.</p>\n\n\t<p><b>INDEBTEDNESS AND LIQUIDATION</b><br />\n\tYou agree to pay any fees or charges that apply to your account in a timely manner. You agree that any such fees may be deducted from the available funds in your account and if no funds are available, BWIS may, without prior notice, liquidate investments within your account to make funds available to pay any outstanding amounts owed.  In addition, you agree to grant BWIS a security interest in, lien on, and right of set-off against all property, including any funds and securities in any BWIS account you maintain or have an interest in, whether individually or jointly, to satisfy any debit or pay any fee or charge. If BWIS has to bring any legal action to recover a debt from you, BWIS is entitled to recover interest at the contractual interest rate, if applicable, or statutory interest rate, whichever is higher, as well as all costs of collection and reasonable attorneys’ fees.</p>\n\n\t<p><b>FAILURE TO PAY OR DELIVER</b><br />\n\tYou agree to pay for all trade orders you place on or before settlement date whether or not funds are available in your account.  You agree that before you sell securities long, you must actually own them and hold them in a BWIS account.  Whenever you do not pay in full for any security you purchased in your account, or deliver any security you sold in your account, on or before settlement date, BWIS is authorized to liquidate, sell, buy-in, pledge, hypothecate, re-pledge or re-hypothecate, any or all securities which BWIS or Pershing may hold for you (either individually or jointly with others) in the account in which the order was placed or in any other BWIS accounts in which you have an interest, jointly or individually, or to cancel any or all outstanding orders or commitments in these account(s). You agree that BWIS has the right to liquidate securities in your account or any other BWIS accounts in which you have an interest to satisfy any debit balance or pay uncollected fees you owe BWIS.</p>\n\n\t<p><b>ORDERS, TRADING, AND INVESTMENTS</b></p>\n\n\t<p><b>INVESTMENT RISKS; LOSS OF PRINCIPAL</b><br />\n\tSecurities, insurance products, and annuities are not deposits with or obligations of, and are not guaranteed by, Bank of the West or any of its subsidiaries.  Securities, insurance products and annuities are not insured by the Federal Deposit Insurance Corporation (“FDIC”), the Federal Reserve Board, or any other federal or state government agency.  Securities are subject to investment risk, including possible loss of the entire principal amount invested.</p>\n\n\t<p><b>UNSOLICITED TRANSACTIONS</b><br />\n\tYou are responsible for determining the suitability of any unsolicited security, transaction, or investment strategy. An unsolicited trade is one that is not recommended by BWIS.  BWIS has no responsibility for determining the suitability of self-directed trades or for self-directed trading losses.</p>\n\n\t<p><b>MARKET HOURS</b><br />\n\tBWIS does not participate in pre-market or after-market trading.  Orders placed outside of regular U.S. market hours will be held and entered during market hours on the next day the market is open.\n\t</p>\n\n\t<p><b>TRANSMITTING ORDERS/INSTRUCTIONS</b><br />\n\tOrders, funds transfers and other financial transactions will only be effected by BWIS if you place them through the appropriate channel.  You agree that you will not use email, voicemail, facsimile, or secure messaging to attempt to effect the purchase or sale of securities or other investments, to send funds transfer instructions or for any other financial transactions. Any requests, orders, or instructions that are sent in contravention of the preceding sentence will not be accepted or processed by BWIS. BWIS will not be responsible for any loss or damages resulting from a failure to process requests, orders, or instructions that are not entered through the appropriate channel.\n\t</p>\n\n\t<p><b>GOOD-TILL-CANCELED ORDERS</b><br />\n\tGood-till-Canceled ("GTC") orders will be automatically canceled only at the close of business on the 60th calendar day after the date the order was entered or on the following Business Day if the 60th day falls on a weekend or holiday. If you do not cancel an open GTC order, the transaction may be completed based on your original instructions anytime until the close of business on the 60th calendar day or the next Business Day if applicable. For securities that pay cash dividends or that have splits, open GTC orders will be adjusted in accordance with stock exchange regulations.\n\t</p>\n\n\t<p><b>ORDER REVIEW</b><br />\n\tCertain orders may be blocked or subject to pre-review by BWIS or Pershing, which may take up to several minutes to process.  You agree that during the time of this review, there may be market movements and that BWIS is not liable for loss or damages related to price movements while an order is reviewed.  Additionally, you understand that certain orders may be sent to exchanges and market centers without being reviewed in advance by BWIS. When you place an order online, you voluntarily agree to assume any added risk that may result from the lack of human review of your order by BWIS in exchange for the reduced commissions and potentially greater convenience of electronic trading.\n\t</p>\n\n\t<p><b>CANCELLATION OF ORDERS</b><br />\n\tBWIS is authorized, in its discretion, for any reason whatsoever that it deems necessary, to cancel any outstanding orders and/or to close out your account, in whole or in part, without prior notice.  All orders are subject to the applicable rules, customs and usages of the exchange or market, and its clearinghouse, on which BWIS or its affiliates transact orders. BWIS has no obligation to honor, and may cancel, in whole or in part, any order or transaction including but not limited to those that (a) exceed the funds available in your account; (b) involve funds subject to a hold, levy, garnishment,  court order, dispute or other legal process; (c) would (or BWIS reasonably believes would)  violate any law, rule or regulation including but not limited to sanctions laws;  or is being used, to facilitate any illegal or improper purpose or activity; (d) is not (or BWIS reasonably believes is not) authorized by the proper party; (e) is not in accordance with any other requirement in this Agreement or any other applicable agreement between you and BWIS; (f) violates the policies, procedures or practices of BWIS or its corporate parents or affiliates, including the purchase or sale of securities on a restricted list; (g) if BWIS has reason to believe that your account has been compromised or mismanaged in any way, such as by unauthorized use of your password or other security features; or (h) for BWIS’ or your own protection; (i) or for any other reason.\n\t</p>\n\n\t<p><b>FRAUD AND UNAUTHORIZED ACTIVITY</b><br />\n\tYou are required to call us immediately to notify us if you believe there has been any unauthorized activity in your accounts or if you suspect that any of your BWIS accounts, your passwords or security features, your personal identifying information or your accounts at other financial institutions have been subject to fraud, attempted fraud, or compromised in any way.  If you fail to promptly notify of us of such instances, we will not be liable for any associated losses.\n\t</p>\n\n\t<p><b>CONFIRMATIONS AND STATEMENTS</b><br />\n\tYou agree to review trade confirmations, account statements, and other documents relating to your account in a timely manner and to immediately identify and report discrepancies to BWIS.  You understand and agree that losses could be exacerbated by any delay in notifying BWIS of any errors, omissions or unauthorized transactions in confirmations, in reports or statements, and you agree you will be responsible for any losses resulting from your failure to immediately notify BWIS of any error.\n\t</p>\n\n\t<p><b>EXTRAORDINARY EVENTS</b><br />\n\tBWIS shall not be responsible for and you agree not to hold us liable for losses or delays caused directly or indirectly by conditions beyond our control, including but not limited to wars or civil disturbances, natural disasters, weather conditions, terrorism, denial of service attacks, government restrictions, exchange or market rulings, trading suspensions, computer or, internet failures, labor disputes, news or analysts’ reports, or disruptions in orderly trading on any exchange or market. Computer and communications failures include, but are not limited to: (a) the failure of electronic or mechanical equipment or telephone, cable, modem or other communication lines; (b) bugs, errors, configuration problems or the incompatibility of computer hardware or software; (c) the failure or unavailability of internet access; or (d) problems with data transmission facilities or your telephone, cable or wireless service.  BWIS is not responsible for any damage to your computer, software, modem, telephone, wireless device or other property resulting in any way from your use of BWIS’ online services.\n\t</p>\n\n\t<p><b>MARGIN TRADING </b><br />\n\tIf you use or trade on margin, you agree to be bound by the terms of BWIS’ Margin Disclosure document, which is provided to you when you sign up for margin.  Securities purchased on margin are the firm’s collateral for the margin loan to you. If the securities in your account decline in value, so does the value of the collateral supporting your loan, and, as a result BWIS or its clearing broker Pershing can take action, including issuing a margin call and/or selling securities or other assets in your account or any other accounts you hold with BWIS, whether individually or jointly, in order to maintain the equity BWIS requires in the account, in its sole discretion.<br /><br />\n\tBefore deciding to trade on margin, it is important that you fully understand the risks of trading on margin, which include the following:<br /></p>\n\t<ul>\n\t<li>You may lose more funds or securities than you deposited in your margin account.</li>\n\t<li>BWIS or Pershing may force the sale of securities or other assets in your account (s).</li>\n\t<li>BWIS or Pershing may sell the securities or assets in your account without prior notice and without contacting, or trying to contact, you.</li>\n\t<li>BWIS or Pershing has complete discretion to decide which securities or other assets in your account are to be liquidated or sold to meet a margin call.</li>\n\t<li>BWIS or Pershing can set its house margin maintenance requirements in their sole discretion and can increase those maintenance requirements at any time without prior notice to you.</li>\n\t<li>You are not entitled to an extension of time to meet a margin call and may not rely on one if granted.</li>\n\t<li>You may end up owing BWIS additional monies after your account is liquidated.</li>\n\t</ul>\n\n\t<p><b>OPTIONS TRADING</b><br />\n\tIf you trade options, you agree to be bound by the terms of BWIS’ Options Trading Disclosure document, which is provided to you along with this Agreement.  The full terms of the Option Trading Disclosure document are incorporated by reference into this Agreement.\n\t</p>\n\n\t<p><b>ORDER EXECUTION </b><br />\n\tMarket orders are subject to execution at the prevailing market price at time of execution with no guarantee such orders will be executed at the price quoted at the time of order entry. Prices can change quickly, especially in volatile market conditions, which may result in an execution price different from the quote you received at order entry. Telecommunication and technology limitations may result in delays in placing orders, getting quotes, or other information.  Even in the best of market conditions, there is no assurance that you will get the quoted price and agree not to hold BWIS liable for such fluctuations.  The price quotes you receive when placing an order apply only to orders for a small number of shares.  You acknowledge that the price you will pay or receive may vary substantially if your order is larger than the number of shares to which a price quote applies. Large market orders may be executed in multiple lots at different prices. If you enter a large marketable order at or near the market close or at or near a trading halt, you acknowledge that BWIS may not be able to fill all or part of that order prior to the market close and you agree that BWIS is not responsible for any alleged market losses associated with that order. You may limit the risk of price fluctuations by placing a limit order. However, if you place a limit order, you are less likely to get an execution. BWIS can provide no assurance that your limit order will be executed at any particular time, or at all. If you do not understand the purpose or effect of either market or limit orders, you agree to contact your advisor or the BWIS Service Center at 1-800-338-3919 for more information.\n\t</p>\n\t<p><b>DAY TRADING</b><br />\n\tBWIS does not promote directly or indirectly what is commonly referred to as Day-Trading.  BWIS’ services that provide the means to place trades electronically should not be construed as an endorsement or promotion of Day-Trading.  Day-Trading can be very risky and is not appropriate for customers with limited resources or trading experience, a short time horizon, or a low risk tolerance.  We reserve the right to prohibit you from engaging in Day-Trading.\n\t</p>\n\t<p><b>FREE RIDING</b><br />\n\tRegulation T (“Reg T”) is a Federal Reserve Board regulation that governs the amount of credit brokerage firms can extend to customers for the purchase of securities.  Profits derived from transactions in your account that are placed in violation of the cash account provisions of Reg T will be forfeited to BWIS, to the extent permitted by applicable law.  Losses on transactions that violate the cash account provisions of Reg T will remain your responsibility.\n\t</p>\n\t<p><b>ORDER ROUTING DISCLOSURE</b><br />\n\tBWIS handles orders so as to obtain a competitive execution price in line with the firm’s regulatory obligations. Execution price, speed, liquidity and account access are affected by many factors, including but not limited to size, order type, available market centers, and market volatility.  Brokerage orders are routed through Pershing, and Pershing’s electronic order-processing system channels Client orders to an appropriate market center given the characteristics of the order, market data and trading statistics.  In deciding where to send an order, Pershing looks at a number of factors, such as size of order, trading characteristics of the security, favorable execution prices (including the opportunity for price improvement), access to reliable market data, availability of efficient automated transaction processing, and execution cost. Some market centers may execute orders at prices superior to the publicly quoted market. When securities may be traded in more than one marketplace, Pershing may use its discretion in selecting the market in which to place your order.\n\t</p>\n\n\t<p>BWIS does not receive payment for order flow from other broker-dealers, any U.S. exchange or NASDAQ for routing your orders in securities quoted on U.S. exchanges or NASDAQ trading systems.\n\t</p>\n\n\t<p>The SEC has also adopted a rule requiring all brokerage firms to make publicly available quarterly reports on their order routing practices. In accordance with these rules, BWIS\'s execution reports and order routing statistics are available for public review by visiting <a href="https://www.orderroutingdisclosure.com" target="new">https://www.orderroutingdisclosure.com</a> and entering “BancWest Investment Services, Inc.” as the search term.  Upon written request to BWIS, you may obtain the identity of the venue to which your orders were routed and the time of the transactions that may have resulted from such orders for the six months prior to your request.\n\t</p>\n\n\t<p><b>MUTUAL FUNDS </b><br />\n\tYou agree that, in purchasing and redeeming shares of a mutual fund through BWIS, BWIS\'s policies and procedures will govern such transactions rather than those of the mutual fund as described in its prospectus, which may be either more or less beneficial to you as an investor.  You agree that BWIS\' policies and procedures on items such as minimum investment requirements, exchange of fund shares, dividend accrual and date for payment of accrued dividends may vary from those applicable to direct fund shareholders. You acknowledge that in certain instances you may be charged different or additional fees such as a redemption fee or transaction fee surcharge that would not be imposed by the fund on direct shareholders.\n\t</p>\n\n\t<p><b>ANNUITIES/INSURANCE</b><br />\n\tBWIS makes available to its client’s insurance products (fixed and variable annuities, life, disability, and long term care insurance) underwritten and issued by participating insurance companies. Any obligations under these contracts or policies are the exclusive obligations of the insurance companies and are subject to the financial conditions of the insurance companies. Bank of the West, its affiliates, and subsidiaries are separate from and unaffiliated with the participating insurance companies. Securities and variable annuities are offered through BWIS, a registered broker/dealer, member of FINRA/SIPC, and SEC Registered Investment Adviser. Financial Advisors are Registered Representatives of BancWest Investment Services. Fixed annuities/insurance products are offered through BancWest Insurance Agency in California, (License #0C52321), and through BancWest Investment Services, Inc. in all other states where it is licensed to conduct insurance business.\n\t</p>\n\n\t<p><b>NON-PUBLICLY TRADED SECURITIES </b><br />\n\tBWIS may, at its discretion, agree to accommodate requests from clients to hold certain securities, such as hedge funds, private equity funds, private placements, and other securities that do not trade on securities exchanges or over-the-counter markets (“Non-Publicly Traded Securities”). In consideration for BWIS accepting these Non-Publicly Traded Securities into your account, you agree that BWIS\'s sole obligation with respect to such Non-Publicly Traded Securities will be to (1) obtain and maintain possession or control of such securities in a manner as required by the SEC and (2) file and provide reports and information as required under the Internal Revenue Code, the regulations thereunder of the Internal Revenue Service. Additional terms and conditions will be presented to you at the time of any such request.\n\t</p>\n\n\t<p><b>LIMITATIONS ON SECURITIES AVAILABLE</b><br />\n\tBWIS reserves the right to limit the securities it makes available.  Securities traded in over-the-counter bulletin boards and pink sheet securities and other thinly-traded securities present particular trading risks in that they are often more volatile and generally less liquid than securities traded on exchanges. We reserve the right to place restrictions on the trading of securities, including securities on various restricted lists, without advance notice, including requiring that trades in such securities be conducted through the BWIS Service Center rather than online.\n\t</p>\n\n\t<p class="title"><b>ONLINE INVESTING; FINANCIAL INFORMATION; MARKET DATA</b></p>\n\n\t<p><b>ONLINE INVESTING </b><br />\n\tSelf-directed investing in your account online through BWIS’ Online Investing Service allows you to enter orders to buy and sell U.S. market traded equities, including exchange-listed and widely-held over-the-counter stocks, a wide selection of mutual funds, and certain fixed income securities and certificates of deposit through a self-directed account through its Online Investing Service. BWIS has no obligation to offer or continue to offer any particular products through the Online Investing Service. Certain products that BWIS offers other customers may not be available for online self-directed investing.  Not all accounts are eligible for online self-directed investing.  Online customers will agree to a separate set of terms and conditions in order to gain access to online trading features. Access to the Online Investing Service may be limited or unavailable during periods of peak demand, market volatility, systems upgrades or maintenance, or for other reasons. If the Online Investing Service is unavailable or delayed at any time call the BWIS Service Center at 1-800-338-3919 to place an order. BWIS will not be liable to you if you are unable to access your Self-Directed Account or place an order through the Online Investing Service. Self-directed orders placed through the Online Investing Service are subject to fees and charges that may be different from those related to Full Service Accounts. Please refer to the fee schedule for further information.\n\t</p>\n\n\t<p><b>ONLINE ACCESS IN FULL-SERVICE ACCOUNTS</b><br />\n\tBWIS provides online access to your Full Service Account.  Through BWIS’ Online Investing Service you may access your account balances, holdings, and statements online.   If you wish to engage in self-directed online investing, you will need to open a Self-Directed Account. BWIS reserves the right to require additional information or documentation to activate online trading in a Full Service Account and will make the trading functions available only upon customer request. You agree and understand that any online trades within your Full Service Account are unsolicited trades. Accordingly, any order you place online in a full-service account, whether based on information obtained from BWIS or otherwise, represents your own self-directed trading decision and does not constitute investment advice or a recommendation by BWIS and BWIS has no responsibility for determining the suitability of any online trades you place.\n\t</p>\n\n\t<p><b>RESEARCH AND FINANCIAL INFORMATION</b><br />\n\tBWIS may make available certain research reports, financial market data, quotes, news, research and other financial information (collectively, "Financial Information") through its online investing service or otherwise that may be prepared by BWIS or one of its affiliates, or by various third-party investment bankers or other entities providing analysis, research and opinions ("Financial Information Providers"). BWIS does not endorse or approve Financial Information Providers and only makes such Financial Information available to you as a service and convenience. The Financial Information has been prepared as of the date indicated and may become unreliable for various reasons including, for example, changes in market or economic circumstances.  BWIS and each Financial Information Provider are not obligated to update any information or opinions contained in any Financial Information or to continue to offer Financial Information regarding any company or security.\n\t</p>\n\n\t<p><b>NO WARRANTY; LIMITATIONS ON LIABILITY</b><br />\n\tBWIS and the Financial Information Providers and transmitters do not (1) guarantee the accuracy, timeliness, completeness or correct sequencing of the Financial Information, or (2) warrant any results from your use of the Financial Information. BWIS will not be liable for any decision or action you take in reliance on the Financial Information. You further agree that none of BWIS, the Financial Information Providers and the Financial Information Transmitters will be liable in any way for the interruption of any data, Financial Information or other aspect of the Online Investing Service. You agree that none of the Financial Information constitutes investment advice or a recommendation or solicitation that you should purchase or sell any particular security or a representation that any securities are suitable for you.\n\t</p>\n\n\t<p><b>TAX ISSUES</b></p>\n\n\t<p><b>TAX LOT DISPOSITION</b><br />\n\tYou agree that for tax reporting purposes, BWIS will use the First In, First Out (“FIFO”) method to determine your cost basis for securities purchased and sold unless you expressly designate otherwise at the time you open your account or in writing thereafter.\n\t</p>\n\n\t<p><b>BACK-UP TAX WITHHOLDING</b><br />\n\tIf you do not provide us with accurate and complete tax-reporting information, including a properly-executed W-8 BEN form if applicable, you will be subject to back-up tax withholding and agree not to hold BWIS liable.  You acknowledge that you are responsible for paying all federal and, if applicable, state and local taxes and that you may incur penalties if your withholding and estimated tax payments are insufficient.\n\t</p>\n\n\t<p><b>NO LEGAL OR TAX ADVICE</b><br />\n\tYou understand that BWIS does not give legal or tax advice and that you should not rely on any general tax or estate planning information provided.  You agree that these principles may not apply to Client’s specific circumstances or take into account your comprehensive tax or estate planning situation and should consult your own tax or legal adviser. The IRS imposes maximum allowable contributions within each tax year for IRAs and qualified plans. It is your sole responsibility to seek professional tax advice to determine the maximum allowable contribution for IRA and qualified accounts.\n\t</p>\n\n\t<p class="title"><b>ELECTRONIC DELIVERY AND SIGNATURE</b></p>\n\n\t<p><b>ELECTRONIC DELIVERY</b><br />\n\tYou will be asked to consent to electronic delivery at account opening. If you consent to electronic delivery (“e-delivery”) at or after account opening, you are agreeing to the electronic delivery of communications relating to your account, including but not limited to trade confirmations, account statements proxies, shareholder reports, tax information, privacy notices and regulatory notices ("Account Communications"). You agree to abide by the terms and conditions of electronic delivery of Account Communications as they may be amended from time to time. Account Communications are deemed provided to you when BWIS emails them, or a link to them, to the email address on file for your account or notifies you via email that they are posted them on a secure password-protected website, regardless of whether you actually access or view a particular document. You agree that the provision of an electronic version of a document or a link thereto fully satisfies any requirement that it be provided to you in writing.  You affirm that you have functioning internet access and a valid e-mail address on record with BWIS and that you have installed adequate software, such as a current version of Adobe Acrobat Reader or a similar product, that enables you to view Account Communications. You will be notified by e-mail when Account Communications are available to be viewed online. E-mail notification(s) will be sent to the e-mail address you provided to BWIS at account opening and which you are solely responsible for updating as needed. There is no charge from BWIS for electronic delivery; however, online access and usage charges by your internet service or access provider may apply. BWIS will not send you a paper copy of electronic Account Communications, unless you request it.  You can obtain a paper copy of any Account Communication we provide to you electronically by printing it yourself or by requesting that we mail you a paper copy by contacting BWIS at the number below.  You understand that you be charged if you request paper copies of one or more documents. Electronic delivery will remain in effect unless and until you contact BWIS to withdraw your consent and change your delivery preferences or if your e-mail address becomes invalid.  To change your delivery option at a later date, such as resuming paper Account Communications, you must call us at 1-800-338-3919 or send written notice to BWIS, Attn: Operations, 13220 California Street, Suite 200, Omaha, NE 68154. We reserve the right, in our sole discretion, to provide you with any Account Communications on paper, even if you have authorized electronic delivery.\n\t</p>\n\n\t<p><b>ELECTRONIC RECORDS & SIGNATURES</b><br />\n\tThis Agreement may be in the form of an Electronic Record and may, if BWIS and you have expressly agreed to accept Electronic Signatures, be executed using Electronic Signatures (including manually-executed paper documents that are sent by facsimile, pdf, or other electronic means), which shall be considered an original and shall have the same legal effect, validity and enforceability as an original paper record. For purposes hereof, each of the terms “Electronic Record” and “Electronic Signature” has the respective meaning assigned to it in 15 USC §7006 (as the same may be amended from time to time).\n\t</p>\n\t<p>You agree to be bound by any consent, affirmance, representation, or agreement you sign electronically by computer or mobile device, including but not limited to any consent given to receive communications from BWIS solely through electronic means.  You agree that when clicking on an "I agree," "I consent" or another similarly worded "button" or entry field,  or signing a document digitally online, your electronic agreement or consent will be as legally binding and enforceable as your handwritten signature   If you sign electronically, you represent that you have a current and valid e-mail address on file; you have the ability to access and retain an electronic copy of the documents and have access to a printer to print the information or the ability to download the information. You agree that you will carefully review any document or web page before entering or affixing an electronic signature and acknowledge that you are obliged to review the BWIS website periodically for changes or modifications.  </p>\n\n\t<p class="title"><b>MISCELLANEOUS</b></p>\n\n\t<p><b>RECORDING CONVERSATIONS</b><br />\n\tYou understand and agree that BWIS may, but is not obligated to, electronically record any telephone conversations between you and BWIS to verify transactions, monitor the quality of the service provided, or for other business reasons. You acknowledge that we may not be able to locate a tape recording unless you can provide sufficient information to identify the call which may include the date and time of the conversation and the phone number from which the call was placed. You further agree that BWIS has the sole right to determine how long tape recordings will be retained.\n\t</p>\n\n\t<p><b>CORPORATE ACTIONS</b><br />\n\tYou agree that you are responsible for knowing the rights and terms of all securities in your account and that you are responsible for making election decisions in corporate actions. BWIS is not obligated to notify you of any upcoming expiration or redemption dates or to take any other action on your behalf without specific instructions from you.\n\t</p>\n\n\t<p><b>BENEFICIARY DESIGNATION</b><br />\n\tChanges in the relationship between the account owner and the designated beneficiary (such as marriage. divorce, and adoption) will not automatically change or revoke beneficiary designations.  To change a beneficiary, you must complete a new beneficiary designation form and it must be accepted and processed by BWIS before the change becomes effective.\n\t</p>\n\n\t<p><b>COMPLIANCE WITH LAWS/SANCTIONS</b><br />\n\tYou agree to comply with all applicable laws and regulations, including those relating to sanctions (“Sanctions”), anti-bribery, anti-money laundering, the fight against terrorism enacted or enforced by the United States of America, the European Union, the French Republic, or other relevant authority. You represent that you are not the target of Sanctions or owned or controlled by a person or entity that is the target of Sanctions (“Sanctions Target”), and that you do not appear on any sanctions list, including the United States Office of Foreign Assets Control’s (“OFAC”) list of Specially Designated Nationals (“SDN”), the European Union Consolidated List, and the French Republic sanctions lists.  You agree not to use your account or related services to engage in any activity or transaction that is illegal or involves a Sanctions Target or sanctioned country or territory. You agree that the Bank may delay or refuse to process transactions and/or restrict or freeze part or all of your account if you directly or indirectly engage, or attempt to engage in, any transaction prohibited by Sanctions. You agree to notify the Bank immediately if you become a Sanctions Target, a citizen, temporary or permanent resident of, or incorporated under the laws of a sanctioned country or territory. You agree to hold the Bank harmless from liability for any actions taken by the Bank to comply with applicable laws and regulations, including Sanctions.\n\t</p>\n\n\t<p><b>SIPC PROTECTION</b><br />\n\tThe Securities Investor Protection Corporation provides protection that covers the loss of securities in your account up to a total value of $500,000 (including up to $250,000 for claims of cash) but only if that loss is the result of Pershing’s financial failure or bankruptcy.  SIPC does not cover losses due to market fluctuations. Further information on SIPC coverage may be obtained at <a href="www.sipc.org" target="new">www.sipc.org</a> or by calling (202) 371-8300.  Pershing may maintain excess coverage beyond SIPC which is available under certain circumstances.  See Pershing’s website at <a href="https://www.pershing.com/about/strength-and-stability" target="new">https://www.pershing.com/about/strength-and-stability</a>.\n\t</p>\n\n\t<p><b>DETERMINATION OF INCAPACITY AND CAPACITY </b><br />\n\tBWIS is entitled to rely on one or more of the following methods of notification of the incapacity of one or more of you:  (1) a certification of a licensed physician or a judicial determination that you are unable to manage your financial affairs by reason of mental or physical incapacity, or (2) the appointment of a guardian, conservator, or personal representative of your estate or person.  BWIS has no duty to investigate, confirm or inquire regarding your capacity, and is not liable for any action or inaction taken at your direction prior to actual notice of your incapacity.  BWIS is entitled to rely upon a certification of a licensed physician or a judicial determination that you are able to manage your financial affairs or a judicial determination that restores your authority to manage your account.\n\t</p>\n\n\t<p><b>TRUSTED CONTACT</b><br />\n\tYou may provide us with the name of a Trusted Contact Person ("TCP").  A TCP is someone you tell us we can contact if we suspect you may be subject to financial exploitation or we have questions about your mental or physical well-being.  Designating one or more TCPs is solely your decision and is optional.  However, by electing a TCP, you understand that you have authorized BWIS to contact the TCP at our discretion and to disclose information about your account to help us address the situations noted above. This includes disclosing information about your account to address possible financial exploitation, confirming the specifics of your current contact information, your mental and physical health status, and/or the identity of any legal guardian, executor, trustee, or power of attorney on your account(s), or as otherwise permitted by industry regulations or state law.\n\t</p>\n\n\t<p><b>ACH TRANSFERS</b><br />\n\tBWIS may in its sole discretion impose dollar limits or other conditions or restrictions on incoming or outgoing ACH transfers. BWIS is under no obligation to inform you if it does not complete a transfer because there are insufficient funds in your account to process the transfer.  In that case, you are responsible for making alternate arrangements or rescheduling the transfer. Under no circumstance will BWIS be liable to you for damages, including any consequential damages, as the result of a failure to process or a delay in processing an ACH transfer requested by you.  In the event that BWIS, at any time, incurs a problem with your use of an ACH transfer, including without limitation, the recall or reversal of a transfer of funds into your BWIS account or the inability to collect funds with respect to any transfer to or from an account at another financial institution, and without limiting any other right or remedy that we may have under this Agreement or otherwise, BWIS reserves the right to immediately suspend your ability to make transfers without prior notice to you and to take legal action against you.  You agree that if BWIS suffers any losses as a result of the recall or reversal of an ACH transfer into or out of your BWIS account, whether by you or by a financial institution, you are liable to BWIS for the full amount of all losses, plus interest at the statutory rate, attorneys’ fees, and punitive damages if your conduct was willful.\n\t</p>\n\n\t<p><b>UNCLAIMED PROPERTY</b><br />\n\tUnclaimed property law requires us to turn over to the state of your last known address (as shown in our records) personal property including assets in your BWIS account which is unclaimed by its owner for a set period of time. Before we turn over the assets in your account (if any), Pershing will, as required by law, send a notice to the address currently shown on your account statement. You agree not to hold BWIS or Pershing liable for turning over unclaimed property in compliance with laws and regulations. You may recover unclaimed property turned over to a state by contacting that state.\n\t</p>\n\n\t<p><b>WORTHLESS SECURITIES</b><br />\n\tYou agree that BWIS may remove a worthless security from your account including, without limitation, if Pershing or the Depository Trust Company has deemed the security worthless and eligible for removal.  You agree to waive any claims against BWIS in connection with the removal of the security, including claims from any further distributions from the security.  If you provide BWIS with evidence of the value of the security from an independent third party within 60 days of receiving your account statement noting the removal, we agree to review, and if able to, reinstate your position.\n\t</p>\n\n\t<p><b>SUCCESSORS</b><br />\n\tThis Agreement and its provisions shall be continuous, and shall be binding upon you and your estate, executors, administrators, and assigns and shall inure to the benefit of BWIS, its parent organizations, and any successor organization or assigns. If there is a change in clearing broker, this Agreement shall remain in full force and effect and references to Pershing in the Agreement shall be deemed to apply to the successor clearing broker.\n\t</p>\n\n\t<p><b>AMENDMENTS</b><br />\n\tBWIS reserves the right to amend, add to, delete or modify these Terms and Conditions with or without written notice.  The current version of the Agreement will be posted on the BWIS website and your continued account activity after such amendment constitutes your agreement to be bound by all changes to the Agreement, regardless of whether you actually have reviewed them.\n\t</p>\n\n\t<p><b>SEVERABILITY</b><br />\n\tIf any provision of this Agreement is held to be illegal, invalid or unenforceable, the other provisions of this Agreement shall remain in full force and effect.\n\t</p>\n\n\t<p><b>TERMINATION</b><br />\n\tYou may close your BWIS account at any time by giving BWIS notice in writing or another form acceptable to BWIS.  BWIS may, in its sole discretion, close your account or terminate any or all services rendered under this Agreement without notice at any time and for any reason.  If we decide to terminate your account and you fail to transfer it to another broker within 30 days, we may liquidate the account and send you the proceeds.  A termination fee will be applicable and BWIS can liquidate securities or withhold cash to pay the termination fee prior to any transfer or withdrawal of funds or securities.  If you request a transaction that would cause your account balance to fall below the amount of the termination fee, BWIS reserves the right to withhold the amount of the termination fee and close your account.\n\t</p>\n\n\t<p><b>GOVERNING LAW, VENUE AND JURISDICTION</b><br />\n\tThis Agreement shall be governed by the laws of California, but not its conflicts of laws provisions.  You hereby consent to the jurisdiction and venue of the courts of the State of California.\n\t</p>\n\n\t<p class="title">QUESTIONS AND COMPLAINTS</p>\n\n\t<p><b>CONTACTING US ABOUT ERRORS AND QUESTIONS</b><br />\n\tIn case of errors or questions about the transactions recorded on your statements, you should, as soon as possible, notify us via one of the following:</p>\n\t<ul>\n\t<li>Telephone us at 1-800-338-3919, during customer service hours; </li>\n\t<li>Contact your BWIS Financial Advisor<br /></li>\n\t<li>Write us at:<br />\n\t\t\t<blockquote>\n\t\t\tBWIS, Attn: Operations<br />\n\t\t\t13220 California Street, Suite 200<br />\n\t\t\tOmaha, NE 68154 </blockquote>\n\t</li></ul>\n\n\t<p><b>If you think your statement or transaction record is incorrect or you need additional information about a service transaction, we must hear from you no later than two (2) days after a confirmation or ten (10) days after the FIRST account statement on which the problem or error appeared.</b><br /><br />\n\n\tYou must provide BWIS with the following information:</p>\n\t<ul>\n\t<li>Your name and account number;</li>\n\t<li>A description of the error or transaction in question and an explanation of why you believe it is in error or why additional information is being requested; and</li>\n\t<li>The date and dollar amount of the suspected error. </li>\n\t</ul>\n\n\t<p><b>COMPLAINTS</b><br />\n\tComplaints should be sent to: BWIS, Attn: Compliance, 13220 California Street, Omaha, NE 68154 or you may call 1-800-338-3919. If you inform BWIS of a complaint verbally, we may require you to send your complaint in writing or via email within 10 business days. If you make a complaint, BWIS will conduct an investigation and endeavor to send you a written explanation of our decision upon completion of our investigation.\n\t</p>\n\t<p class="title">CASH SWEEP TERMS AND CONDITIONS</p>\n\n\t<p><b>SWEEP OFFERINGS</b></p>\n\t<p>\n\tBWIS is pleased to offer the Bank of the West Insured Cash Reserves (“BWIC”) as the default option for the automatic investment of the un-invested cash balances in your account and transfer of those available cash balances from your brokerage account into a deposit account at the Bank on a daily basis (“Cash Sweep”). You agree that BWIS can designate the BWIC as your default Cash Sweep option.  BWIS reserves the right to change the Cash Sweep option on your account as well as the eligibility requirements for any sweep option, in its sole discretion. If the sweep option that you have selected or been defaulted into is discontinued or if you become ineligible for the sweep option you selected, you direct BWIS to elect another sweep option on your behalf from among those for which are eligible, with prior notification to you.  If you do not want a Cash Sweep on your account, and instead prefer to hold that cash as a free credit balance, in which case you will earn no income on the un-invested cash in your account, you must affirmatively notify BWIS at 800- 338-3919.\n\t</p>\n\n\t<p>\n\tBy opening a BWIS account and using either BWIC or BICA, (collectively “sweep options”), you agree to appoint Pershing as your authorized agent to establish and maintain deposit accounts at the Bank and to effect deposits and withdrawals from the Bank pursuant to the terms and conditions set forth in the Terms and Conditions in this Agreement (“Cash Sweep”). Balances in BWIC and BICA are eligible for Federal Deposit Insurance Corporation (“FDIC”) insurance subject to the terms and limitations of the FDIC. The standard\n\tinsurance amount is $250,000 per depositor, per insured bank, for each account ownership category. For further information on FDIC insurance, please refer to the FDIC website at <a href="https://www.fdic.gov" target="new">www.fdic.gov</a> or call 1-877-275-3342.\n\t</p>\n\n\t<p><u><b>Terms and Conditions</b></u>: This portion of our cash sweep disclosure communication contains a summary of certain features of the Cash Sweep. It is prepared for your convenience, and it must be read in conjunction with the more detailed disclosure below. These Terms and Conditions are supplemental to your existing Account Agreement(s) which you executed to open and maintain your brokerage account with Pershing through BWIS.\n\t</p>\n\n\t<p><u><b>A Summary of the Program</b></u>: Pershing operates the Cash Sweep at the request of BWIS, which sweep the un-invested cash balance in your brokerage account carried at Pershing to an interest-bearing bank deposit account at the Bank and also sweeps your cash from the Bank to cover purchases of securities and other debits in your brokerage account carried at Pershing. Provided there is a positive yield, you will receive interest on your balances in the Cash Sweep.  Pershing earns fees based on the total amount of deposit balances in the Cash Sweep, including your balance.\n\t</p>\n\n\t<p><u><b>Conflicts of Interest</b></u>:  BWIS and the Bank have profit-sharing arrangements by which BWIS receives compensation related to the Bank’s earnings on deposits in the Cash Sweep.  Depending on the rates in effect at the time, the compensation BWIS and the Bank receive may be higher than the interest paid to you.  As a result of this compensation, BWIS has a conflict of interest in limiting the sweep options available to you to BWIC, BICA or other affiliated Bank products. BWIC and BICA are intended for short-term cash holdings awaiting investment, not as a long-term investment vehicle. If you desire to maintain a large cash position in your account for other than a short period of time, you should contact your BWIS representative to discuss your options. Pershing also earns fees based on the total amount of deposit balances in the Cash Sweep, including your balance. In certain interest-rate environments, BWIC and BICA pay a lower interest rate than money market mutual funds and other cash, or cash alternative investment, vehicles.  BWIS offers a variety of other products including money market mutual funds and bond funds that can be purchased through BWIS on a position-traded basis (in other words, by placing an order to buy a specific number of shares of that investment), just not on an automated sweep basis.  The Bank does not have a duty to offer the highest rates available or rates that are comparable to Money Funds or those offered by other depository institutions.\n\t</p>\n\n\t<p><u><b>FDIC Insurance</b></u>: Pershing has established standing instructions with the Bank to ensure that Pershing maintains control over your balance in BWIC and BICA at all times. FDIC Insurance protects your balance in BWIC and BICA in the event of the failure of the Bank, up to allowable limits as determined by the FDIC. However, any money held at the Bank outside of the Cash Sweep account will impact the insurance coverage available on your BWIC or BICA balance.  Neither Pershing, nor BWIS, takes any responsibility for money you hold at the Bank outside of the Cash Sweep account. You are solely responsible for monitoring your deposits as they relate to FDIC Insurance.\n\t</p>\n\n\t<p><u><b>Securities Investor Protection Corporation (“SIPC”)</b></u>: SIPC insures customer assets up to $500,000 (of which not more than $250,000 may be in cash) held at broker-dealers, such as Pershing, in the event of the failure of the broker-dealer. However, assets covered under FDIC Insurance (see above) are exempted from SIPC coverage.  Therefore, SIPC coverage is not available for deposits in the Cash Sweep account.\n\t</p>\n\n\t<p><u><b>Access to Funds</b></u>: You may access your Cash Sweep account balance through your brokerage account by contacting your BWIS registered representative. In the event your BWIS registered representative is unavailable, you may access your funds by contacting BWIS at 800- 338-3919.  In the event BWIS cannot assist with the matter, you may access your funds by contacting Pershing at 1-201-413-3333.  All withdrawals are subject to the Bank’s reserved right to require 7 days’ advance notice of withdrawal.  Your brokerage account statement will identify the Bank as the deposit bank and your Sweep Account month end balance.\n\t</p>\n\n\t<p><u><b>Determination of Interest Rates</b></u>:  The Bank in its sole discretion determines the interest rate paid on the Cash Sweep. Interest rates may fluctuate and are based on the current level of short term interest rates at the time, as set from time to time by the Bank. The current interest rates, as well as other money market rates, are available from a BWIS registered representative and on BWIS’ website.\n\t</p>\n\n\t<p><u><b>Risks of the Program</b></u>: You may receive a lower rate of return on balances in the Cash Sweep account than on other types of investments, such as money market mutual funds.  Please contact your BWIS registered representative for information regarding such alternatives.  The Bank is permitted to impose a seven-day delay on any withdrawal request. In the event of a failure of the Bank, there may be a time period during which you may not be able to access your money. If you have cash at the Bank outside the sweep options, this may negatively impact the availability of FDIC Insurance for the total amount of your funds held within and outside the Cash Sweep balance at the Bank. If your balance in the Cash Sweep account exceeds $250,000, the balance in excess of this amount will not be insured by the FDIC.\n\t</p>\n\n\t<p><u><b>Account Eligibility</b></u>: The Cash Sweep is available to the following types of accounts: individual, joint, IRAs, certain business entities, including corporations, and certain fiduciary and trusts provided the beneficiaries are individuals or otherwise eligible to maintain an interest-bearing account.  All eligible account types will receive the BWIC option. The Bank of the West Insured Cash Reserves Advantage (“BICA”) may also be used as a cash sweep option for those accounts that meet the following eligibility requirements: the account must have been opened prior to April 1, 2020; must have had a cash balance of $100,000 or more at the time of account opening; and must maintain a cash balance of $100,000 or more.  BWIS reserves the right to modify or eliminate the BICA option and/or to remove BICA as the sweep option for accounts that do not maintain cash balances of $100,000 or more or otherwise meet BICA’s eligibility requirements, upon prior notification.\n\t</p>\n\n\t<p><u><b>Pershing & Sweep Mechanics</b></u>:</p>\n\t<ol class="typeA">\n\t<li><b>Relationship with Pershing</b><br />\n\t<p>Pershing is acting as your agent in establishing and maintaining an interest-bearing deposit account at the Bank, including depositing your money to and withdrawing your money from the Bank through your brokerage account. Your initial cash sweep to the Bank will constitute the appointment of Pershing to act as your agent to effect deposits to and withdrawals from the sweep accounts at the Bank.</p></li>\n\n\t<li><b>Information about Pershing</b><br />\n\t<p>Pershing is a wholly-owned subsidiary of The Bank of New York Mellon Corporation, a registered broker-dealer in securities, and a member organization of the NYSE, SIPC and FINRA.</p></li>\n\n\t<li><b>Deposits</b><br />\n\t<p>Each business day, Pershing will cause to be deposited the excess cash balances in your brokerage account to a deposit account in its name as agent for its customers maintained at the Bank (“Sweep Account”).  Your Sweep Account deposit balance will be evidenced by an entry on records maintained by Pershing as record keeper for the Bank, and your brokerage account statement will reflect all deposits, withdrawals, deposit balance(s) and the applicable interest rate. You will not be issued any evidence of ownership of a Cash Sweep balance, such as a passbook or certificate. Deposits in the Cash Sweep account are direct obligations of the Bank and are not directly or indirectly an obligation of Pershing, BWIS, or any other organization.</p></li>\n\n\t<li><b>Withdrawals</b><br />\n\t<p>As a participant in the Cash Sweep, you consent to have your money on deposit in the Sweep Account at the Bank automatically withdrawn by the cash sweep feature in the event of a debit in your brokerage account carried at Pershing, such as on a settlement date to pay for securities purchased.  As needed, Pershing will sweep cash from the Sweep Account. You may make withdrawals from Sweep Account balances in any amount not exceeding the total Sweep Account balance, but only through your brokerage account. All withdrawals are subject to the Bank’s reserved right to require seven (7) days’ advance notice of withdrawal<br /><br />\n\tInterest and Fees: interest rate applicable to your Sweep Account balance will be stated on your brokerage account statement. You may contact your BWIS registered representative to obtain the current interest rate being paid to customers, and balance details as of the most recent business day.  Interest will be accrued daily and will be posted on a monthly basis to the Sweep Account. Interest will accrue on the Sweep Account balances from the day they are deposited at the Bank through the business day preceding the date of withdrawal from the Bank. The rate you earn from the Sweep Account can be lower than the rates available to depositors from other deposit accounts at the Bank, from other types of accounts or investment alternatives at Pershing, including money market funds, or from comparable accounts in other depository institutions. You should compare the terms, rates of return, required minimum amounts, charges and other features of the Sweep Account with other accounts and investment alternatives <b>There is no minimum amount or period that your money must remain on deposit, and there is no penalty for withdrawal of your entire balance, or any part thereof, at any time.</b> Pershing receives a fee from the Bank on the average daily net assets in the Bank Sweep Account. As affiliates, BWIS and Bank have profit sharing agreements from which BWIS receives compensation related to earnings by the Bank on sweep deposits.  Pershing receives a fee from the Bank monthly based on the average daily net assets in the Sweep Account for its services with respect to the Sweep Account. BWIS receives from the Bank a percentage of the income earned by the Bank from your sweep deposits. The Bank’s payments to BWIS do not reduce the stated interest earned on your deposits with the Bank. The BWIS registered representatives receive no fees for your participation in the Sweep Account</p></li>\n\n\t<li><b>Account Statements</b><br />\n\t<p>You will receive a periodic brokerage account statement from Pershing. All activity with respect to your Sweep Account balance, including interest earned for the period covered, will appear on that statement. You will not receive a separate statement from the Bank or BWIS. You should notify your BWIS registered representative immediately of any discrepancies on an account statement.</p></li>\n\n\t<li><b>Alternatives to the Cash Sweep </b><br />\n\t<p>As a participant in the Cash Sweep, you agree to the terms provided herein. You understand that, at any time, you may withdraw your consent to participate in the Cash Sweep.  If you withdraw your consent, any un-invested cash will be a free credit balance on your account and you will not earn any interest on those funds. You can contact a BWIS registered representative for other cash investment options then available.  </p></li>\n\n\t<li><b>Tax Reporting</b><br />\n\t<p>The interest that you receive from the Sweep Account is generally fully subject to state and federal tax, as is income that you may receive from money market funds. Pershing will send a tax information form for each year showing the amount of interest income you have earned.</p></li>\n\n\t<li><b>Changes to Cash Management Options </b><br />\n\t<p>You agree that BWIS may change cash management options, including but not limited to the types of sweep products and eligibility for them, as well as interest rates, and any other terms and conditions, including transferring or switching between and among free credit balances, bank deposit products, and money market products, as long as we provide 30 calendar days advance notice to you.</p></li>\n\t</ol>\n\n\t<p><b>YOU ACKNOWLEDGE THAT YOU HAVE RECEIVED AND CAREFULLY READ THESE TERMS AND CONDITIONS.  YOU MAY OBTAIN INFORMATION ABOUT THE INTEREST RATE BEING PAID ON THE BANK OF THE WEST CASH SWEEP VIA THE BWIS WEB PAGE OR BY CONTACTING A BWIS REPRESENTATIVE.</b></p>\n\n\t<p class="title">ADDITIONAL DISCLOSURES</p>\n\n\t<p>BWIS provides additional disclosures on our website at <a href="https://www.bankofthewest.com/wealth-management/our-solutions/investments/investments-important-information.html" target="new">https://www.bankofthewest.com/wealth-management/our-solutions/investments/investments-important-information.html</a>. Information provided there includes our Client Relations Summary (also known as Form “CRS”), more detailed information and disclosures in the BWIS Disclosures document, and copies of our Form ADVs (which apply to BWIS’ registered investment advisory business).  Paper copies of these disclosure documents are also available upon request by contacting us at 1-800-338-3919.</p>\n\n\t<p class="title">BUSINESS CONTINUITY PLAN</p>\n\n\t<p><b>BWIS BUSINESS CONTINUITY PLAN</b><br />\n\tBWIS’s BCP addresses the possibility of a Significant Business Disruption (“SBD”) and how BWIS plans to respond.  SBDs can vary in their scope, such as only our firm, a single building used by our firm, the business district where our firm is located, a specific city where our firm is located, or the whole region or country. Within each of these areas, the severity of the disruption can also vary from minimal to severe. In the case of a disruption to only our firm or a building housing our firm, we will transfer our operations to a local site as needed, and expect to recover and resume business as quickly as possible. In a disruption affecting our business district, city, or region, we will transfer our operations to a site outside of the affected area, and recover and endeavor to resume business within 24 hours or as quickly as possible.  In either situation, we plan to continue business and transfer operations to our clearing firm if necessary. If the SBD is so severe that it prevents us from remaining in business, we will ensure our customer’s prompt access to their funds and securities through Pershing directly. We will endeavor to quickly recover and resume business operations in the case of an SBD. We plan to safeguard our employees and property, make a financial and operational assessment, protect the firm’s books and records, and allow our customers to transact business. In short, our BCP is designed to permit our firm to resume operations as quickly as possible, given the scope and severity of the SBD. For further information or any questions about our business continuity plan, you may contact us at 1-800-338-3919 or submit a written request.\n\t</p>\n\n\t<p><b>CONTACTING BWIS</b><br />\n\tIf after an SBD you are unable to contact your BWIS Registered Representative, you should telephone us at 1-800-338-3919, during customer service hours. If you are unable to reach a representative at the provided number, you should contact our clearing firm, Pershing, at 1-201-413-3635 or via their website, www.pershing.com. Pershing will provide prompt access to funds and securities, enter trade orders, and process other trade-related cash and security transfer transactions for you. We have been advised by Pershing that their objective is to restore their own operations and complete existing transactions as well as accept new transactions and payments no later than the next business day following a business disruption. Your orders and requests for funds and securities are subject to delay during this period.\n\t</p>\n\n\t<p><b>PERSHING BUSINESS CONTINUITY PLAN</b><br />\n\tPershing’s BCP disclosure statement is available on their website, www.pershing.com. BWIS will also mail a BWIS BCP brochure to customers upon request. BWIS’s BCP addresses the possibility of a SBD and how BWIS plans to respond to events of varying scope. We have been advised by Pershing that their objective is to restore their own operations and complete existing transactions, as well as accept new transactions and payments, no later than the next business day following a business disruption. Your orders and requests for funds and securities are subject to delay during this period.\n\t</p>\n\n\t<p class="title">BWIS PRIVACY POLICY</p>\n\t<p><b>Permitted Disclosures without Your Authorization</b></p>\n\t<ol class="typeA">\n\t<li><b>BWIS is permitted under law to disclose information we collect about you to third parties in certain circumstances without authorizations, including the following:</b><br />\n\t\t<ol class="type1">\n\t\t\t<li>To unaffiliated third parties: <br />\n\t\t\t\t<ul>\n\t\t\t\t<li>When the disclosure is necessary to perform a business or insurance function;</li>\n\t\t\t\t<li>For determining your eligibility for an insurance payment; and</li>\n\t\t\t\t<li>For detecting or preventing fraud or criminal activity. </li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>To an insurer or its affiliates:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>To detect or prevent fraud or criminal activity; and</li>\n\t\t\t\t<li>To process transactions or to provide services you have requested.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>To a medical-care institution or doctor:<br />\n\t\t\t\t<ul><li>To verify insurance coverage.</li></ul>\n\t\t\t</li>\n\t\t\t<li>To an insurance regulatory authority.</li>\n\t\t\t<li>To a law enforcement or other governmental authority pursuant to law.</li>\n\t\t\t<li>To an affiliate whose only use of the information will be in connection with an audit of BWIS or its agent or the marketing of an insurance product or service, provided the affiliate agrees not to disclose the information for any other purpose or to unaffiliated persons.</li>\n\t\t\t<li>To a group policyholder for the purpose of reporting claims experience or conducting an audit of the insurance institution\'s or agent\'s operations or services.</li>\n\t\t\t<li>To a governmental professional licensing or regulatory board to review the service or conduct of a health care institution or health professional that BWIS has reason to believe has violated its licensing act or engaged in the unlawful practice of a licensed professional.</li>\n\t\t\t<li>To a representative of a party to a proposed or consummated sale, transfer, merger, or consolidation of all or part of the business of BWIS.</li>\n\t\t</ol>\n\t</li>\n\t<li><b>Your Rights with Respect to Accessing Recorded Personal Information:</b><br />\n\t\t<ol>\n\t\t\t<li>Upon receipt of your written request for access to recorded personal information which is reasonably described and reasonably locatable and retrievable, BWIS will, within 30 business days from the date such request is received:<br />\n\t\t\t\t<ul>\n\t\t\t\t\t<li>Inform you of the nature and substance of such recorded personal information;</li>\n\t\t\t\t\t<li>Provide you with a copy of the recorded personal information;</li>\n\t\t\t\t\t<li>Disclose to you the identity of those persons or institutions whom the insurer has disclosed such personal information within two years prior to such request; and</li>\n\t\t\t\t\t<li>Provide you with a summary of the procedures by which you may request correction, amendment or deletion of recorded personal information.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>BWIS will also identify the source of the information if such source is an institutional source.</li>\n\t\t\t<li>For any medical information, BWIS will identify the doctor or the medical care institution which provided such information. BWIS can send the information directly to you or your doctor. If information is sent to a doctor, BWIS will notify you at the time of the disclosure that it has been provided to the doctor.</li>\n\t\t\t<li>BWIS may charge a reasonable fee to cover the costs incurred in providing a copy of recorded personal information to you.</li>\n\t\t\t<li>Information obtained from a report prepared by an insurance-support organization may be retained by the insurance-support organization and disclosed to other persons.</li>\n\t\t</ol>\n\t</li>\n\t<li><b>Your Rights with Respect to Correcting, Amending, or Deleting Any Recorded Personal Information:</b><br />\n\t\t<ol>\n\t\t\t<li>Upon receipt of your written request to correct, amend or delete any recorded personal information in our possession about you, we will, within 30 business days, either:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>Correct, amend or delete the portion of the recorded personal information in dispute; or</li>\n\t\t\t\t<li>Notify you if BWIS cannot make such correction, amendment or deletion, the reasons for denying the request, and your right to file a statement as provided below.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>If BWIS grants the request for correction, amendment or deletion of recorded personal information, BWIS will notify you in writing and furnish such correction, amendment or fact of deletion to:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>Any person specifically designated by you who may have, within the preceding two years, received such recorded personal information;</li>\n\t\t\t\t<li>Any insurance-support organization if the insurance-support organization has systematically received such recorded personal information from the insurance institution within the preceding seven years; provided, however, that the correction, amendment or fact of deletion need not be furnished if the insurance-support organization no longer maintains recorded personal information about you; and</li>\n\t\t\t\t<li>Any insurance-support organization that furnished the personal information that has been corrected, amended or deleted.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>If you disagree with BWIS\' refusal to correct, amend or delete recorded personal information, you are permitted to file with BWIS:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>A concise statement setting forth what you think is the correct, relevant or fair information; and</li>\n\t\t\t\t<li>A concise statement of the reasons why you disagree with BWIS\' refusal to correct, amend or delete recorded personal information.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>If you file a statement described above, BWIS will:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>File the statement with the disputed personal information and provide a means by which anyone reviewing the disputed personal information will be made aware of your statement and have access to it;</li>\n\t\t\t\t<li>In any subsequent disclosure we make of the recorded personal information that is the subject of disagreement, clearly identify the matter(s) in dispute and provide your statement along with the recorded personal information being disclosed; and</li>\n\t\t\t\t<li>Furnish the statement to the same persons and in the same manner as described in Section C2 above.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</ol>\n\t</li>\n\t<li><b>If you are a California resident:</b><br />\n\t\t<p>If you are a California resident and you want to learn more about the personal information the Bank and its affiliates collect, how it is used and stored, what rights you have under the California Consumer Privacy Act, or exercise privacy rights you may have, you can do so at <a href="www.BankoftheWest.com/CCPA">www.BankoftheWest.com/CCPA</a>.</p>\n\t</li>\n\t</ol>\n\n\t<p class="title">PREDISPUTE ARBITRATION DISCLOSURE & AGREEMENT</p>\n\t<p><b>THIS AGREEMENT CONTAINS A PREDISPUTE ARBITRATION CLAUSE. BY SIGNING AN ARBITRATION AGREEMENT, THE PARTIES AGREE AS FOLLOWS:</b></p>\n\t<ol class="roman">\n\t\t<li><b>(1) ALL PARTIES TO THIS AGREEMENT ARE GIVING UP THE RIGHT TO SUE EACH OTHER IN COURT, INCLUDING THE RIGHT TO A TRIAL BY JURY, EXCEPT AS PROVIDED BY THE RULES OF THE ARBITRATION FORUM IN WHICH A CLAIM IS FILED.</b></li>\n\t\t<li><b>(2) ARBITRATION AWARDS ARE GENERALLY FINAL AND BINDING; A PARTY’S ABILITY TO HAVE A COURT REVERSE OR MODIFY AN ARBITRATION AWARD IS VERY LIMITED.</b></li>\n\t\t<li><b>(3) THE ABILITY OF THE PARTIES TO OBTAIN DOCUMENTS, WITNESS STATEMENTS AND OTHER DISCOVERY IS GENERALLY MORE LIMITED IN ARBITRATION THAN IN COURT PROCEEDINGS.</b></li>\n\t\t<li><b>(4) THE ARBITRATORS DO NOT HAVE TO EXPLAIN THE REASON(S) FOR THEIR AWARD UNLESS, IN AN ELIGIBLE CASE, A JOINT REQUEST FOR AN EXPLAINED DECISION HAS BEEN SUBMITTED BY ALL PARTIES TO THE PANEL AT LEAST 20 DAYS PRIOR TO THE FIRST SCHEDULED HEARING DATE.</b></li>\n\t\t<li><b>(5) THE PANEL OF ARBITRATORS MAY INCLUDE A MINORITY OF ARBITRATORS WHO WERE OR ARE AFFILIATED WITH THE SECURITIES INDUSTRY.</b></li>\n\t\t<li><b>(6) THE RULES OF SOME ARBITRATION FORUMS MAY IMPOSE TIME LIMITS FOR BRINGING A CLAIM IN ARBITRATION. IN SOME CASES, A CLAIM THAT IS INELIGIBLE FOR ARBITRATION MAY BE BROUGHT IN COURT.</b></li>\n\t\t<li><b>(7) THE RULES OF THE ARBITRATION FORUM IN WHICH THE CLAIM IS FILED, AND ANY AMENDMENTS <br />\n\t\tTHERETO, SHALL BE INCORPORATED INTO THIS AGREEMENT.</b></li>\n\t</ol>\n\t<p><b> NO PERSON SHALL BRING A PUTATIVE OR CERTIFIED CLASS ACTION TO ARBITRATION, NOR SEEK TO ENFORCE ANY PREDISPUTE ARBITRATION AGREEMENT AGAINST ANY PERSON WHO HAS INITIATED IN COURT A PUTATIVE CLASS ACTION; OR WHO IS A MEMBER OF A PUTATIVE CLASS WHO HAS NOT OPTED OUT OF THE CLASS WITH RESPECT TO ANY CLAIMS ENCOMPASSED BY THE PUTATIVE CLASS ACTION UNTIL; (i) THE CLASS CERTIFICATION IS DENIED; OR (ii) THE CLASS IS DECERTIFIED; OR (ii) THE CUSTOMER IS EXCLUDED FROM THE CLASS BY THE COURT. SUCH FORBEARANCE TO ENFORCE AN AGREEMENT TO ARBITRATE WILL NOT CONSITITUTE A WAIVER OF ANY RIGHTS UNDER THIS AGREEMENT EXCEPT TO THE EXTENT STATED THEREIN.</b></p>\n\t<p><b>ARBITRATION AGREEMENT<br />\n\t\tYOU AGREE THAT ANY CONTROVERSY BETWEEN YOU AND BWIS RELATING TO YOUR ACCOUNT, THIS AGREEMENT, ANY OTHER BWIS ACCOUNTS OR AGREEMENTS WITH BWIS, OR YOUR RELATIONSHIP WITH BWIS, INCUDING BUT NOT LIMITED TO ANY ISSUE RELATING TO THE ARBITRABILITY OF A DISPUTE, SHALL BE SUBMITTED TO ARBITRATION BEFORE THE FINANCIAL INDUSTRY REGULATORY AUTHORITY, INC. </b></p>\n</div>')}]),angular.module("DEM/userAgreementText/content.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("DEM/userAgreementText/content.tpl.html",'<style>\n\t.title { \n\t\ttext-align: center;\n\t\tfont-weight: bold;\t\n\t\tbackground-color: #ccc;\n\t\tpadding: 4px 8px;\n\t\t}\n\tul{\n\t\tlist-style: disc;\n\t\tcolor: #000;\n\t}\n\tol {\n\t\tlist-style: decimal;\n\t\tcolor: #000;\n\t}\n\tli {\n\t\tmargin: 0 0 0 32px;\n\t}\n\tol.typeA { list-style: upper-alpha !important; }\n\tol.typei { list-style: lower-roman !important; }\n\tol.typeNone { list-style: none !important; }\n\tol.roman { list-style: lower-roman; }\n\t.roman li { font-weight: bold }\n\tol > li {\n\t\tmargin-bottom: 8px;\n\t}\t\n\tol > li > p { \n\t\tdisplay: inline-block;\n\t\tmargin: 0 0 0 16px;\n\t}\n\t.equal-width {\n\t\tcolor: #000;\n\t\tborder:solid 1px #666;\n\t\twidth: 600px;\n\t}\n\t.equal-width td { \n\t\t\twidth:25%;\n\t\t\tpadding:4px;\n\t\t\tvertical-align: top;\n\t\t\tborder-right: solid 1px #666;\n\t\t\tborder-bottom:solid 1px #666;\n\t}\t\n\t\n\t</style>\n\t\n\t<div class="userAgreementFormat">\n\t<p class="title">NEW ACCOUNT AGREEMENT</p>\n\t\n\t<p>BancWest Investment Services (“BWIS”), is a securities broker-dealer and Investment Adviser, registered with the Securities and Exchange Commission ("SEC"). BWIS is also a member of the Financial Industry Regulatory Authority, Inc. (“FINRA”) and the Securities Investor Protection Corporation (“SIPC”). BWIS is a wholly-owned subsidiary of BMO Harris Bank N.A. Bank of the West is a trade name of BMO Harris Bank, N.A. BWIS utilizes a clearing broker and custodian, currently Pershing LLC, (“Clearing Broker”) to service your account. “BWIS” as used in this Agreement refers to both BWIS and its clearing broker, where applicable. “You,” “your,” or “yours” refers to the individual or entity that is the holder of a BWIS account. This Agreement between you and BWIS (“the Agreement”) contains important terms and conditions that apply to your BWIS account and to the services BWIS provides. Please read this Agreement carefully and retain it for future reference.</p>\n\t\n\t<p><b>GENERAL PROVISIONS, FEES & CHARGES</b></p>\n\t\n\t<p><b>ACCOUNT OPENING</b><br />\n\tYou represent that you are of the age of majority and have the legal right to enter into this Account Agreement. You certify that no one except yourself has an interest in this or any of your BWIS accounts unless such interest is expressly referenced in the account\'s title.</p>\n\t\n\t<p><b>ACCOUNT MINIMUMS</b><br />\n\tYou agree to maintain a minimum balance of $100 in your account. If your account falls below that minimum balance, BWIS reserves the right to liquidate any positions, close the account and send you any proceeds remaining after fees are deducted. A termination fee may be applicable.</p>\n\t\n\t<p><b>IDENTIFICATION INFORMATION AND CREDIT CHECKS</b><br />\n\tTo help the government fight terrorism and money laundering, federal law requires all financial organizations to obtain, verify, and record information that identifies each person who opens or has an ownership interest in an account. When you open an account, BWIS will ask for your name, address, date of birth, and other information that will identify you. BWIS may also ask you to provide a copy of your driver’s license or other identifying documents. You agree that the information you provide to BWIS on your account application or otherwise may be used to verify your identity and to perform credit checks or public records searches using internal sources and/or third-party vendors.</p>\n\t\n\t<p><b>CHECK DEPOSITS</b><br />\n\tIf you mail a check to BWIS\' home office at 13220 California Street, Suite 200, Omaha, NE 68154, your check will be processed or, if rejected, returned by mail by noon the next business day after BWIS receives the check. If information needed to complete the deposit is missing, BWIS may hold the check for up to five business days, during which time BWIS will reach out to you to obtain any additional documentation needed before the deposit can be accepted and credited to your account.</p> \n\t\n\t<p><b>ACCOUNTS WITH MULTIPLE OWNERS</b><br />\n\tIf this is a joint account or tenant in common account, the account(s) shall be held jointly with rights of survivorship (payable in full to the survivor) unless you notify BWIS otherwise and provide the documentation BWIS requires. Each joint tenant irrevocably appoints the other as attorney-in-fact to take all action on his or her behalf and to represent him or her in all respects in connection with this Agreement. BWIS shall be fully protected in acting, but shall not be required to act, upon the instructions of either client. Each client shall be liable, jointly and individually, for any amounts due to BWIS pursuant to this Agreement, whether incurred by either or both of you. We reserve the right in our sole discretion to require a confirming instruction from the other account holder.</p>\n\t\n\t<p><b>ADDRESS</b><br />\n\tBWIS may send communications to you at the current address we have on file for you or by email if you have signed up for e-delivery of communications or request to communicate by email, unless you change that address by providing notice to BWIS in a manner satisfactory to BWIS. You agree to notify BWIS of any changes to your physical, mailing or email address in a timely fashion. All communications sent to your address or email on file, whether by mail, electronically, by facsimile or otherwise, shall be deemed given to you, whether actually received or not.</p>\n\t\n\t<p><b>FEES AND CHARGES</b><br />\n\tIn the normal course of business, there are commissions, fees and other charges that you are obligated to pay in connection with transactions, services or activity in your accounts. You agree to pay the charges set forth in BWIS’ fee schedules as amended from time to time. You agree that BWIS can modify the fee schedules without prior notice. You will receive a copy of the Fee Schedule at account opening. Fee schedules for all account types, including online accounts, are posted on the BWIS website. You may also request a copy of the Fee Schedule by contacting your BWIS representative or by writing to BWIS, Attn: Operations, 13220 California Street, Suite 200, Omaha, NE 68154 or call 1-800-338-3919. BWIS reserves the right to mark-up certain fees charged by Pershing to compensate for internal costs.</p>\n\t\n\t\n\t<p><b>INFORMATION SHARING FOR PREFERRED PRICING </b><br />\n\tAt Bank of the West, we are committed to providing exceptional service to our most valued customers. In order for us to determine your initial eligibility for various pricing schedules that may apply to your account(s) held at BWIS or affiliates, and to monitor your continued eligibility for these pricing schedules, we ask that you consent to the sharing of information related to your accounts at our affiliates, including but not limited to BWIS, Bank of the West, and Bank of the West trust department including your public and non-public personal information and financial information, such as information related to your personal assets, trust assets, investments, liabilities, and balances maintained at the bank, among BWIS, Bank of the West, Bank of the West trust department, and any of our affiliates. You may withdraw this consent at any time by informing your advisor, going to a local branch, or by calling BWIS at 1-800-338-3919, but the lack of information sharing may affect your eligibility for certain preferred pricing options</p>\n\t\n\t<p><b>INDEBTEDNESS AND LIQUIDATION</b><br />\n\tYou agree to pay any fees or charges that apply to your account in a timely manner. You agree that any such fees may be deducted from the available funds in your account and if no funds are available, BWIS may, without prior notice, liquidate investments within your account to make funds available to pay any outstanding amounts owed. In addition, you agree to grant BWIS a security interest in, lien on, and right of set-off against all property, including any funds and securities in any BWIS account you maintain or have an interest in, whether individually or jointly, to satisfy any debit or pay any fee or charge. If BWIS has to bring any legal action to recover a debt from you, BWIS is entitled to recover interest at the contractual interest rate, if applicable, or statutory interest rate, whichever is higher, as well as all costs of collection and reasonable attorneys’ fees.</p>  \n\t\n\t<p><b>FAILURE TO PAY OR DELIVER</b><br />\n\tYou agree to pay for all trade orders you place on or before settlement date whether or not funds are available in your account. You agree that before you sell securities long, you must actually own them and hold them in a BWIS account. Whenever you do not pay in full for any security you purchased in your account, or deliver any security you sold in your account on or before settlement date, BWIS is authorized to liquidate, sell, buy-in, pledge, hypothecate, re-pledge or re-hypothecate, any or all securities which BWIS or Pershing may hold for you (either individually or jointly with others) in the account in which the order was placed or in any other BWIS accounts in which you have an interest, jointly or individually, or to cancel any or all outstanding orders or commitments in these account(s). You agree that BWIS has the right to liquidate securities in your account or any other BWIS accounts in which you have an interest to satisfy any debit balance or pay uncollected fees you owe BWIS and to buy-in any securities required to make delivery.</p>\n\t\n\t<p><b>ORDERS, TRADING, AND INVESTMENTS</b></p>\n\t\n\t<p><b>INVESTMENT RISKS; LOSS OF PRINCIPAL</b><br />\n\tSecurities, insurance products, and annuities are not deposits with or obligations of, and are not guaranteed by, Bank of the West or any of its subsidiaries. Securities, insurance products and annuities are not insured by the Federal Deposit Insurance Corporation (“FDIC”), the Federal Reserve Board, or any other federal or state government agency. Securities are subject to investment risk, including possible loss of the entire principal amount invested.</p>\n\t\n\t<p><b>UNSOLICITED TRANSACTIONS</b><br />\n\tYou are responsible for determining the suitability of any unsolicited security, transaction, or investment strategy. An unsolicited trade is one that is not recommended by BWIS. BWIS has no responsibility for determining the suitability of self-directed trades or for self- directed trading losses.</p>\n\t\n\t<p><b>MARKET HOURS</b><br />\n\tBWIS does not participate in pre-market or after-market trading. Orders placed outside of regular U.S. market hours will be held and entered during market hours on the next day the market is open.</p> \n\t\n\t<p><b>TRANSMITTING ORDERS/INSTRUCTIONS</b><br />\n\tOrders, funds transfers and other financial transactions will only be effected by BWIS if you place them through the appropriate channel. You agree that you will not use email, voicemail, facsimile, or secure messaging to attempt to effect the purchase or sale of securities or other investments, to send funds transfer instructions or for any other financial transactions. Any requests, orders, or instructions that are sent in contravention of the preceding sentence will not be accepted or processed by BWIS. BWIS will not be responsible for any loss or damages resulting from a failure to process requests, orders, or instructions that are not entered through the appropriate channel.</p>\n\t\n\t<p><b>GOOD-TILL-CANCELED ORDERS</b><br />\n\tGood-till-Canceled ("GTC") orders will be automatically canceled only at the close of business on the 60th calendar day after the date the order was entered or on the following Business Day if the 60th day falls on a weekend or holiday. If you do not cancel an open GTC order, the transaction may be completed based on your original instructions anytime until the close of business on the 60th calendar day or the next Business Day if applicable. For securities that pay cash dividends or that have splits, open GTC orders will be adjusted in accordance with stock exchange regulations.</p>\n\t\n\t<p><b>ORDER REVIEW</b><br />\n\tCertain orders may be blocked or subject to pre-review by BWIS or Pershing, which may take up to several minutes to process. You agree that during the time of this review, there may be market movements and that BWIS is not liable for loss or damages related to price movements while an order is reviewed. Additionally, you understand that certain orders may be sent to exchanges and market centers without being reviewed in advance by BWIS. When you place an order online, you voluntarily agree to assume any added risk that may result from the lack of human review of your order by BWIS in exchange for the reduced commissions and potentially greater convenience of electronic trading.</p>  \n\t\n\t<p><b>CANCELLATION OF ORDERS</b><br />\n\tBWIS is authorized, in its discretion, for any reason whatsoever that it deems necessary, to cancel any outstanding orders and/or to close out your account, in whole or in part, without prior notice. All orders are subject to the applicable rules, customs and usages of the exchange or market, and its clearinghouse, on which BWIS or its affiliates transact orders. BWIS has no obligation to honor, and may cancel, in whole or in part, any order or transaction including but not limited to those that (a) exceed the funds available in your account; (b) involve funds subject to a hold, levy, garnishment, court order, dispute or other legal process; (c) would (or BWIS reasonably believes would) violate any law, rule or regulation including but not limited to sanctions laws; or is being used, to facilitate any illegal or improper purpose or activity; (d) is not (or BWIS reasonably believes is not) authorized by the proper party; (e) is not in accordance with any other requirement in this Agreement or any other applicable agreement between you and BWIS; (f) violates the policies, procedures or practices of BWIS or its corporate parents or affiliates, including the purchase or sale of securities on a restricted list; (g) if BWIS has reason to believe that your account has been compromised or mismanaged in any way, such as by unauthorized use of your password or other security features; or (h) for BWIS’ or your own protection; (i) or for any other reason.</p>\n\t\n\t<p><b>FRAUD AND UNAUTHORIZED ACTIVITY</b><br />\n\tYou are required to call us immediately to notify us if you believe there has been any unauthorized activity in your accounts or if you suspect that any of your BWIS accounts, your passwords or security features, your personal identifying information or your accounts at other financial institutions have been subject to fraud, attempted fraud, or compromised in any way. If you fail to promptly notify of us of such instances, we will not be liable for any associated losses</p>\n\t\n\t<p><b>CONFIRMATIONS AND STATEMENTS</b><br />\n\tYou agree to review trade confirmations, account statements, and other documents relating to your account in a timely manner and to immediately identify and report discrepancies to BWIS. You understand and agree that losses could be exacerbated by any delay in notifying BWIS of any errors, omissions or unauthorized transactions in confirmations, in reports or statements, and you agree you will be responsible for any losses resulting from your failure to immediately notify BWIS of any error.</p>\n\t\n\t<p><b>EXTRAORDINARY EVENTS</b><br />\n\tBWIS shall not be responsible for and you agree not to hold us liable for losses or delays caused directly or indirectly by conditions beyond our control, including but not limited to wars or civil disturbances, natural disasters, weather conditions, terrorism, denial of service attacks, government restrictions, exchange or market rulings, trading suspensions, computer or, internet failures, labor disputes, news or analysts’ reports, or disruptions in orderly trading on any exchange or market. Computer and communications failures include, but are not limited to: (a) the failure of electronic or mechanical equipment or telephone, cable, modem or other communication lines; (b) bugs, errors, configuration problems or the incompatibility of computer hardware or software; (c) the failure or unavailability of internet access; or (d) problems with data transmission facilities or your telephone, cable or wireless service. BWIS is not responsible for any damage to your computer, software, modem, telephone, wireless device or other property resulting in any way from your use of BWIS’ online services.</p>\n\t\n\t<p><b>MARGIN TRADING </b><br />\n\tIf you use or trade on margin, you agree to be bound by the terms of BWIS’ Margin Disclosure document, which is provided to you when you sign up for margin. Securities purchased on margin are the firm’s collateral for the margin loan to you. If the securities in your account decline in value, so does the value of the collateral supporting your loan, and, as a result BWIS or its clearing broker Pershing can take action, including issuing a margin call and/or selling securities or other assets in your account or any other accounts you hold with BWIS, whether individually or jointly, in order to maintain the equity BWIS requires in the account, in its sole discretion.<br /><br />\n\tBefore deciding to trade on margin, it is important that you fully understand the risks of trading on margin, which include the following:<br /></p> \n\t<ul>\n\t<li>You may lose more funds or securities than you deposited in your margin account.</li>\n\t<li>BWIS or Pershing may force the sale of securities or other assets in your account (s).</li>\n\t<li>BWIS or Pershing may sell the securities or assets in your account without prior notice and without contacting, or trying to contact, you.</li>\n\t<li>BWIS or Pershing has complete discretion to decide which securities or other assets in your account are to be liquidated or sold to meet a margin call.</li>\n\t<li>BWIS or Pershing can set its house margin maintenance requirements in their sole discretion and can increase those maintenance requirements at any time without prior notice to you.</li>\n\t<li>You are not entitled to an extension of time to meet a margin call and may not rely on one if granted.</li>\n\t<li>You may end up owing BWIS additional monies after your account is liquidated.</li>\n\t</ul>\n\t\n\t<p><b>OPTIONS TRADING</b><br />\n\tIf you trade options, you agree to be bound by the terms of BWIS’ Options Trading Disclosure document, which is provided to you along with this Agreement. The full terms of the Option Trading Disclosure document are incorporated by reference into this Agreement.</p> \n\t\n\t<p><b>ORDER EXECUTION </b><br />\n\tMarket orders are subject to execution at the prevailing market price at time of execution with no guarantee such orders will be executed at the price quoted at the time of order entry. Prices can change quickly, especially in volatile market conditions, which may result in an execution price different from the quote you received at order entry. Telecommunication and technology limitations may result in delays in placing orders, getting quotes, or other information. Even in the best of market conditions, there is no assurance that you will get the quoted price and agree not to hold BWIS liable for such fluctuations. The price quotes you receive when placing an order apply only to orders for a small number of shares. You acknowledge that the price you will pay or receive may vary substantially if your order is larger than the number of shares to which a price quote applies. Large market orders may be executed in multiple lots at different prices. If you enter a large marketable order at or near the market close or at or near a trading halt, you acknowledge that BWIS may not be able to fill all or part of that order prior to the market close and you agree that BWIS is not responsible for any alleged market losses associated with that order. You may limit the risk of price fluctuations by placing a limit order. However, if you place a limit order, you are less likely to get an execution. BWIS can provide no assurance that your limit order will be executed at any particular time, or at all. If you do not understand the purpose or effect of either market or limit orders, you agree to contact your advisor or the BWIS Service Center at 1- 800-338-3919 for more information.</p> \n\t\n\t<p><b>DAY TRADING</b><br />\n\tBWIS does not promote directly or indirectly what is commonly referred to as Day-Trading. BWIS’ services that provide the means to place trades electronically should not be construed as an endorsement or promotion of Day-Trading. Day-Trading can be very risky and is not appropriate for customers with limited resources or trading experience, a short time horizon, or a low risk tolerance. We reserve the right to prohibit you from engaging in Day-Trading.</p>\n\t\n\t<p><b>FREE RIDING</b><br />\n\tRegulation T (“Reg T”) is a Federal Reserve Board regulation that governs the amount of credit brokerage firms can extend to customers for the purchase of securities. Profits derived from transactions in your account that are placed in violation of the cash account provisions of Reg T will be forfeited to BWIS, to the extent permitted by applicable law. Losses on transactions that violate the cash account provisions of Reg T will remain your responsibility.</p>\n\t\n\t<p><b>ORDER ROUTING DISCLOSURE</b><br />\n\tBWIS handles orders so as to obtain a competitive execution price in line with the firm’s regulatory obligations. Execution price, speed, liquidity and account access are affected by many factors, including but not limited to size, order type, available market centers, and market volatility. Brokerage orders are routed through Pershing, and Pershing’s electronic order-processing system channels Client orders to an appropriate market center given the characteristics of the order, market data and trading statistics. In deciding where to send an order, Pershing looks at a number of factors, such as size of order, trading characteristics of the security, favorable execution prices (including the opportunity for price improvement), access to reliable market data, availability of efficient automated transaction processing, and execution cost. Some market centers may execute orders at prices superior to the publicly quoted market. When securities may be traded in more than one marketplace, Pershing may use its discretion in selecting the market in which to place your order.<br /><br />\n\tBWIS does not receive payment for order flow from other broker-dealers, any U.S. exchange or NASDAQ for routing your orders in securities quoted on U.S. exchanges or NASDAQ trading systems.<br /><br />\n\tThe SEC has also adopted a rule requiring all brokerage firms to make publicly available quarterly reports on their order routing practices. In accordance with these rules, BWIS\' execution reports and order routing statistics are available for public review by visiting <a href="https://www.orderroutingdisclosure.com" target="new">https://www.orderroutingdisclosure.com</a> and entering “BancWest Investment Services Inc.” as the search term. Upon written request to BWIS, you may obtain the identity of the venue to which your orders were routed and the time of the transactions that may have resulted from such orders for the six months prior to your request.</p>\n\t\n\t<p><b>MUTUAL FUNDS</b><br />\n\tYou agree that, in purchasing and redeeming shares of a mutual fund through BWIS, BWIS\' policies and procedures will govern such transactions rather than those of the mutual fund as described in its prospectus, which may be either more or less beneficial to you as an investor. You agree that BWIS\' policies and procedures on items such as minimum investment requirements, exchange of fund shares, dividend accrual and date for payment of accrued dividends may vary from those applicable to direct fund shareholders. You acknowledge that in certain instances you may be charged different or additional fees such as a redemption fee or transaction fee surcharge that would not be imposed by the fund on direct shareholders.</p> \n\t\n\t<p><b>ANNUITIES/INSURANCE</b><br />\n\tBWIS makes available to its client’s insurance products (fixed and variable annuities, life, disability, and long term care insurance) underwritten and issued by participating insurance companies. Any obligations under these contracts or policies are the exclusive obligations of the insurance companies and are subject to the financial conditions of the insurance companies. Bank of the West, its affiliates, and subsidiaries are separate from and unaffiliated with the participating insurance companies. Securities and variable annuities are offered through BWIS, a registered broker/dealer, member of FINRA/SIPC, and SEC Registered Investment Adviser. Financial Advisors are Registered Representatives of BancWest Investment Services. Fixed annuities/insurance products are offered through BancWest Insurance Agency in California*,(License #0C52321), and through BancWest Investment Services, Inc. in all other states where it is licensed to conduct insurance business.</p> \n\t\n\t<p>*BancWest Insurance Agency is a trade name used by BancWest Investment Services, Inc., a subsidiary of BMO Harris Bank N.A.</p>\n\t\n\t<p><b>NON-PUBLICLY TRADED SECURITIES</b><br /> \n\tBWIS may, at its discretion, agree to accommodate requests from clients to hold certain securities, such as hedge funds, private equity funds, private placements, and other securities that do not trade on securities exchanges or over-the-counter markets (“Non-Publicly Traded Securities”). In consideration for BWIS accepting these Non-Publicly Traded Securities into your account, you agree that BWIS\' sole obligation with respect to such Non-Publicly Traded Securities will be to (1) obtain and maintain possession or control of such securities in a manner as required by the SEC and (2) file and provide reports and information as required under the Internal Revenue Code, the regulations thereunder of the Internal Revenue Service. Additional terms and conditions will be presented to you at the time of any such request.</p> \n\t\n\t<p><b>LIMITATIONS ON SECURITIES AVAILABLE</b><br />\n\tBWIS reserves the right to limit the securities it makes available. Securities traded in over-the-counter bulletin boards and pink sheet securities and other thinly-traded securities present particular trading risks in that they are often more volatile and generally less liquid than securities traded on exchanges. We reserve the right to place restrictions on the trading of securities, including securities on various restricted lists, without advance notice, including requiring that trades in such securities be conducted through the BWIS Service Center rather than online.BWIS reserves the right to limit the securities it makes available. Securities traded in over-the-counter bulletin boards and pink sheet securities and other thinly-traded securities present particular trading risks in that they are often more volatile and generally less liquid than securities traded on exchanges. We reserve the right to place restrictions on the trading of securities, including securities on various restricted lists, without advance notice, including requiring that trades in such securities be conducted through the BWIS Service Center rather than online.</p> \n\t\n\t<p><b>ONLINE INVESTING; FINANCIAL INFORMATION; MARKET DATA</b><br />\n\t\n\t<p><b>ONLINE INVESTING </b><br />\n\tSelf-directed investing in your account online through BWIS’ Online Investing Service allows you to enter orders to buy and sell U.S. market traded equities, including exchange-listed and widely-held over-the-counter stocks, a wide selection of mutual funds, and certain fixed income securities and certificates of deposit through a self-directed account through its Online Investing Service. BWIS has no obligation to offer or continue to offer any particular products through the Online Investing Service. Certain products that BWIS offers other customers may not be available for online self-directed investing. Not all accounts are eligible for online self-directed investing. Online customers will agree to a separate set of terms and conditions in order to gain access to online trading features. Access to the Online Investing Service may be limited or unavailable during periods of peak demand, market volatility, systems upgrades or maintenance, or for other reasons. If the Online Investing Service is unavailable or delayed at any time call the BWIS Service Center at 1-800-338-3919 to place an order. BWIS will not be liable to you if you are unable to access your Self-Directed Account or place an order through the Online Investing Service. Self-directed orders placed through the Online Investing Service are subject to fees and charges that may be different from those related to Full Service Accounts. Please refer to the fee schedule for further information.</p> \n\t\n\t<p><b>ONLINE ACCESS IN FULL-SERVICE ACCOUNTS</b><br />\n\tBWIS provides online access to your Full Service Account. Through BWIS’ Online Investing Service you may access your account balances, holdings, and statements online. If you wish to engage in self-directed online investing, you will need to open a Self-Directed Account. BWIS reserves the right to require additional information or documentation to activate online trading in a Full Service Account and will make the trading functions available only upon customer request. You agree and understand that any online trades within your Full Service Account are unsolicited trades. Accordingly, any order you place online in a full-service account, whether based on information obtained from BWIS or otherwise, represents your own self-directed trading decision and does not constitute investment advice or a recommendation by BWIS and BWIS has no responsibility for determining the suitability of any online trades you place.</p> \n\t\n\t<p><b>RESEARCH AND FINANCIAL INFORMATION</b><br />\n\tBWIS may make available certain research reports, financial market data, quotes, news, research and other financial information (collectively, "Financial Information") through its online investing service or otherwise that may be prepared by BWIS or one of its affiliates, or by various third-party investment bankers or other entities providing analysis, research and opinions ("Financial Information Providers"). BWIS does not endorse or approve Financial Information Providers and only makes such Financial Information available to you as a service and convenience. The Financial Information has been prepared as of the date indicated and may become unreliable for various reasons including, for example, changes in market or economic circumstances. BWIS and each Financial Information Provider are not obligated to update any information or opinions contained in any Financial Information or to continue to offer Financial Information regarding any company or security.</p> \n\t\n\t<p><b>NO WARRANTY; LIMITATIONS ON LIABILITY</b><br />\n\tBWIS and the Financial Information Providers and transmitters do not (1) guarantee the accuracy, timeliness, completeness or correct sequencing of the Financial Information, or (2) warrant any results from your use of the Financial Information. BWIS will not be liable for any decision or action you take in reliance on the Financial Information. You further agree that none of BWIS, the Financial Information Providers and the Financial Information Transmitters will be liable in any way for the interruption of any data, Financial Information or other aspect of the Online Investing Service. You agree that none of the Financial Information constitutes investment advice or a recommendation or solicitation that you should purchase or sell any particular security or a representation that any securities are suitable for you.</p> \n\t\n\t<p><b>TAX ISSUES</b></p> \n\t\n\t<p><b>TAX LOT DISPOSITION</b><br />\n\tYou agree that for tax reporting purposes, BWIS will use the First In, First Out (“FIFO”) method to determine your cost basis for securities purchased and sold unless you expressly designate otherwise at the time you open your account or in writing thereafter.</p> \n\t\n\t<p><b>BACK-UP TAX WITHHOLDING</b><br />\n\tIf you do not provide us with accurate and complete tax-reporting information, including a properly-executed W-8 BEN form if applicable, you will be subject to back-up tax withholding and agree not to hold BWIS liable. You acknowledge that you are responsible for paying all federal and, if applicable, state and local taxes and that you may incur penalties if your withholding and estimated tax payments are insufficient.</p> \n\t\n\t<p><b>NO LEGAL OR TAX ADVICE</b><br />\n\tYou understand that BWIS does not give legal or tax advice and that you should not rely on any general tax or estate planning information provided. You agree that these principles may not apply to Client’s specific circumstances or take into account your comprehensive tax or estate planning situation and should consult your own tax or legal adviser. The IRS imposes maximum allowable contributions within each tax year for IRAs and qualified plans. It is your sole responsibility to seek professional tax advice to determine the maximum allowable contribution for IRA and qualified accounts.</p> \n\t\n\t<p><b>ELECTRONIC DELIVERY AND SIGNATURE</b></p> \n\t\n\t<p><b>ELECTRONIC DELIVERY</b><br />\n\tYou will be asked to consent to electronic delivery at account opening. If you consent to electronic delivery (“e-delivery”) at or after account opening, you are agreeing to the electronic delivery of communications relating to your account, including but not limited to trade confirmations, account statements proxies, shareholder reports, tax information, privacy notices and regulatory notices ("Account Communications"). You agree to abide by the terms and conditions of electronic delivery of Account Communications as they may be amended from time to time. Account Communications are deemed provided to you when BWIS emails them, or a link to them, to the email address on file for your account or notifies you via email that they are posted them on a secure password-protected website, regardless of whether you actually access or view a particular document. You agree that the provision of an electronic version of a document or a link thereto fully satisfies any requirement that it be provided to you in writing. You affirm that you have functioning internet access and a valid e-mail address on record with BWIS and that you have installed adequate software, such as a current version of Adobe Acrobat Reader or a similar product, that enables you to view Account Communications. You will be notified by e-mail when Account Communications are available to be viewed online. E-mail notification(s) will be sent to the e-mail address you provided to BWIS at account opening and which you are solely responsible for updating as needed. There is no charge from BWIS for electronic delivery; however, online access and usage charges by your internet service or access provider may apply. BWIS will not send you a paper copy of electronic Account Communications, unless you request it. You can obtain a paper copy of any Account Communication we provide to you electronically by printing it yourself or by requesting that we mail you a paper copy by contacting BWIS at the number below. You understand that you be charged if you request paper copies of one or more documents. Electronic delivery will remain in effect unless and until you contact BWIS to withdraw your consent and change your delivery preferences or if your e-mail address becomes invalid. To change your delivery option at a later date, such as resuming paper Account Communications, you must call us at 1-800-338-3919 or send written notice to BWIS, Attn: Operations, 13220 California Street, Suite 200, Omaha, NE 68154. We reserve the right, in our sole discretion, to provide you with any Account Communications on paper, even if you have authorized electronic delivery.</p>   \n\t\n\t<p><b>ELECTRONIC RECORDS & SIGNATURES</b><br />\n\tThis Agreement may be in the form of an Electronic Record and may, if BWIS and you have expressly agreed to accept Electronic Signatures, be executed using Electronic Signatures (including manually-executed paper documents that are sent by facsimile, pdf, or other electronic means), which shall be considered an original and shall have the same legal effect, validity and enforceability as an original paper record. For purposes hereof, each of the terms “Electronic Record” and “Electronic Signature” has the respective meaning assigned to it in 15 USC §7006 (as the same may be amended from time to time). <br />\n\tYou agree to be bound by any consent, affirmance, representation, or agreement you sign electronically by computer or mobile device, including but not limited to any consent given to receive communications from BWIS solely through electronic means. You agree that when clicking on an "I agree," "I consent" or another similarly worded "button" or entry field, or signing a document digitally online, your electronic agreement or consent will be as legally binding and enforceable as your handwritten signature If you sign electronically, you represent that you have a current and valid e-mail address on file; you have the ability to access and retain an electronic copy of the documents and have access to a printer to print the information or the ability to download the information. You agree that you will carefully review any document or web page before entering or affixing an electronic signature and acknowledge that you are obliged to review the BWIS website periodically for changes or modifications.</p> \n\t\n\t<p><b>MISCELLANEOUS</b></p>\n\t\n\t<p><b>RECORDING CONVERSATIONS</b><br />\n\tYou understand and agree that BWIS may, but is not obligated to, electronically record any telephone conversations between you and BWIS to verify transactions, monitor the quality of the service provided, or for other business reasons. You acknowledge that we may not be able to locate a tape recording unless you can provide sufficient information to identify the call which may include the date and time of the conversation and the phone number from which the call was placed. You further agree that BWIS has the sole right to determine how long tape recordings will be retained.</p>\n\t\n\t<p><b>CORPORATE ACTIONS</b><br />\n\tYou agree that you are responsible for knowing the rights and terms of all securities in your account and that you are responsible for making election decisions in corporate actions. BWIS is not obligated to notify you of any upcoming expiration or redemption dates or to take any other action on your behalf without specific instructions from you.</p>\n\t\n\t<p><b>BENEFICIARY DESIGNATION</b><br />\n\tChanges in the relationship between the account owner and the designated beneficiary (such as marriage. divorce, and adoption) will not automatically change or revoke beneficiary designations. To change a beneficiary, you must complete a new beneficiary designation form and it must be accepted and processed by BWIS before the change becomes effective.</p>\n\t\n\t<p><b>COMPLIANCE WITH LAWS/SANCTIONS</b><br />\n\tYou agree to comply with all applicable laws and regulations, including those relating to sanctions (“Sanctions”), anti-bribery, anti- money laundering, the fight against terrorism enacted or enforced by the United States of America, the European Union, the French Republic, or other relevant authority. You represent that you are not the target of Sanctions or owned or controlled by a person or entity that is the target of Sanctions (“Sanctions Target”), and that you do not appear on any sanctions list, including the United States Office of Foreign Assets Control’s (“OFAC”) list of Specially Designated Nationals (“SDN”), the European Union Consolidated List, and the French Republic sanctions lists. You agree not to use your account or related services to engage in any activity or transaction that is illegal or involves a Sanctions Target or sanctioned country or territory. You agree that the Bank may delay or refuse to process transactions and/or restrict or freeze part or all of your account if you directly or indirectly engage, or attempt to engage in, any transaction prohibited by Sanctions. You agree to notify the Bank immediately if you become a Sanctions Target, a citizen, temporary or permanent resident of, or incorporated under the laws of a sanctioned country or territory. You agree to hold the Bank harmless from liability for any actions taken by the Bank to comply with applicable laws and regulations, including Sanctions.</p>\n\t\n\t<p><b>SIPC PROTECTION</b><br />\n\tThe Securities Investor Protection Corporation provides protection that covers the loss of securities in your account up to a total value of $500,000 (including up to $250,000 for claims of cash) but only if that loss is the result of Pershing\'s financial failure or bankruptcy.  SIPC does not cover losses due to market fluctuations. Further information on SIPC coverage may be obtained at <a href="www.sipc.org" target="new">www.sipc.org</a> or by calling (202) 371-8300.  Pershing may maintain excess coverage beyond SIPC which is available under certain circumstances.  See Pershing\'s website at <a href="https://www.pershing.com/about/strength-and-stability" target="new">https://www.pershing.com/about/strength-and-stability</a>.</p>\n\t\n\t<p><b>DETERMINATION OF INCAPACITY AND CAPACITY </b><br />\n\tBWIS is entitled to rely on one or more of the following methods of notification of the incapacity of one or more of you: (1) a certification of a licensed physician or a judicial determination that you are unable to manage your financial affairs by reason of mental or physical incapacity, or (2) the appointment of a guardian, conservator, or personal representative of your estate or person. BWIS has no duty to investigate, confirm or inquire regarding your capacity, and is not liable for any action or inaction taken at your direction prior to actual notice of your incapacity. BWIS is entitled to rely upon a certification of a licensed physician or a judicial determination that you are able to manage your financial affairs or a judicial determination that restores your authority to manage your account.</p>\n\t\n\t<p><b>TRUSTED CONTACT</b><br />\n\tYou may provide us with the name of a Trusted Contact Person ("TCP"). A TCP is someone you tell us we can contact if we suspect you may be subject to financial exploitation or we have questions about your mental or physical well-being. Designating one or more TCPs is solely your decision and is optional. However, by electing a TCP, you understand that you have authorized BWIS to contact the TCP at our discretion and to disclose information about your account to help us address the situations noted above. This includes disclosing information about your account to address possible financial exploitation, confirming the specifics of your current contact information, your mental and physical health status, and/or the identity of any legal guardian, executor, trustee, or power of attorney on your account(s), or as otherwise permitted by industry regulations or state law</p>\n\t\n\t<p><b>ACH TRANSFERS</b><br />\n\tBWIS may in its sole discretion impose dollar limits or other conditions or restrictions on incoming or outgoing ACH transfers. BWIS is under no obligation to inform you if it does not complete a transfer because there are insufficient funds in your account to process the transfer. In that case, you are responsible for making alternate arrangements or rescheduling the transfer. Under no circumstance will BWIS be liable to you for damages, including any consequential damages, as the result of a failure to process or a delay in processing an ACH transfer requested by you. In the event that BWIS, at any time, incurs a problem with your use of an ACH transfer, including without limitation, the recall or reversal of a transfer of funds into your BWIS account or the inability to collect funds with respect to any transfer to or from an account at another financial institution, and without limiting any other right or remedy that we may have under this Agreement or otherwise, BWIS reserves the right to immediately suspend your ability to make transfers without prior notice to you and to take legal action against you. You agree that if BWIS suffers any losses as a result of the recall or reversal of an ACH transfer into or out of your BWIS account, whether by you or by a financial institution, you are liable to BWIS for the full amount of all losses, plus interest at the statutory rate, attorneys’ fees, and punitive damages if your conduct was willful.</p>\n\t\n\t<p><b>UNCLAIMED PROPERTY</b><br />\n\tUnclaimed property law requires us to turn over to the state of your last known address (as shown in our records) personal property including assets in your BWIS account which is unclaimed by its owner for a set period of time. Before we turn over the assets in your account (if any), Pershing will, as required by law, send a notice to the address currently shown on your account statement. You agree not to hold BWIS or Pershing liable for turning over unclaimed property in compliance with laws and regulations. You may recover unclaimed property turned over to a state by contacting that state.</p>\n\t\n\t<p><b>WORTHLESS SECURITIES</b><br />\n\tYou agree that BWIS may remove a worthless security from your account including, without limitation, if Pershing or the Depository Trust Company has deemed the security worthless and eligible for removal. You agree to waive any claims against BWIS in connection with the removal of the security, including claims from any further distributions from the security. If you provide BWIS with evidence of the value of the security from an independent third party within 60 days of receiving your account statement noting the removal, we agree to review, and if able to, reinstate your position.</p>\n\t\n\t<p><b>SUCCESSORS</b><br />\n\t\tThis Agreement and its provisions shall be continuous, and shall be binding upon you and your estate, executors, administrators, and assigns and shall inure to the benefit of BWIS, its parent organizations, and any successor organization or assigns. If there is a change in clearing broker, this Agreement shall remain in full force and effect and references to Pershing in the Agreement shall be deemed to apply to the successor clearing broker.</p>\n\t\n\t<p><b>AMENDMENTS</b><br />\n\tBWIS reserves the right to unilaterally amend, add to, delete or modify these Terms and Conditions with or without written notice, in accordance with law and regulation. The current version of the Agreement will be posted on the BWIS website and your continued account activity after such amendment constitutes your agreement to be bound by all changes to the Agreement, regardless of whether you actually have reviewed them.</p>\n\t\n\t<p><b>SEVERABILITY</b><br />\n\tIf any provision of this Agreement is held to be illegal, invalid or unenforceable, the other provisions of this Agreement shall remain in full force and effect.</p>\n\t\n\t<p><b>TERMINATION</b><br />\n\tYou may close your BWIS account at any time by giving BWIS notice in writing or another form acceptable to BWIS. BWIS may, in its sole discretion, close your account or terminate any or all services rendered under this Agreement without notice at any time and for any reason. If we decide to terminate your account and you fail to transfer it to another broker within 30 days, we may liquidate the account and send you the proceeds. A termination fee will be applicable and BWIS can liquidate securities or withhold cash to pay the termination fee prior to any transfer or withdrawal of funds or securities. If you request a transaction that would cause your account balance to fall below the amount of the termination fee, BWIS reserves the right to withhold the amount of the termination fee and close your account.</p>\n\t\n\t<p><b>GOVERNING LAW, VENUE AND JURISDICTION</b><br />\n\tThis Agreement shall be governed by the laws of California, but not its conflicts of laws provisions. You hereby consent to the jurisdiction and venue of the courts of the State of California. </p>\n\t\n\t<p class="title">QUESTIONS AND COMPLAINTS</p>\n\t\n\t<p><b>CONTACTING US ABOUT ERRORS AND QUESTIONS</b><br />\n\tIn case of errors or questions about the transactions recorded on your statements, you should, as soon as possible, notify us via one of the following:</p>\n\t<ul>\n\t<li>Telephone us at 1-800-338-3919, during customer service hours; </li>\n\t<li>Contact your BWIS Financial Advisor<br /></li>\n\t<li>Write us at:<br />\n\t\t\t<blockquote>\n\t\t\tBWIS, Attn: Operations<br />\n\t\t\t13220 California Street, Suite 200<br />\n\t\t\tOmaha, NE 68154 </blockquote>\n\t</li></ul>\n\t\n\t<p><b>If you think your statement or transaction record is incorrect or you need additional information about a service transaction, we must hear from you no later than two (2) days after a confirmation or ten (10) days after the FIRST account statement on which the problem or error appeared.</b><br /><br />\n\t \n\tYou must provide BWIS with the following information:</p>\n\t<ul>\n\t<li>Your name and account number;</li>\n\t<li>A description of the error or transaction in question and an explanation of why you believe it is in error or why additional information is being requested; and</li>\n\t<li>The date and dollar amount of the suspected error. </li>\n\t</ul>\n\t\n\t<p><b>COMPLAINTS</b><br />\n\tComplaints should be sent to: BWIS, Attn: Compliance, 13220 California Street, Omaha, NE 68154 or you may call 1-800-338-3919. If you inform BWIS of a complaint verbally, we may require you to send your complaint in writing or via email within 10 business days. If you make a complaint, BWIS will conduct an investigation and endeavor to send you a written explanation of our decision upon completion of our investigation.</p>\n\t\n\t<p class="title">CASH SWEEP TERMS AND CONDITIONS</p>\n\t\n\t<p><b>SWEEP OFFERINGS</b></p>\n\t \n\t<p>BWIS is pleased to offer the Bank of the West Insured Cash Reserves (“BWIC”) as the default option for the automatic investment of the un-invested cash balances in your account and transfer of those available cash balances from your brokerage account into a deposit account at the Bank on a daily basis (“Cash Sweep”). You agree that BWIS can designate the BWIC as your default Cash Sweep option. BWIS reserves the right to change the Cash Sweep option on your account as well as the eligibility requirements for any sweep option, in its sole discretion. If the sweep option that you have selected or been defaulted into is discontinued or if you become ineligible for the sweep option you selected, you direct BWIS to elect another sweep option on your behalf from among those for which are eligible, with prior notification to you. If you do not want a Cash Sweep on your account, and instead prefer to hold that cash as a free credit balance, in which case you will earn no income on the un-invested cash in your account, you must affirmatively notify BWIS at 800- 338-3919.</p>\n\t\n\t<p>By opening a BWIS account and using either BWIC or BICA, (collectively "sweep options"), you agree to appoint Pershing as your authorized agent to establish and maintain deposit accounts at the Bank and to effect deposits and withdrawals from the Bank pursuant to the terms and conditions set forth in the Terms and Conditions in this Agreement ("Cash Sweep"). Balances in BWIC and BICA are eligible for Federal Deposit Insurance Corporation ("FDIC") insurance subject to the terms and limitations of the FDIC. The standard insurance amount is $250,000 per depositor, per insured bank, for each account ownership category. For further information on FDIC insurance, please refer to the FDIC website at <a href="https://www.fdic.gov" target="new">www.fdic.gov</a> or call 1-877-275-3342.</p>\n\t\n\t<p><u><b>Terms and Conditions</b></u>: This portion of our cash sweep disclosure communication contains a summary of certain features of the Cash Sweep. It is prepared for your convenience, and it must be read in conjunction with the more detailed disclosure below. These Terms and Conditions are supplemental to your existing Account Agreement(s) which you executed to open and maintain your brokerage account with Pershing through BWIS.</p>\n\t\n\t<p><u><b>A Summary of the Program</b></u>: Pershing operates the Cash Sweep at the request of BWIS, which sweep the un-invested cash balance in your brokerage account carried at Pershing to an interest-bearing bank deposit account at the Bank and also sweeps your cash from the Bank to cover purchases of securities and other debits in your brokerage account carried at Pershing. Provided there is a positive yield, you will receive interest on your balances in the Cash Sweep. Pershing earns fees based on the total amount of deposit balances in the Cash Sweep, including your balance.</p>  \n\t\n\t<p><u><b>Conflicts of Interest</b></u>: BWIS and the Bank have profit-sharing arrangements by which BWIS receives compensation related to the Bank’s earnings on deposits in the Cash Sweep. Depending on the rates in effect at the time, the compensation BWIS and the Bank receive may be higher than the interest paid to you. As a result of this compensation, BWIS has a conflict of interest in limiting the sweep options available to you to BWIC, BICA or other affiliated Bank products. And, as discussed below, BWIS has discretion in setting the interest rates for BWIC and BWIS, this creates a conflict of interest. By comparison, a money market mutual fund has a fiduciary duty to seek the highest return available consistent with its fundamental investment policies. BWIS uses BWIC and BICA deposits to fund loans it makes to clients, and BWIS earns substantial revenues from the “spread” between its cost of deposits and the interest rates it earns on loans (net of credit losses). BWIC and BICA are intended for short-term cash holdings awaiting investment, not as a long-term investment vehicle. If you desire to maintain a large cash position in your account for other than a short period of time, you should contact your BWIS representative to discuss your options. Pershing also earns fees based on the total amount of deposit balances in the Cash Sweep, including your balance. In certain interest-rate environments, BWIC and BICA pay a lower interest rate than money market mutual funds and other cash, or cash alternative investment, vehicles. BWIS offers a variety of other products including money market mutual funds and bond funds that can be purchased through BWIS on a position-traded basis (in other words, by placing an order to buy a specific number of shares of that investment), just not on an automated sweep basis. The Bank does not have a duty to offer the highest rates available or rates that are comparable to Money Funds or those offered by other depository institutions.</p>  \n\t\n\t<p><u><b>FDIC Insurance</b></u>: Pershing has established standing instructions with the Bank to ensure that Pershing maintains control over your balance in BWIC and BICA at all times. FDIC Insurance protects your balance in BWIC and BICA in the event of the failure of the Bank, up to allowable limits as determined by the FDIC. However, any money held at the Bank outside of the Cash Sweep account will impact the insurance coverage available on your BWIC or BICA balance. Neither Pershing, nor BWIS, takes any responsibility for monitoring the money you hold at the Bank outside of the Cash Sweep account to determine if you are over the $250,000 per depositor insurance limit. You are solely responsible for monitoring your total deposits at the Bank, including the amount held in the BWIC or BICA Cash Sweep, as they relate to FDIC Insurance.</p>\n\t\n\t<p><u><b>Securities Investor Protection Corporation ("SIPC")</b></u>: SIPC protects customer assets up to $500,000 (of which not more than $250,000 may be in cash) held at broker-dealers, such as Pershing, in the event of the failure of the broker-dealer. However, assets covered under FDIC Insurance (see above) are exempted from SIPC coverage. While your cash is at Pershing awaiting the sweep to BWIS, or is at Pershing coming out of BWIS when you withdraw it or use it for a securities transaction, it is subject to SIPC protection. But SIPC protection is not available for deposits in the Cash Sweep account while they are held at BWIS. SIPC protection is different from FDIC insurance – for more information, see <a href="https://www.sipc.org/for-investors/what-sipc-protects" target="new">https://www.sipc.org/for-investors/what-sipc-protects</a>.</p>\n\t\n\t<p><u><b>Access to Funds</b></u>: You may access your Cash Sweep account balance through your brokerage account by contacting your BWIS registered representative. In the event your BWIS registered representative is unavailable, you may access your funds by contacting BWIS at 800- 338-3919. In the event BWIS cannot assist with the matter, you may access your funds by contacting Pershing at 1- 201-413-3333. All withdrawals are subject to the Bank’s reserved right to require 7 days’ advance notice of withdrawal. Your brokerage account statement will identify the Bank as the deposit bank and your Sweep Account month end balance.</p>\n\t\n\t<p><u><b>Determination of Interest Rates</b></u>: The Bank in its sole discretion determines the interest rate paid on the Cash Sweep. Interest rates may fluctuate and are based on the current level of short term interest rates at the time, as set from time to time by the Bank. Because BWIS has a financial incentive to pay a lower interest rate and BWIS earns money on the “spread” between the interest it pays on deposits and the interest it earns on loans, this creates a conflict of interest. The current interest rates, as well as other money market rates, are available from a BWIS registered representative and on BWIS’ website.</p>\n\t\n\t<p><u><b>Risks of the Program</b></u>: You may receive a lower rate of return on balances in the Cash Sweep account than on other types of investments, such as money market mutual funds. Please contact your BWIS registered representative for information regarding such alternatives. The Bank is permitted to impose a seven-day delay on any withdrawal request. In the event of a failure of the Bank, there may be a time period during which you may not be able to access your money. If you have cash at the Bank outside the sweep options, this may negatively impact the availability of FDIC Insurance for the total amount of your funds held within and outside the Cash Sweep balance at the Bank. If your balance in the Cash Sweep account exceeds $250,000, the balance in excess of this amount will not be insured by the FDIC.</p>\n\t \n\t<p><u><b>Account Eligibility</b></u>: The Cash Sweep is available to the following types of accounts: individual, joint, IRAs, certain business entities, including corporations, and certain fiduciary and trusts provided the beneficiaries are individuals or otherwise eligible to maintain an interest-bearing account. All eligible account types will receive the BWIC option. The Bank of the West Insured Cash Reserves Advantage (“BICA”) may also be used as a cash sweep option for those accounts that meet the following eligibility requirements: the account must have been opened prior to April 1, 2020; must have had a cash balance of $100,000 or more at the time of account opening; and must maintain a cash balance of $100,000 or more. BWIS reserves the right to modify or eliminate the BICA option and/or to remove BICA as the sweep option for accounts that do not maintain cash balances of $100,000 or more or otherwise meet BICA’s eligibility requirements, upon prior notification.</p>\n\t\n\t<p><u><b>Pershing & Sweep Mechanics</b></u>:</p>\n\t<ol class="typeA">\n\t<li><b>Relationship with Pershing</b><br />\n\t<p>Pershing is acting as your agent in establishing and maintaining an interest-bearing deposit account at the Bank, including depositing your money to and withdrawing your money from the Bank through your brokerage account. Your initial cash sweep to the Bank will constitute the appointment of Pershing to act as your agent to effect deposits to and withdrawals from the sweep accounts at the Bank.</p></li>\n\t\n\t<li><b>Information about Pershing</b><br />\n\t<p>Pershing is a wholly-owned subsidiary of The Bank of New York Mellon Corporation, a registered broker-dealer in securities, and a member organization of the NYSE, SIPC and FINRA.</p></li> \n\t\n\t<li><b>Deposits</b><br />\n\t<p>Each business day, Pershing will cause to be deposited the excess cash balances in your brokerage account to a deposit account in its name as agent for its customers maintained at the Bank (“Sweep Account”). Your Sweep Account deposit balance will be evidenced by an entry on records maintained by Pershing as record keeper for the Bank, and your brokerage account statement will reflect all deposits, withdrawals, deposit balance(s) and the applicable interest rate. You will not be issued any evidence of ownership of a Cash Sweep balance, such as a passbook or certificate. Deposits in the Cash Sweep account are direct obligations of the Bank and are not directly or indirectly an obligation of Pershing, BWIS, or any other organization.</p></li>\n\t\n\t<li><b>Withdrawals</b><br />\n\t<p>As a participant in the Cash Sweep, you consent to have your money on deposit in the Sweep Account at the Bank automatically withdrawn by the cash sweep feature in the event of a debit in your brokerage account carried at Pershing, such as on a settlement date to pay for securities purchased. As needed, Pershing will sweep cash from the Sweep Account. You may make withdrawals from Sweep Account balances in any amount not exceeding the total Sweep Account balance, but only through your brokerage account. All withdrawals are subject to the Bank’s reserved right to require seven (7) days’ advance notice of withdrawal.<br /><br />\n\tInterest and Fees: interest rate applicable to your Sweep Account balance will be stated on your brokerage account statement. You may contact your BWIS registered representative to obtain the current interest rate being paid to customers, and balance details as of the most recent business day. Interest will be accrued daily and will be posted on a monthly basis to the Sweep Account. Interest will accrue on the Sweep Account balances from the day they are deposited at the Bank through the business day preceding the date of withdrawal from the Bank. The rate you earn from the Sweep Account can be lower than the rates available to depositors from other deposit accounts at the Bank, from other types of accounts or investment alternatives at Pershing, including money market funds, or from comparable accounts in other depository institutions. You should compare the terms, rates of return, required minimum amounts, charges and other features of the Sweep Account with other accounts and investment alternatives <b>There is no minimum amount or period that your money must remain on deposit, and there is no penalty for withdrawal of your entire balance, or any part thereof, at any time.</b> Pershing receives a fee from the Bank on the average daily net assets in the Bank Sweep Account. As affiliates, BWIS and Bank have profit sharing agreements from which BWIS receives compensation related to earnings by the Bank on sweep deposits.  Pershing receives a fee from the Bank monthly based on the average daily net assets in the Sweep Account for its services with respect to the Sweep Account. BWIS receives from the Bank a percentage of the income earned by the Bank from your sweep deposits. The Bank\'s payments to BWIS do not reduce the stated interest earned on your deposits with the Bank. The BWIS registered representatives receive no fees for your participation in the Sweep Account.</p></li>\n\t\n\t<li><b>Account Statements</b><br />\n\t<p>You will receive a periodic brokerage account statement from Pershing. All activity with respect to your Sweep Account balance, including interest earned for the period covered, will appear on that statement. You will not receive a separate statement from the Bank or BWIS. You should notify your BWIS registered representative immediately of any discrepancies on an account statement.</p></li>\n\t\n\t<li><b>Alternatives to the Cash Sweep </b><br />\n\t<p>As a participant in the Cash Sweep, you agree to the terms provided herein. You understand that, at any time, you may withdraw your consent to participate in the Cash Sweep. If you withdraw your consent, any un-invested cash will be a free credit balance on your account and you will not earn any interest on those funds. You can contact a BWIS registered representative for other cash investment options then available.<b>Information regarding interest rates and alternatives to sweep options are available on our website at <a href="https://www.bankofthewest.com/personal-banking/investment-services/about-bwis.html" target="new">https://www.bankofthewest.com/personal-banking/investment-services/about-bwis.html</a>.</b></p></li>\n\t\n\t<li><b>Tax Reporting</b><br />\n\t<p>The interest that you receive from the Sweep Account is generally fully subject to state and federal tax, as is income that you may receive from money market funds. Pershing will send a tax information form for each year showing the amount of interest income you have earned.</p></li>\n\t\n\t<li><b>Changes to Cash Management Options </b><br />\n\t<p>You agree that BWIS may change cash management options, including but not limited to the types of sweep products and eligibility for them, as well as interest rates, and any other terms and conditions, including transferring or switching between and among free credit balances, bank deposit products, and money market products, as long as we provide 30 calendar days advance notice to you.</p></li>\n\t</ol>\n\t<p><b>YOU ACKNOWLEDGE THAT YOU HAVE RECEIVED AND CAREFULLY READ THESE TERMS AND CONDITIONS. YOU MAY OBTAIN INFORMATION ABOUT THE INTEREST RATE BEING PAID ON THE BANK OF THE WEST CASH SWEEP VIA THE BWIS WEB PAGE OR BY CONTACTING A BWIS REPRESENTATIVE.</b></p>\n\t\n\t<p class="title">ADDITIONAL DISCLOSURES</p>\n\t\n\t<p>BWIS provides additional disclosures on our website at bankofthewest.com/BWIS Disclosures and bankofthewest.com/Form ADV. Information provided there includes our Client Relations Summary (also known as Form “CRS”), more detailed information and disclosures in the BWIS Disclosures document, and copies of our Form ADVs (which apply to BWIS’ registered investment advisory business). Paper copies of these disclosure documents are also available upon request by contacting us at 1-800-338-3919.</p>\n\t\n\t<p class="title">BUSINESS CONTINUITY PLAN</p>\n\t\n\t<p><b>BWIS BUSINESS CONTINUITY PLAN</b><br />\n\tBWIS’ BCP addresses the possibility of a Significant Business Disruption (“SBD”) and how BWIS plans to respond. SBDs can vary in their scope, such as only our firm, a single building used by our firm, the business district where our firm is located, a specific city where our firm is located, or the whole region or country. Within each of these areas, the severity of the disruption can also vary from minimal to severe. In the case of a disruption to only our firm or a building housing our firm, we will transfer our operations to a local site as needed, and expect to recover and resume business as quickly as possible. In a disruption affecting our business district, city, or region, we will transfer our operations to a site outside of the affected area, and recover and endeavor to resume business within 24 hours or as quickly as possible. In either situation, we plan to continue business and transfer operations to our clearing firm if necessary. If the SBD is so severe that it prevents us from remaining in business, we will ensure our customer’s prompt access to their funds and securities through Pershing directly. We will endeavor to quickly recover and resume business operations in the case of an SBD. We plan to safeguard our employees and property, make a financial and operational assessment, protect the firm’s books and records, and allow our customers to transact business. In short, our BCP is designed to permit our firm to resume operations as quickly as possible, given the scope and severity of the SBD. For further information or any questions about our business continuity plan, you may contact us at 1-800-338-3919 or submit a written request.</p>\n\t\n\t<p><b>CONTACTING BWIS</b><br />\n\tIf after an SBD you are unable to contact your BWIS Registered Representative, you should telephone us at 1-800-338-3919, during customer service hours. If you are unable to reach a representative at the provided number, you should contact our clearing firm, Pershing, at 1-201-413-3635 or via their website, www.pershing.com. Pershing will provide prompt access to funds and securities, enter trade orders, and process other trade-related cash and security transfer transactions for you. We have been advised by Pershing that their objective is to restore their own operations and complete existing transactions as well as accept new transactions and payments no later than the next business day following a business disruption. Your orders and requests for funds and securities are subject to delay during this period.</p>\n\t\t\t\n\t<p><b>PERSHING BUSINESS CONTINUITY PLAN</b><br />\n\tPershing’s BCP disclosure statement is available on their website, www.pershing.com. BWIS will also mail a BWIS BCP brochure to customers upon request. BWIS’ BCP addresses the possibility of a SBD and how BWIS plans to respond to events of varying scope. We have been advised by Pershing that their objective is to restore their own operations and complete existing transactions, as well as accept new transactions and payments, no later than the next business day following a business disruption. Your orders and requests for funds and securities are subject to delay during this period.</p>\n\t\n\t<p class="title">BWIS PRIVACY POLICY</p>\n\t<p><b>Permitted Disclosures without Your Authorization</b></p>\n\t<ol class="typeA">\n\t<li><b>BWIS is permitted under law to disclose information we collect about you to third parties in certain circumstances without authorizations, including the following:</b><br />\n\t\t<ol class="type1">\n\t\t\t<li>To unaffiliated third parties: <br />\n\t\t\t\t<ul>\n\t\t\t\t<li>When the disclosure is necessary to perform a business or insurance function;</li>\n\t\t\t\t<li>For determining your eligibility for an insurance payment; and</li>\n\t\t\t\t<li>For detecting or preventing fraud or criminal activity. </li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>To an insurer or its affiliates:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>To detect or prevent fraud or criminal activity; and</li>\n\t\t\t\t<li>To process transactions or to provide services you have requested.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>To a medical-care institution or doctor:<br />\n\t\t\t\t<ul><li>To verify insurance coverage.</li></ul>\n\t\t\t</li>\n\t\t\t<li>To an insurance regulatory authority.</li>\n\t\t\t<li>To a law enforcement or other governmental authority pursuant to law.</li>\n\t\t\t<li>To an affiliate whose only use of the information will be in connection with an audit of BWIS or its agent or the marketing of an insurance product or service, provided the affiliate agrees not to disclose the information for any other purpose or to unaffiliated persons.</li>\n\t\t\t<li>To a group policyholder for the purpose of reporting claims experience or conducting an audit of the insurance institution\'s or agent\'s operations or services.</li>\n\t\t\t<li>To a governmental professional licensing or regulatory board to review the service or conduct of a health care institution or health professional that BWIS has reason to believe has violated its licensing act or engaged in the unlawful practice of a licensed professional.</li>\n\t\t\t<li>To a representative of a party to a proposed or consummated sale, transfer, merger, or consolidation of all or part of the business of BWIS.</li>\n\t\t</ol>\n\t</li>\n\t<li><b>Your Rights with Respect to Accessing Recorded Personal Information:</b><br />\n\t\t<ol>\n\t\t\t<li>Upon receipt of your written request for access to recorded personal information which is reasonably described and reasonably locatable and retrievable, BWIS will, within 30 business days from the date such request is received:<br />\n\t\t\t\t<ul>\n\t\t\t\t\t<li>Inform you of the nature and substance of such recorded personal information;</li>\n\t\t\t\t\t<li>Provide you with a copy of the recorded personal information;</li>\n\t\t\t\t\t<li>Disclose to you the identity of those persons or institutions whom the insurer has disclosed such personal information within two years prior to such request; and</li>\n\t\t\t\t\t<li>Provide you with a summary of the procedures by which you may request correction, amendment or deletion of recorded personal information.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>BWIS will also identify the source of the information if such source is an institutional source.</li>\n\t\t\t<li>For any medical information, BWIS will identify the doctor or the medical care institution which provided such information. BWIS can send the information directly to you or your doctor. If information is sent to a doctor, BWIS will notify you at the time of the disclosure that it has been provided to the doctor.</li>\n\t\t\t<li>BWIS may charge a reasonable fee to cover the costs incurred in providing a copy of recorded personal information to you.</li>\n\t\t\t<li>Information obtained from a report prepared by an insurance-support organization may be retained by the insurance-support organization and disclosed to other persons.</li>\n\t\t</ol>\n\t</li>\n\t<li><b>Your Rights with Respect to Correcting, Amending, or Deleting Any Recorded Personal Information:</b><br />\n\t\t<ol>\n\t\t\t<li>Upon receipt of your written request to correct, amend or delete any recorded personal information in our possession about you, we will, within 30 business days, either:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>Correct, amend or delete the portion of the recorded personal information in dispute; or</li>\n\t\t\t\t<li>Notify you if BWIS cannot make such correction, amendment or deletion, the reasons for denying the request, and your right to file a statement as provided below.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>If BWIS grants the request for correction, amendment or deletion of recorded personal information, BWIS will notify you in writing and furnish such correction, amendment or fact of deletion to:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>Any person specifically designated by you who may have, within the preceding two years, received such recorded personal information;</li>\n\t\t\t\t<li>Any insurance-support organization if the insurance-support organization has systematically received such recorded personal information from the insurance institution within the preceding seven years; provided, however, that the correction, amendment or fact of deletion need not be furnished if the insurance-support organization no longer maintains recorded personal information about you; and</li>\n\t\t\t\t<li>Any insurance-support organization that furnished the personal information that has been corrected, amended or deleted.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>If you disagree with BWIS\' refusal to correct, amend or delete recorded personal information, you are permitted to file with BWIS:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>A concise statement setting forth what you think is the correct, relevant or fair information; and</li>\n\t\t\t\t<li>A concise statement of the reasons why you disagree with BWIS\' refusal to correct, amend or delete recorded personal information.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li>If you file a statement described above, BWIS will:<br />\n\t\t\t\t<ul>\n\t\t\t\t<li>File the statement with the disputed personal information and provide a means by which anyone reviewing the disputed personal information will be made aware of your statement and have access to it;</li>\n\t\t\t\t<li>In any subsequent disclosure we make of the recorded personal information that is the subject of disagreement, clearly identify the matter(s) in dispute and provide your statement along with the recorded personal information being disclosed; and</li>\n\t\t\t\t<li>Furnish the statement to the same persons and in the same manner as described in Section C2 above.</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</ol>\n\t</li>\n\t<li><b>If you are a California resident:</b><br />\n\t\t<p>If you are a California resident and you want to learn about the personal information the Bank and its affiliates collect, how it is used and stored, what rights you have under the California Consumer Privacy Act, or exercise privacy rights you may have, you can do so a <a href="www.BankoftheWest.com/CCPA"></a></p>\n\t</li>\n\t</ol>\n\t\n\t<p class="title">PREDISPUTE ARBITRATION DISCLOSURE & AGREEMENT</p>\n\t<p><b>THIS AGREEMENT CONTAINS A PREDISPUTE ARBITRATION CLAUSE. BY SIGNING AN ARBITRATION AGREEMENT, THE PARTIES AGREE AS FOLLOWS:</b></p>\n\t<ol class="typeNone">\n\t\t<li><b>(1) ALL PARTIES TO THIS AGREEMENT ARE GIVING UP THE RIGHT TO SUE EACH OTHER IN COURT, INCLUDING THE RIGHT TO A TRIAL BY JURY, EXCEPT AS PROVIDED BY THE RULES OF THE ARBITRATION FORUM IN WHICH A CLAIM IS FILED.</b></li>\n\t\t<li><b>(2) ARBITRATION AWARDS ARE GENERALLY FINAL AND BINDING; A PARTY’S ABILITY TO HAVE A COURT REVERSE OR MODIFY AN ARBITRATION AWARD IS VERY LIMITED.</b></li>\n\t\t<li><b>(3) THE ABILITY OF THE PARTIES TO OBTAIN DOCUMENTS, WITNESS STATEMENTS AND OTHER DISCOVERY IS GENERALLY MORE LIMITED IN ARBITRATION THAN IN COURT PROCEEDINGS.</b></li>\n\t\t<li><b>(4) THE ARBITRATORS DO NOT HAVE TO EXPLAIN THE REASON(S) FOR THEIR AWARD UNLESS, IN AN ELIGIBLE CASE, A JOINT REQUEST FOR AN EXPLAINED DECISION HAS BEEN SUBMITTED BY ALL PARTIES TO THE PANEL AT LEAST 20 DAYS PRIOR TO THE FIRST SCHEDULED HEARING DATE.</b></li>\n\t\t<li><b>(5) THE PANEL OF ARBITRATORS MAY INCLUDE A MINORITY OF ARBITRATORS WHO WERE OR ARE AFFILIATED WITH THE SECURITIES INDUSTRY.</b></li>\n\t\t<li><b>(6) THE RULES OF SOME ARBITRATION FORUMS MAY IMPOSE TIME LIMITS FOR BRINGING A CLAIM IN ARBITRATION. IN SOME CASES, A CLAIM THAT IS INELIGIBLE FOR ARBITRATION MAY BE BROUGHT IN COURT.</b></li>\n\t\t<li><b>(7) THE RULES OF THE ARBITRATION FORUM IN WHICH THE CLAIM IS FILED, AND ANY AMENDMENTS <br />\n\t\tTHERETO, SHALL BE INCORPORATED INTO THIS AGREEMENT.</b></li>\n\t</ol>\t\n\t<p><b> NO PERSON SHALL BRING A PUTATIVE OR CERTIFIED CLASS ACTION TO ARBITRATION, NOR SEEK TO ENFORCE ANY PREDISPUTE ARBITRATION AGREEMENT AGAINST ANY PERSON WHO HAS INITIATED IN COURT A PUTATIVE CLASS ACTION; OR WHO IS A MEMBER OF A PUTATIVE CLASS WHO HAS NOT OPTED OUT OF THE CLASS WITH RESPECT TO ANY CLAIMS ENCOMPASSED BY THE PUTATIVE CLASS ACTION UNTIL; (i) THE CLASS CERTIFICATION IS DENIED; OR (ii) THE CLASS IS DECERTIFIED; OR (ii) THE CUSTOMER IS EXCLUDED FROM THE CLASS BY THE COURT. SUCH FORBEARANCE TO ENFORCE AN AGREEMENT TO ARBITRATE WILL NOT CONSITITUTE A WAIVER OF ANY RIGHTS UNDER THIS AGREEMENT EXCEPT TO THE EXTENT STATED THEREIN.</b></p>\n\t<p><b>ARBITRATION AGREEMENT<br />\n\t\tYOU AGREE THAT ANY CONTROVERSY BETWEEN YOU AND BWIS RELATING TO YOUR ACCOUNT, THIS AGREEMENT, ANY OTHER BWIS ACCOUNTS OR AGREEMENTS WITH BWIS, OR YOUR RELATIONSHIP WITH BWIS, INCUDING BUT NOT LIMITED TO ANY ISSUE RELATING TO THE ARBITRABILITY OF A DISPUTE, SHALL BE SUBMITTED TO ARBITRATION BEFORE THE FINANCIAL INDUSTRY REGULATORY AUTHORITY, INC. </b></p>\n\t\n\t<p class="title">BWIS NEW ACCOUNT AGREEMENT SIGNATURE</p>\n\t<p>You hereby agree that all information you have provided in this New Account Agreement is true and correct.  You agree to be bound by all terms and conditions in the New Account Agreement as set forth herein, and any attachments, addenda or documents referenced, and these supersede any and all other communications, whether written, oral or electronic between you and BWIS or its representatives.  <b>THIS AGREEMENT CONTAINS A PRE-DISPUTE ARBITRATON CLAUSE</b>, found at page 13.  Any and all other agreements, if any, between you and BWIS that are not inconsistent with this Agreement will remain in full force and effect.  If there are any conflicts between this Agreement and any other agreements or attachments, this Agreement shall govern.  You acknowledge that you have received a copy of this Agreement.</p>\n\t</div>')}]),angular.module("DAV/userAgreementText/content.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("DAV/userAgreementText/content.tpl.html",'<p class="svi-x">This Online Agreement will allow you access to Davenport’s website for the purpose of accessing and reviewing account information and activity. This Online Agreement and Enrollment Form is in addition to all other agreements between you and Davenport. You may access your own or related accounts.</p>\n\n<p class="svi-x">Davenport & Company LLC (the “Firm”) is pleased to provide you with access to certain account information and activity via the Internet (the “Service”) through the Firm’s site on the World Wide Web (the “Site”). The Site is for informational purposes only. Neither the Service nor the Site are solicitations of offers to sell or solicitations of offers to buy any security that may be mentioned orreferenced on the Site. Offers can only be made where permitted under law. If you wish to learn more about any information contained on the Site, you are invited to contact your Investment Executive. Access to the Site is for the purpose of reviewing your accounts only, andis provided free of charge.</p>\n\n<p class="svi-x"><strong class="svi-x">No Investment Advice.</strong> The Service provides information about securities. However, you understand and agree that the Firm is not providing you with investment advice through the Site. You understand and agree that the Firm is making no representation about whether particular investments brought to your attention through the Service are suitable for you. You agree that the Service does not constitute a solicitation for the purchase or sale of any security. You understand and agree that if you want to seek investment advice from the Firm, you will do so by consulting with your Investment Executive.</p>\n\n<p class="svi-x"><strong class="svi-x">Information Use by Permission Only.</strong> The Service, the Site, and the information contained on the Site are the property of the Firm or are licensed or otherwise used by permission. Copyright and other intellectual property laws protect them. You agree to use the Service, the Site, and information contained on the Site for your personal non-commercial use only. You may download information from the Site to your computer and print a hard copy for your personal reference, provided that you do not remove any copyright or other notices. Otherwise, you agree that you will not reproduce, retransmit, disseminate, sell, distribute, publish, broadcast, circulate, or otherwise commercially exploit the Service, the Site, or the information contained on the Site without the expressed written consent of the Firm. You agree that you will not use the Service, the Site, or information contained on the Site for any unlawful purpose.</p>\n\n<p class="svi-x"><strong class="svi-x">1. Information Protection.</strong> The Firm will take reasonable precautions to protect the confidentiality of all information related to you that can be accessed by the Service, and to prevent unauthorized access to that information. The Firm will use technology such as computer “firewalls” and data encryption. Further, you will need to use a password and a user identification in order to access the Site. The Firm strongly recommends that you keep your password confidential, and protect it as you would any other important financial information. You agree to notify the Firm immediately if you become aware of any loss, theft, or unauthorized use of your password or access to the Service. Access to any account where the account name contains a name other than your own requires a signature from the other party.</p>\n\n<p class="svi-x">You understand and agree that the Firm cannot guarantee absolute protection of information that can be accessed by the Service. You understand and agree that there are inherent risks in the use of any software or information found on the Internet, including the risk of “computer viruses,” and you agree that you will bear those risks and not seek to hold the Firm liable for the consequences of such risks. The Firm may provide links to other sites on the Internet, and you understand and agree that the Firm is not responsible for the linked sites or their contents and that providing such links does not constitute an endorsement of the linked sites or their contents by the Firm. You also agree that you will use such links at your own risk. The Firm reserves the right to remove such links. You agree that the Firm may use and disclose such information as is necessary to respond to lawful requests from government entities and self-regulatory organizations, to respond to subpoenas, or for any legitimate business purpose. You agree that the Firm will not be responsible for any consequences that result from your decision to disclose your password to another party or entity, or from a failure to safeguard your password.</p>\n\n<p class="svi-x"><strong class="svi-x">2. Information Reliability and Accuracy.</strong> The Firm has obtained the information contained on the Site from sources considered reliable to the Firm and will make reasonable efforts to maintain accurate and current information on the Site. However, the Firm cannot guarantee the accuracy or reliability of the Service or information contained on the Site. In particular, you understand and agree that price quotations may be delayed or inaccurate. The price for a security contained on any part of the Site may differ from the current market price for that security or from the price contained in your online account information or other sections of the Site. Accordingly, you agree that your reliance on information contained on the Site regarding security prices will be at your own risk. You understand and agree that research reports or other market commentary available from the Service reflects the author’s analysis as of the publication date, and that the accuracy, completeness, and timeliness of such information cannot be guaranteed and is subject to change without notice. You understand and agree that the Firm has no duty to update or correct information contained on the Site.</p>\n\n<p class="svi-x">You understand and agree that the Service may be occasionally unavailable because of maintenance requirements and that the Firm is not responsible for any consequence of Service unavailability in such an event. You agree that the Firm is not responsible for any consequences of Service unavailability, delay, or inaccuracy due to technical problems, power loss, loss of communications, facilities failure, electronic or mechanical equipment failure, fire, storms, natural disasters, acts of God, failure of communications software or Internet service providers, securities market conditions, unauthorized access, theft, operator errors, strikes, other labor problems, or any other circumstances constituting force majeure.</p>\n\n<p class="svi-x">You understand and agree that the information contained on the Site is not the official record of your account and is subject to changes, errors, and omissions. Your printed Confirmations and periodic account Statements constitute your official account record. Information contained on the Site is not a substitute for other important information that the Firm sends to you. In particular, you agree that you will not use information contained on the Site for tax reporting purposes. The Firm will provide official tax documentation regarding your account to you by mail. Even though information contained on the Site is not the Firm’s official record of your account, you agree to notify the Firm in writing within 15 days in the event that you believe that information about your account contained on the Site is inaccurate.</p>\n\n<p class="svi-x"><strong class="svi-x">Transactions in Securities Discussed on the Site</strong></p>\n\n<p class="svi-x">The information contained on the Site is not a complete description of the securities, markets, or developments discussed. The Firm and its affiliates, officers, directors, employees, and/or agents may have executed, or may in the future, execute transactions in any of the securities discussed on the Site.</p>\n\n<p class="svi-x"><strong class="svi-x">Term of the Agreement.</strong> This Agreement shall continue until terminated by either party at will. The Firm reserves the right to terminate, limit, or change your access to the Service or any portion of it in its sole discretion, without notice and without limitation, for any reason whatsoever, including, but not limited to, the unauthorized use of your user name, password(s), and/or account number(s), breach of this Agreement, discontinuance of access to any information or data from any data provider, or termination of one or more agreements between the Firm and the data providers. In the event of termination, limitation, or change of this Service for any reason, neither the Firm nor its data providers shall have any liability to you.</p> \n\n<p class="svi-x"><strong class="svi-x">Indemnification.</strong> You agree to indemnify and hold the Firm harmless from and against any and all claims, losses, liability, costs, and expenses (including, but not limited to, attorneys’ fees) arising from your violation of this Agreement or any third party’s rights, including, but not limited to, copyright, proprietary, and privacy rights. You acknowledge that the Firm has entered into certain agreements with its data providers in order to provide the Service, and that in those agreements the Firm has agreed to indemnify and hold harmless its data providers from and against certain claims. You agree that you will not assert claims against the data providers to the extent that the Firm has agreed to indemnify and hold harmless the data providers from such claims. You agree that for such claims your sole remedy will be from the Firm. You agree that this indemnification and hold harmless obligation will survive the termination of this Agreement, and will be binding on your executors, heirs, successors, and assigns.</p>\n\n<p class="svi-x"><strong class="svi-x">No Warranty.</strong> THERE IS NO IMPLIED WARRANTY OF MERCHANTABILITY, NO IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR USE, AND NO OTHER WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, REGARDING THE SERVICE, THE SITE, OR INFORMATION CONTAINED ON THE SITE.</p>\n\n<p class="svi-x"><strong class="svi-x">Limitation of Liability.</strong> IN NO EVENT WILL THE FIRM BE LIABLE TO YOU OR ANYONE ELSE FOR ANY INCIDENTAL, CONSEQUENTIAL, SPECIAL, OR INDIRECT DAMAGES INCLUDING, BUT NOT LIMITED TO, LOST OPPORTUNITIES, LOST PROFITS, TRADING LOSSES, OR DAMAGES THAT RESULT FROM INCONVENIENCE, DELAY, OR LOSS OF THE USE OF THE SERVICE ARISING OUT OF OR RELATED TO THIS AGREEMENT, EVEN IF THE FIRM HAS BEEN ADVISED OF OR IS OTHERWISE AWARE OF THE POSSIBILITY THEREOF, EXCEPT AS LIMITED BY APPLICABLE LAW.</p>\n\n<p class="svi-x"><strong class="svi-x">Severability.</strong> Should any portion of this Agreement be found to be void or unenforceable for any reason, the court or the arbitrator, as the case may be, should attempt to limit or otherwise modify such provision to make it enforceable, and if such portion cannot be modified to make it enforceable, the unenforceable portion shall be deemed severed from the remaining portions of this Agreement, which shall remain in full force and effect. If any portion of this Agreement is so found to be void or unenforceable for any reason in regard to one or more persons, entities, or subject matters, such portions shall remain in full force and effect with respect to all other persons, entities, and subject matters.</p>\n\n<p class="svi-x"><strong class="svi-x">Assignment.</strong> The Firm may assign this Agreement or any of its rights or obligations under this Agreement to any affiliate or successor of the Firm or to any other party. This Agreement is personal to you, and you may not assign this Agreement or your rights or obligations under this Agreement to any person or entity.</p>\n\n<p class="svi-x"><strong class="svi-x">Miscellaneous.</strong> The Firm’s failure to insist on strict compliance with any term of this Agreement, exercise any right or power given to the Firm by this Agreement, or a continued course of conduct by the Firm shall not operate as a waiver of the Firm’s power or rights under this Agreement. No single or partial exercise by the Firm shall preclude any future exercise. All rights and remedies given to the Firm in this Agreement are cumulative and not exclusive of any other rights or remedies available to the Firm at law or equity. The headings contained in this Agreement are for reference purposes only and shall not affect the meaning or interpretation of this Agreement.</p>\n\n<p class="svi-x"><strong class="svi-x">USA Patriot Act</strong></p>\n\n<p class="svi-x">The USA PATRIOT ACT, enacted in 2001, is designed to detect, deter, and punish terrorists in the United States and abroad. The Act imposes anti-money laundering requirements on brokerage firms and requires us to have a comprehensive anti-money laundering program, which includes a customer identification component.</p>\n\n<p class="svi-x">As part of our required program, we may ask you to provide various identification documents or other information to verify your identity. These documents may include government issued ID’s and, if applicable, government issued corporate paperwork. If you decline to provide such documents, Davenport may not be able to conduct securities business with you and may be forced to terminate its relationship by closing such accounts or by refusing to transact securities business. The Commonwealth of Virginia Division of Motor Vehicles does not require you to provide Davenport with a photocopy of your driver’s license. For non-Virginia residents, contact your state motor vehicle authority for more details as it may pertain to your own locality.</p>\n\n<p class="svi-x">To aid in our identification process, Davenport has contracted with a third party vendor to assist with our Customer Identification Program. If applicable, certain relevant information regarding your account may be passed to such third party to verify your identity and help Davenport comply with the USA PATRIOT ACT.</p>\n\n<p class="svi-x"><strong class="svi-x">Governing Law.</strong> This Agreement shall be governed in all respects by the laws of the Commonwealth of Virginia without regard to its choice of law rules.</p>\n\n<p class="svi-x"><strong class="svi-x">Entire Agreement.</strong> This Agreement constitutes the entire agreement between you and the Firm with respect to the Service, the Site, and information contained on the Site. Your signature on this Agreement means that you accept the Agreement as submitted to you by the Firm. You agree not to alter, edit, or change the Agreement, and you agree that any purported alteration, edit, or change will be of no force or effect. This Agreement may not be amended except in writing. In the event that the Firm chooses to amend the Agreement, you will be notified in writing, and your next use of the Service following that notification will constitute your agreement to the amendment. You may not amend the Agreement.</p>\n\n<p class="svi-x">THIS AGREEMENT SHALL BE DEEMED TO HAVE BEEN MADE IN AND ITS ENFORCEMENT SHALL BE GOVERNED BY THE LAWS OF THE COMMONWEALTH OF VIRGINIA. Any provision of this Agreement that is in conflict with the laws of the Commonwealth of Virginia or with federal securities laws shall be deemed ineffective to the extent it conflicts with such laws without invalidating the remaining provisions of this Agreement.</p>\n<div style="clear: both; float:left; width: 80%; padding-top:20px">Davenport & Company LLC <br />PO Box 85678 • Richmond VA 23285-5678 - Member: New York Stock Exchange • SIPC</div>\n<div style="float:left; width: 20%;">NA-16R Rev 04/05</div>\n<br style="clear: both;" /><br />\n<p class="svi-x" style="text-align:center"><em>By my clicking the I Agree button, I confirm that I have read, understand, and accept the conditions herein.</em></p>\n')}]),angular.module("FDB/userAgreementText/content.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("FDB/userAgreementText/content.tpl.html",'1DB ELECTRONIC TRADING AGREEMENT<br>\n<br />\nPlease carefully read this 1DB Electronic Trading Agreement ("Agreement") before using the computer trading service of www.1db.com.<br />\n<br />\n<strong>IMPORTANT:</strong> Your use of www.1db.com will indicate your acceptance to all the below terms, including the terms of any 1st Discount Brokerage, Inc. (or any divisions thereof) new applications, including, but not limited to, the terms contained in the 1st Discount Brokerage, Inc. New Account Applications, ("Other 1st Discount Brokerage, Inc. Agreements"). The terms of the Other 1st Discount Brokerage, Inc. Agreements are incorporated herein and are part of this Agreement. Your acceptance to the terms detailed below and those provided for in the Other 1st Discount Brokerage, Inc. Agreements is a condition precedent to your use of this Service. If you do not agree to these terms, do not use this service, defined below.<br />\n<br />\n<strong>DEFINITIONS</strong><br />\n• www.1db.com is a PC automated order execution and information system brokerage service ("Service") of 1st Discount Brokerage, Inc. and its affiliates or assigns (inclusively "1st Discount Brokerage, Inc.").<br />\n• The term "I" means and includes "we" or "he" or "she" or "it", whichever is appropriate.<br />\n• The term "my" means and includes "our", as appropriate.<br />\n• The term "me" means and includes "us", as appropriate.<br />\n• The term "contained in" means and includes "consisting of", "comprising", "embodying", "reflecting", "constituting" or "provided for".<br />\n<br />\n<strong>NATURE OF SERVICES PROVIDED - NO INVESTMENT ADVICE</strong><br />\nThe investment choices and services on publicly available portions of the www.1db.com  site are provided as general information only and are not intended to provide investment recommendations, tax, or legal advice. Under no circumstance is the information contained herein to be used or considered as an offer to sell or a solicitation of an offer to buy any particular investment.<br />\n<strong>1.</strong>\nI understand that all decisions relating to my investment or trading activity under this Service will be made solely at my discretion. I understand that this www.1db.com Service executes orders on instructions only and does not act as an investment counselor or advisor. Furthermore, this Service does not solicit orders, recommend securities for purchase or sale, offer investment advice  or render any opinions or judgments, or answer inquiries concerning general or specific market conditions, either present or future, or the value potential of investment in specific securities or securities in general.<br />\n<br />\n<strong>GENERALLY</strong><br />\n<strong>2.</strong>\nIn offering www.1db.com, 1st Discount Brokerage, Inc. is making available electronic brokerage services that allow me, via my PC modem, to enter orders to buy and/or sell certain securities and obtain quotations and other information, including account data, via electronic transmission. I agree to use 1st Discount Brokerage, Inc.\'s www.1db.com Service, and any other service offered by and through 1st Discount Brokerage, Inc., only in accordance with the terms of this Agreement, and such other terms and conditions as contained in Other 1st Discount Brokerage, Inc. Agreements.<br />\n<strong>3.</strong>\nGeneral Terms and Conditions for order entry using the www.1db.com Service are the following:<br />\na) You cannot buy a security unless there is money on-hand in the account or SMA available.<br />\nb) The security to be sold must be long in the account in negotiable form before entering a sell order.<br />\nc) Option transactions are not permitted until your Option Agreement has been reviewed and approved by 1st Discount Brokerage, Inc.\'s Senior Registered Options Principal.<br />\nd) No uncovered option orders are permitted under this Service.<br />\ne) Short sales effected in the margin account, as applicable, must have prior approval from a 1st Discount Brokerage, Inc. broker.<br />\n<strong>4.</strong>\nI warrant that I will be the only authorized user of this Service under this Agreement. I agree that I will be responsible for the confidentiality and use of my account number and sign-on password. I understand that I will be solely responsible for all order entries through this Service using my account number and sign-on password. All orders will be deemed valid at the time of receipt by 1st Discount Brokerage, Inc. and in the form received.<br />\n<strong>5.</strong>\nI further understand and agree that any orders given by me and any information furnished to me by the use of this Service shall be subject to the following terms and conditions:<br />\na) I understand that 1st Discount Brokerage, Inc. shall not be deemed to have received any order, either verbally or electronically transmitted, from me until 1st Discount Brokerage, Inc. has acknowledged to me that the order was received by 1st Discount Brokerage, Inc..<br />\nb) All notifications regarding this Agreement shall be directed to your personal broker.<br />\nc) If any order has been placed through any 1st Discount Brokerage, Inc. service and I have not received a reference number reflecting such order I shall immediately notify 1st Discount Brokerage, Inc..<br />\nd) If any order has been executed through any 1st Discount Brokerage, Inc. Service, and I have not received an accurate written confirmation of the executed order within five business days, I shall immediately notify 1st Discount Brokerage, Inc..<br />\ne) If I receive confirmation of an order that I did not place or any similar conflicting report, I shall immediately notify 1st Discount Brokerage, Inc..<br />\nf) I shall immediately notify 1st Discount Brokerage, Inc. if there is an unauthorized use of my password or any other security data.<br />\ng) I shall immediately notify 1st Discount Brokerage, Inc. if there is a discrepancy in the account balance or stock positions.<br />\nh) I acknowledge and accept, without limitation or liability to 1st Discount Brokerage, Inc. or any agents thereof, that when placing a market order there will be times when a quoted price will change prior to the trade\'s execution due to market circumstances and that not all orders will be executed in chronological sequence with the order being placed.<br />\ni) If I fail to immediately notify 1st Discount Brokerage, Inc. regarding any of the above, neither 1st Discount Brokerage, Inc. nor its affiliates or assigns can or will be held responsible or liable to me, or to any other person whose claim may arise through me, for any claims for damages of any sort, including both actual and consequential damages, with respect to the handling, mishandling, or any act or failure to act, in my Account.<br />\nj) I understand that each participating securities exchange asserts a proprietary interest in all of the market data it furnishes to the parties that disseminate the data and is protected by both U.S. and foreign copyright. I also understand that neither any participating securities exchange nor any supplier of the market data, including 1st Discount Brokerage, Inc., guarantees the timeliness, sequence, accuracy or completeness of the market data or any other market information or messages disseminated by any party, including 1st Discount Brokerage, Inc.. Although 1st Discount Brokerage, Inc. reasonably believes the source to be reliable, 1st Discount Brokerage, Inc., or any agents or assigns thereof, shall not be liable in any way for: (1) an inaccuracy, error or delay, or omission of any such data, information, or message or the transmission or delivery of any such data, information, or message, or (2) any loss or damages arising from, or occasioned by, any such inaccuracy, error or delay or omission, nonperformance, or interruption of any such data, information or message, due either to any negligent act or omission by any disseminating party to any "force majeure" (i.e. flood, extraordinary weather conditions, earthquake or other act of God, fire, war, insurrection, riot, labor dispute, accident, action of government, communications, power or equipment failure, or software failure or malfunction) or any cause beyond the reasonable control of any disseminating party, including 1st Discount Brokerage, Inc..<br />\nk) By use of this Service, I agree that there is no warranty of merchantability, no warranty of fitness for a particular purpose, and no other warranty of any kind, expressed or implied regarding the information or any aspect of this Service, including, but not limited to, the information accessed and the order execution.<br />\nl) By use of this Service, I agree that in no event will 1st Discount Brokerage, Inc. or any of the data providers be liable to me or to anyone for any incidental, consequential, special or indirect damages, including, but not limited to lost profits, trading losses or damages that result from inconvenience, delay or loss of access to my account or to any 1st Discount Brokerage, Inc. service, or information accessible therein, arising out of this Agreement, except as limited by applicable law.<br />\nm) I agree that 1st Discount Brokerage, Inc. may discontinue any presently available service in its entirety, at any time, without prior notice, and that 1st Discount Brokerage, Inc. may modify or change the terms of any service, in whole or in part, at any time.<br />\n<strong>6.</strong>\nBy use of this Service, I agree to pay all subscriptions, service and user fees, if applicable, which I am charged by 1st Discount Brokerage, Inc., or by any information provider, by the use of this Service, and agree that such fees may be changed without notice by 1st Discount Brokerage, Inc.. I agree to pay all costs (including attorney\'s fees) incurred by 1st Discount Brokerage, Inc. in collecting overdue fees or costs incurred by me by use of this Service. I also agree to pay all Federal, State, and local taxes applicable to my use or receipt of this Service, if any. I hereby grant 1st Discount Brokerage, Inc. a continuing interest in the assets of my 1st Discount Brokerage, Inc. brokerage account(s) to secure the timely payment of all fees owed by me for any services provided and for any amounts that may become owing by my use of a 1st Discount Brokerage, Inc. account.<br />\n<strong>7.</strong>\n1st Discount Brokerage, Inc. reserves the right to terminate my access to www.1db.com, or any portion of this Service, at 1st Discount Brokerage, Inc.\'s discretion, without notice and without limitation, for any reason whatsoever, including, but not limited to, the unauthorized use of my access number(s) and code(s) and/or account number(s), breach of any Other 1st Discount Brokerage, Inc. Agreements, and discontinuation of 1st Discount Brokerage, Inc.\'s access to any data from any information provider or termination of one or more agreements between 1st Discount Brokerage, Inc. and/or the information providers and transmitters.<br />\n<strong>8.</strong>\nAs a condition of being approved to use www.1db.com, I represent and agree that the following statements are, and will continue to be, true for so long as I receive this Service:<br />\na) I am making this Agreement in my individual or joint capacity, and not on behalf of a firm, corporation, partnership, trust or association or any other third party.<br />\nb) I am not a securities broker-dealer, investment advisor, a commodity merchant or introducing or trading or investment advisor.<br />\n<br />\n<strong>ORDER FLOW PAYMENT STATEMENT DISCLOSURE</strong><br />\n<strong>9.</strong>\nI acknowledge that 1st Discount Brokerage, Inc. and/or its clearing agent, Apex Clearing Corporation, Inc., may receive remuneration for directing orders to designated broker/dealers or market centers for execution. Such remuneration is considered compensation to 1st Discount Brokerage, Inc. and/or its clearing agent, Apex Clearing Corporation, Inc. Over-the-counter securities and selected exchange services may be routed to designated market makers or designated third market dealers based upon a computerized system. All orders are executed at prices equal to or better than the displayed national bid/offer prices. The source and amount of any compensation received in connection with a transaction and any additional information concerning order flow will be disclosed upon written request.<br />\n<br />\n<strong>SEVERABILITY</strong><br />\n<strong>10.</strong>\nIf any provision, part thereof, or condition of this Agreement, or any Other 1st Discount Brokerage, Inc. Agreement, shall be held invalid or unenforceable by any court or regulatory body or agency or arbitrator thereof, such invalidity or unenforceability shall attach only to such provisions or conditions or any part thereof. The validity of the remaining provisions or parts shall not be affected thereby and this Agreement or Other 1st Discount Brokerage, Inc. Agreements shall be carried out as if such invalidity or unenforceable provision or condition were not contained herein. Furthermore, any ambiguities in language or intent of this Agreement or Other 1st Discount Brokerage, Inc. Agreements shall not be held or construed against 1st Discount Brokerage, Inc.<br />\n<br />')}]),angular.module("LPL/userAgreementText/content.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("LPL/userAgreementText/content.tpl.html",'<div class="doc">\n\t<h2>SUPPLEMENTAL TERMS AND CONDITIONS REGARDING<br>\n\tSELF-DIRECTED ON-LINE ACCOUNTS<br>\n\tAND THE LPL FINANCIAL TRADE DIRECT WEBSITE</h2>\n\t\n\t<p>These terms and conditions (“Terms and Conditions”) are made between LPL Financial (“LPL”) and you and govern your use of the LPL Trade Direct (self-directed) online account (“Account”) as made available to you through the LPL website along with any information, content, tools, products and services available through the LPL website (“LPL Website”). “You” and “your” refers to each account holder, who signs an enrollment form to open an Account. In the case of an entity, “you” and “your” refers to the entity, and by enrolling, the entity agrees that access to the Account shall be restricted to authorized representatives identified by you for such entity and that the entity will be liable for all acts or omissions of such authorized representatives in violation of these Terms and Conditions.</p>\n\t\n\t<p>By using or accessing your Account and the LPL Website, you accept and agree to be bound by these Terms and Conditions and the Account Application, Account Agreement and other account documentation. Your use of the LPL Website is governed by the version of the Terms and Conditions in effect on the date the LPL Website is accessed by you. Such Terms and Conditions shall be made available on the LPL Website. LPL may modify these Terms and Conditions and the use of the LPL Website at any time upon notice, delivered to you by regular mail, e-mail, or through the LPL Website. These Terms and Conditions are in addition to any other agreements between you and LPL, including any customer or account agreements, and any other agreements that govern your use of information, content, tools, products and services available on and through the LPL Websites. To the extent there is any conflict between the Terms and Conditions and any other agreement, the Terms and Conditions shall prevail.</p>\n\t\n\t<p>The Account is designed for U. S. investors who wish to self-direct their own investments. Neither LPL, nor any LPL representative, will provide any tax, legal or investment advice nor give any advice or offer any opinion regarding the suitability of any security, order, strategy or transaction in the Account. No Third Party Content, as defined below, nor any information regarding any security provided to LPL clients in general constitutes a recommendation to a specific client to purchase or sell any investment or effect any investment strategy. You agree that any investments you make through the Account, whether based on information obtained from LPL or otherwise, will be solely your own decisions and based on your own evaluation of your personal investment risk profile and your investment objectives. You also understand that it is solely your responsibility to monitor your investments in the Account and the Account’s market value on a regular basis and that LPL is not responsible for this monitoring.</p>\n\t\n\t<h3>1. APPLICABLE RULES &amp; REGULATIONS</h3>\n\t\n\t<p>All transactions in your Account are subject to the rules, customs and usages of the exchanges, markets or clearing houses where the transactions are executed and to all applicable federal and state laws and regulations and the rules and regulations of all applicable self-regulatory organizations (“Applicable Law”)</p>\n\t\n\t<h3>2. ACKNOWLEDGEMENTS</h3>\n\t\n\t<p>You understand that trading in volatile markets can present increased challenges and risks, which may include, among other things, the risk of market orders being executed at unexpectedly high prices. If you have limited assets to pay for a transaction, such as in a retirement account with contribution restrictions, you should consider placing a limit order. If you cannot pay for a transaction, LPL may be required to liquidate account assets at your risk.</p>\n\t\n\t<p>Delays in quotes, order execution and reporting. In volatile markets, transmission of quotes, orders, and execution reports may be delayed, even for information which appears to be real time. Security prices can change dramatically during such delays. In addition, it may not be possible to cancel an order previously submitted, even if you have received a confirmation that LPL has received your cancellation order. Access to the LPL Website and your Account can be delayed by factors such as high telephone volume or systems capacity limitations.</p>\n\t\n\t<h3>3. ACCOUNT ACCESS; SECURITY</h3>\n\t\n\t<p>The Account and LPL Website are made available to you via the internet using commercially available third-party web browsers. The Account and the Website permit you to view account data for your Account. By accessing the Account, you represent on a continuing basis that you are authorized to have viewing access to the Account. LPL will provide you with a user ID and password when you open your Account. You agree to safeguard the initial and any and all subsequent versions of your user ID and password. LPL shall not be responsible for any breach of security caused by your failure to maintain the confidentiality of your user ID and password. You agree to notify LPL immediately if you become aware of any loss, theft or unauthorized use of your user ID, password or account number; or any unauthorized use of the services or the market data. If you fail to notify LPL when any of the above conditions occur, neither LPL nor any of its directors, officers, employees, agents and affiliates (collectively, "Affiliates") shall have any responsibility or liability to any account holder or any other person claiming through any account holder for any claims with respect to the handling, mishandling or loss of any order or information. You agree to accept full responsibility for the monitoring of your Account with respect to all transactions entered in your Account.</p>\n\t\n\t<p>If you allow third parties to access your Account using your user ID and password, you agree to hold LPL, its Affiliates harmless and to indemnify LPL and Affiliates against any liability, costs or damages arising out of claims or suits by any account holder, including yourself, or such third parties based upon or relating to such access.</p>\n\t\n\t<h3>4. ORDER-ENTRY</h3>\n\t\n\t<p>Your Account allows you to place orders and obtain market data and other information via computer or other electronic means. You agree to accept full responsibility for all transactions entered through your Account and the monitoring of your account with respect to such transactions. LPL may, in its sole discretion, remove particular securities from the list of securities that can be purchased using electronic services for any reason including, but not limited to, volatility or other market factors. Any orders communicated through your Account will be considered to have been sent and authorized by you. You agree to notify LPL immediately if you (i) fail to receive a message that an order you initiated through your Account has been received or executed, (ii) fail to receive an accurate written confirmation of an order or its execution with ten (10) business days, or (iii) receive confirmation of an order that you did not place. If you fail to notify LPL when any of the foregoing conditions occur, neither LPL nor any of its Affiliates shall have any responsibility or liability to any account holder or any other person claiming through any account holder for any claims with respect to the handling, mishandling or loss of any order or information.</p>\n\t\n\t<p>The order entry functionality is not designed to be a brokerage service for pattern day traders or for investors who trade in: (i) low-priced stocks that trade on either the OTC Bulletin Board (OTCBB) or Pink Sheets. These securities do not trade on any exchange (unlisted) and typically trade below $5.00 per shares and in many cases under $1.00) ; or (ii) foreign securities. Your Account is intended to be available for order entry seven (7) days a week, twenty four (24) hours a day, except for brief maintenance periods; however, LPL does not warrant that the order-entry functionality will be uninterrupted. Orders sent outside of regular U.S. market hours will be held and entered during market hours on the next trading day. Certain orders may be blocked or subject to pre-review by LPL which may take up to several minutes to process.</p>\n\t\n\t<p>All orders entered in your Account shall be subject to any limitations or restrictions that may be imposed by Applicable Law including any rules or regulations requiring the suspension or cancellation of orders in certain circumstances. Whether or not funds are available in your Account on trade date, you agree to pay by settlement date for any trade placed in your Account. LPL reserves the right to place restrictions on your Account in its sole discretion, and to cancel any order that we believe may violate LPL policies and procedures and/or Applicable Law; however, LPL will have no responsibility or liability for failing to cancel any order.</p>\n\t\n\t<h3>5. THIRD PARTY CONTENT</h3>\n\t\n\t<p>The LPL Website may provide access to general news and information, commentary, interactive tools, quotes, research reports and data concerning the financial markets, securities and other topics (“Third Party Content”). Some of this content is provided by companies that are not affiliated with LPL ("Third Party Content Providers"). The Third Party Content is protected by copyright pursuant to United States laws and international treaties and is owned or licensed by the Third Party Content Provider(s) credited. All Third Party Content may only be used for personal and non-commercial use, and not for providing, among other things, professional investment advice or for providing securities processing services or other similar back office functions.</p>\n\t\n\t<p>LPL has not been involved in the preparation, adoption or editing of Third Party Content and does not explicitly or implicitly endorse or approve such content. Further, the Third Party Content Providers do not give investment advice, or advocate the purchase or sale of any security or investment. Third Party Content also does not constitute investment advice, or a solicitation by LPL or the Third Party Content Providers for the purchase or sale of any securities, or a representation that any securities are suitable for you. LPL believes the Third Party Content is obtained from reliable sources but cannot guarantee the accuracy, timeliness, usefulness or completeness of such information for any particular purpose including any advertising, products, or other materials on or available from third party sites.</p>\n\t\n\t<p>If you download any information from the LPL Website for your personal reference, including, but not limited to, Third Party Content, you agree that you will not remove or obscure any copyright or other notices contained in any such information. Except as provided in the preceding sentence, you agree not to copy, reproduce, modify, sell, distribute, transmit, display, perform, circulate, transfer, broadcast, create derivative works from, publish, or use for any commercial or unlawful purpose any quotes, news, research, text, images, audio, video or other information you receive through the LPL Website. You acknowledge that any securities prices, quotations, research, ratings, news and other information provided by Third Party Content Providers is and shall remain the property of the respective Third Party Content Providers or of the market on which a reported transaction took place or a reported quotation was entered and you acknowledge that the Third Party Content Providers are third-party beneficiaries under these provisions and may enforce these provisions against you. LPL and its licensors and Third Party Content Providers may change or discontinue any Third Party Content at any time provided through the LPL Website.</p>\n\t\n\t<p>LPL, AFFILIATES AND THE THIRD PARTY CONTENT PROVIDERS AND THEIR RESPECTIVE PARENTS, SUBSIDIARIES, AFFILIATES, SERVICE PROVIDERS, LICENSORS, OFFICERS, DIRECTORS OR EMPLOYEES SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THE USE OR THE INABILITY TO USE THE THIRD PARTY CONTENT, INCLUDING BUT NOT LIMITED TO DAMAGES FOR LOSS OF PROFITS, USE, DATA OR OTHER INTANGIBLE DAMAGES, EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE THIRD PARTY CONTENT IS PROVIDED ON AN "AS-IS" BASIS. LPL, AFFILIATES, THE THIRD PARTY CONTENT PROVIDERS AND THEIR RESPECTIVE PARENTS, SUBSIDIARIES, AFFILIATES, SERVICE PROVIDERS, LICENSORS, OFFICERS, DIRECTORS OR EMPLOYEES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT</p>\n\t\n\t<h3>6. INVESTMENT TOOLS</h3>\n\t\n\t<p>The LPL Website may also provide you with financial planning tools and educational content, including investment calculators. The tools and calculators may allow you to model "what-if" scenarios for various financial goals, the results of which are illustrative and are based on the information and assumptions identified. There is no guarantee that the results shown will be achieved and changes in tax laws, financial markets or your financial situation may cause actual results to deviate substantially from those reflected in these tools. In addition, these tools and calculators are not part of any financial planning report for which you may have paid a fee, even if the tools and calculators include information derived from or contained in the financial planning report.</p>\n\t\n\t<h3>7. EMAIL</h3>\n\t\n\t<p>Due to inherent limitations of e-mail and voice-mail (such as reliability of delivery, timeliness, security, etc.), you agree that you will not use e-mail or voice-mail to request, authorize or effect the purchase or sale of any securities or other investments, to send funds transfers instructions, or for any other financial transactions that require real-time communication or more formal written authorization in accordance with Applicable Law or LPL policies and procedures. Any such requests, orders, or instructions that you send in contravention of the foregoing agreement will not be accepted and will not be processed. LPL will not be responsible for any loss or damage that could result from your requests, orders or instructions not being accepted or processed in accordance with the preceding sentence.</p>\n\t\n\t<p>For security reasons, you should not send any personal or identifying information, such as account numbers, credit card numbers, Social Security numbers, passwords, etc., via e-mail. LPL will not be responsible for any loss or damage that could result from interception by third parties of any information you send via email. All e-mail messages sent by you to LPL or to you from LPL will be recorded and archived and are available for review by LPL’s managers and compliance personnel as well as by LPL\'s regulatory examiners. If you provide us with your e-mail address, you grant us the permission to communicate with you by e-mail on occasion to transmit information about LPL products and services. You acknowledge and agree that LPL makes no representations or warranties regarding the security of information transmitted to you or from you through electronic means.</p>\n\t\n\t<h3>8. THIRD PARTY LINKS</h3>\n\t\n\t<p>LPL may make available links from the LPL Website to other, third-party websites or electronic services providers that are not affiliated with LPL. LPL does not control these other websites or services, and LPL makes no representations or endorsements whatsoever concerning those websites or services. The fact that LPL has provided a link to a website is not an endorsement, authorization, sponsorship, or affiliation with respect to such website, its owners, or its providers. There are risks in using any information, software, service or product found on the Internet, and LPL cautions you to make sure you understand these risks before retrieving, using, or relying upon anything via the Internet. You agree that LPL will not be liable for any loss or damage caused by use of or reliance on any content, goods or services available on such other websites.</p>\n\t\n\t<h3>9. ACCOUNT ACTIVITY</h3>\n\t\n\t<p>All daily account data is provided as a convenience and for your information, but it is not the official record of your account activity with LPL; your LPL account statement provided to you either in paper format or online each month is such official record. Account data provided through the LPL Website is generally updated as of the prior business day’s close of business, but is subject to adjustment and correction.</p>\n\t\n\t<p>In addition to retaining the sole responsibility for investment decisions, you understand and agree that you are responsible for knowing the rights and terms of all securities in your Account, specifically including valuable rights that expire unless the holder takes action. This includes, but is not limited to, warrants, stock rights, convertible securities, bonds, and securities subject to a tender or exchange offer. You understand and agree that LPL accepts no obligation to notify you of any upcoming expiration or redemption dates, or, except as required by Applicable Law or regulation, to take any action on your behalf without specific instructions from you. You also agree that all dividends and interest payments credited to your Account shall accumulate rather than be paid to you upon receipt, but shall be subject to your withdrawal from time to time upon request for a check or other funds transfer.</p>\n\t\n\t<h3>10. FEES</h3>\n\t\n\t<p>You agree to be liable for any and all fees, charges or expenses that LPL may charge or you may incur in connection with your Account by you or any other person through use of your user ID and password. You understand that the rates, fees, billing and terms governing services provided by mobile device providers may be determined solely by such third party.</p>\n\t\n\t<h3>11. LIABILITY</h3>\n\t\n\t<p>LPL DOES NOT WARRANT THE LPL WEBSITE FOR ANY PARTICULAR PURPOSE. LPL, AFFILIATES, AND THIRD PARTY CONTENT PROVIDERS WILL NOT BE LIABLE OR HAVE ANY RESPONSIBILITY OF ANY KIND FOR ANY LOSS OR DAMAGE THAT YOU MAY INCUR IN THE EVENT OF ANY FAILURE OR INTERRUPTION OF THE LPL WEBSITE, OR RESULTING FROM THE ACT OR OMISSION OF ANY OTHER PARTY INVOLVED IN MAKING THE LPL WEBSITE AVAILABLE TO YOU, OR FROM ANY OTHER CAUSE RELATING TO YOUR ACCESS TO OR USE OF THE LPL WEBSITE, WHETHER OR NOT THE CIRCUMSTANCES GIVING RISE TO SUCH CAUSE MAY HAVE BEEN WITHIN THE CONTROL OF LPL OR OF ANY THIRD PARTY PROVIDING SOFTWARE OR SERVICES SUPPORT FOR THE LPL WEBSITE INCLUDING, AMONG OTHER THINGS, FAILURE OF ELECTRONIC OR MECHANICAL EQUIPMENT OR COMMUNICATIONS LINES (INCLUDING TELEPHONE, CABLE AND INTERNET), UNAUTHORIZED ACCESS, VIRUSES, THEFT, OPERATOR ERRORS, SEVERE OR EXTRAORDINARY WEATHER (INCLUDING FLOOD, EARTHQUAKE, OR OTHER ACT OF GOD), FIRE, WAR, INSURRECTION, TERRORIST ACT, RIOT, LABOR DISPUTE AND OTHER LABOR PROBLEMS, ACCIDENT, EMERGENCY OR ACTION OF GOVERNMENT. YOU UNDERSTAND AND AGREE THAT THE LPL WEBSITE UTILIZES THE INTERNET TO TRANSPORT DATA AND COMMUNICATIONS, AND, WHILE LPL TAKES REASONABLE SECURITY PRECAUTIONS TO SAFEGUARD DATA AND COMMUNICATIONS, LPL, AFFILIATES AND THIRD PARTY CONTENT PROVIDERS DISCLAIMS ANY LIABILITY FOR INTERCEPTION AND/OR SUBSEQUENT USE OF ANY SUCH DATA OR COMMUNICATIONS.</p>\n\t\n\t<p>TO THE FULLEST EXTENT PERMITTED UNDER APPLICABLE LAW, LPL, AFFILIATES AND THIRD PARTY CONTENT PROVIDERS WILL NOT BE LIABLE TO YOU OR ANYONE ELSE FOR ANY CONSEQUENTIAL, INCIDENTAL, SPECIAL, DIRECT, OR INDIRECT DAMAGES (INCLUDING BUT NOT LIMITED TO LOST PROFITS, TRADING LOSSES OR DAMAGES THAT RESULT FROM USE OR LOSS OF USE OF THE LPL WEBSITE AND THIRD PARTY CONTENT, INCONVENIENCE OR DELAY). THIS IS TRUE EVEN IF LPL, AFFILIATES AND/OR THIRD PARTY CONTENT PROVIDERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR LOSSES.</p>\n\t\n\t<h3>12. INDEMNITY</h3>\n\t\n\t<p>As a condition of your use of your Account and the LPL Website, you agree to indemnify and hold LPL, Affiliates and any Third Party Content Provider harmless from and against any and all claims, losses, liability, costs and expenses (including but not limited to attorneys\' fees) arising from your use of the Account and the LPL Website, or from your violation of these Terms and Conditions.</p>\n\t\n\t<p>&nbsp;</p>\n\t\n\t<p>One Beacon Street, 22nd Floor, Boston, Massachusetts 02108-3106<br>\n\t9785 Towne Centre Drive, San Diego, California 92121<p>\n</div>')}]),angular.module("RWB/balanceListGrid/balanceListGrid.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("RWB/balanceListGrid/balanceListGrid.tpl.html",'<div class="svi-balance-list-grid" data-ng-show="balances">\n\t<table class="table table-striped svi-balance-list-grid-table">\n\t\t<thead>\n    \t<tr>\n\t\t\t<th data-ng-if="columns.account" data-svi-column-header data-event-id="BALANCE_LIST" data-sortable="{{sortable}}" data-sort-field="accountBalance.account" data-text="labels.account" data-sorted-field="sortField" data-sorted-dir="sortDir"></th>\n\t\t\t<th data-ng-if="columns.accountNickname" data-svi-column-header data-event-id="BALANCE_LIST" data-sortable="{{sortable}}" data-sort-field="accountBalance.accountNickname" data-text="labels.accountNickname" data-sorted-field="sortField" data-sorted-dir="sortDir"></th>\n\t\t\t<th data-ng-if="columns.accountValue" data-svi-column-header data-event-id="BALANCE_LIST" data-sortable="{{sortable}}" data-sort-field="accountBalance.accountValue" class="currency" data-text="labels.accountValue" data-sorted-field="sortField" data-sorted-dir="sortDir"></th>\n\t\t</tr>\n    \t</thead>\n    <tbody>\n\t    <tr data-ng-repeat="item in balances.accountBalances">\n\t\t\t<td data-ng-if="columns.account && !getAccountUrl(item.accountBalance.accountIndex)" data-ng-bind="item.accountBalance.account"></td>\n\t\t\t<td data-ng-if="columns.account && getAccountUrl(item.accountBalance.accountIndex)"><a data-ng-href="{{getAccountUrl(item.accountBalance.accountIndex)}}" data-ng-bind="item.accountBalance.account"></a></td>\n\t\t\t<td data-ng-if="columns.accountNickname" data-ng-bind="item.accountBalance.accountNickname"></td>\n\t\t\t<td data-ng-if="columns.accountValue" class="currency" data-ng-bind="item.accountBalance.accountValue|sviCurrency:null:null:0"></td>\n    \t</tr>\n\t    <tr class="totals">\n\t\t\t<td data-ng-if="columns.account" data-ng-bind="labels.totals"></td>\n\t\t\t<td data-ng-if="columns.accountNickname" ></td>\n\t\t\t<td data-ng-if="columns.accountValue" class="currency" data-ng-bind="balances.totals.accountBalance.accountValue|sviCurrency:null:null:0"></td>\n\t    </tr>\n    </tbody>\n  </table>\n</div>')}]),angular.module("RWB/holdingsContainer/holdingsContainer.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("RWB/holdingsContainer/holdingsContainer.tpl.html",'<div class="row svi-directive svi-holdings-container">\n    <div class="col-md-12" data-svi-loader data-callback="setLoader"></div>\n    <div class="col-md-12" data-ng-show="holdings">\n        <div class="row holdings-grand-totals">\n            <h5 class="grand-totals-item currency totalMarketValue" data-ng-show="holdings.grandTotals.marketValue" data-ng-if="showTotalMarketValue">\n                <span data-ng-bind="labels.totalMarketValue"></span>:\n                <span class="securitiesValue" data-ng-bind="holdings.grandTotals.marketValue|sviCurrency"></span>\n            </h5>\n            <h5 class="grand-totals-item currency totalSecurities" data-ng-show="holdings.grandTotals.securities" data-ng-if="showTotalSecurities">\n                <span data-ng-bind="labels.totalSecurities"></span>:\n                <span class="securitiesValue" data-ng-bind="holdings.grandTotals.securities|sviCurrency"></span>\n            </h5>\n            <h5 class="grand-totals-item currency totalMarketValueChange" data-ng-if="showTotalMarketValueChange">\n                <span data-ng-bind="labels.totalMarketValueChange"></span>:\n                <span class="securitiesValue" data-ng-bind-html="holdings.grandTotals.marketValueChange|currencyChange"></span>\n            </h5>\n        </div>\n        <div class="row paging-top" data-ng-show="pageSize && showPaging">\n            <div class="col-md-12" data-svi-paging-control data-event-id="HOLDINGS" data-current-page="currentPage" data-total-pages="totalPages"></div>\n        </div>\n        <div class="row" data-ng-if="!assetView">\n            <div class="col-md-12" data-svi-holdings-grid\n                 data-columns="columns"\n                 data-totals-config="totalsConfig"\n                 data-column-priority="columnPriority"\n                 data-responsive-columns="{{::responsiveColumns}}"\n                 data-holdings="holdings.positions"\n                 data-classification-type-colors="{{holdings.classificationTypeColors.assetCategoryMulti}}"\n                 data-asset-classification-enabled="{{assetClassificationEnabled}}"\n                 data-sort-field="sortField"\n                 data-sort-dir="sortDir"\n                 data-sortable="sortable"\n                 data-show-totals="showTotals"\n                 data-is-multi-account="isMultiAccount"\n                 data-multi-account-gain-loss="{{multiAccountGainLoss}}"\n                 data-holdings-label-set="holdingsLabelSet"></div>\n        </div>\n        <div class="row" data-ng-if="assetView" data-ng-repeat="assetType in holdings.assetTypes">\n            <div data-ng-if="assetType && holdings.positions[assetType]" class="col-md-12" data-svi-holdings-grid\n                 data-columns="columns"\n                 data-totals-config="totalsConfig"\n                 data-column-priority="columnPriority"\n                 data-responsive-columns="{{::responsiveColumns}}"\n                 data-holdings="holdings.positions[assetType]"\n                 data-classification-type-colors="{{holdings.classificationTypeColors.assetCategoryMulti}}"\n                 data-asset-type="{{assetType}}"\n                 data-title="{{assetType}}"\n                 data-sort-field="sortField"\n                 data-sort-dir="sortDir"\n                 data-sortable="sortable"\n                 data-show-totals="showTotals"\n                 data-is-multi-account="isMultiAccount"\n                 data-multi-account-gain-loss="{{multiAccountGainLoss}}"\n                 data-asset-classification-enabled="{{assetClassificationEnabled}}"\n                 data-holdings-label-set="holdingsLabelSet"></div>\n        </div>\n        <div class="row paging-botom" data-ng-show="pageSize && showPaging">\n            <div class="col-md-12" data-svi-paging-control data-event-id="HOLDINGS" data-current-page="currentPage" data-total-pages="totalPages"></div>\n        </div>\n    </div>\n</div>')}]),angular.module("RWB/marketIndicesChart/marketIndicesChart.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("RWB/marketIndicesChart/marketIndicesChart.tpl.html",'<div class="svi-market-indices-chart" data-svi-widget data-title="labels.marketIndicesTitle" data-min-size="16" data-max-size="16">\n\t<svi:widget-front>\n\t\t<div class="list-body" data-ng-if="marketUrl">\n\t\t\t<ul class="list-group">\n\t\t\t\t<li class="list-group-item">\n\t\t\t\t\t<iframe\n\t\t\t\t\t\t\tsrc="{{marketUrl}}"\n\t\t\t\t\t\t\tframeborder="0"\n\t\t\t\t\t\t\theight="{{iframeHeight}}"\n\t\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\t\tscrolling="no"\n\t\t\t\t\t></iframe>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</svi:widget-front>\n</div>')}]),angular.module("RWB/portfolioSummary/portfolioSummary.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("RWB/portfolioSummary/portfolioSummary.tpl.html",'<div class="svi-directive svi-portfolio-summary row" data-ng-class="{\'return-since-enabled\': showReturnSince, \'return-since-disabled\': !showReturnSince}">\n    <div data-svi-loader data-callback="setLoader"></div>\n    <div data-ng-show="loaded" class="portfolio-summary-container">\n        <div class="portfolio-summary-item" data-ng-show="loaded">\n            <h5 data-ng-bind="labels.portfolioSummaryTotalPortfolioValue"></h5>\n            <h1 data-ng-bind="marketValue|sviCurrency:null:null:0"></h1>\n        </div>\n        <div class="portfolio-summary-item" data-ng-show="loaded">\n            <h5 data-ng-bind="labels.portfolioSummaryDayChange"></h5>\n            <h3 class="{{{true: \'downtick\', false: \'uptick dropup\'}[isDowntick]}}">\n                <span class="caret"></span>\n                <p data-ng-bind-html="marketValueChange|currencyChange:null:null:0"></p>\n                <p class="dayChangePercent" data-ng-bind-html="percentChange|percentChange:2:true"></p>\n            </h3>\n        </div>\n        <div class="portfolio-summary-item" data-ng-show="loaded && showReturnSince">\n            <h5>Return Since Yesterday</h5>\n            <h3>\n                <span class="caret"></span>\n                TO DO\n            </h3>\n        </div>\n        <div class="portfolio-summary-item" data-ng-show="loaded">\n            <h5 data-ng-bind="labels.portfolioSummaryCash"></h5>\n            <h3 data-ng-bind="cash|sviCurrency:null:null:0"></h3>\n        </div>\n\t\t<div class="portfolio-summary-item">\n\t\t\t<button type="button" data-ng-if="buttonConfiguration" class="btn btn-info portfolio-summary-button" data-ng-click="triggerButtonEvent()" data-ng-bind="buttonConfiguration.label"></button>\n\t\t</div>\n    </div>\n</div>')}]),angular.module("STF/userAgreementText/content.tpl.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("STF/userAgreementText/content.tpl.html",'<div class="userAgreement">\n\t<br>\n\t<div class="cos-heading">CLIENT ONLINE SERVICES ACCESS AGREEMENT &#8211; TERMS OF USE</div>\n\t<div class="cos-text">\n\t\t<ol type="1" class="decimal">\n\t\t\t<li><span>Please carefully read this Client Online Services Access Agreement (&ldquo;Agreement&rdquo;), which contains the terms and conditions to which you (&ldquo;Client(s)&rdquo;) must agree before using any electronic information access services offered by Stifel (&ldquo;Client Online Services&rdquo;). As used herein, &ldquo;Stifel&rdquo; may mean Stifel Financial Corp. and/or any of its wholly owned subsidiaries, including Stifel, Nicolaus & Company, Incorporated and Stifel Bank & Trust, and introducing brokerages. In this Agreement, the pronouns &ldquo;we,&rdquo; &ldquo;our,&rdquo; &ldquo;us,&rdquo; and similar words will refer to Stifel.  The pronouns &ldquo;you,&rdquo; &ldquo;your,&rdquo; and similar words will refer to you as the Client.</span></li>\n\t\t\t<li><span>Client Online Services includes certain personal information retrieval and management services made available to you by Stifel or other third parties that allow you to, among other things, obtain information concerning your account(s) with Stifel and/or accounts you may have with other third-party institutions, obtain quotation and other information, and for certain qualified users, enter orders in their Stifel account(s) to buy and sell certain types of securities. Certain of these services will be provided by Stifel and may contain information sourced by other third parties, and/or are offered in conjunction with one of Stifel&rsquo;s third-party vendors, and may be offered by Stifel under the current Stifel service mark, &ldquo;My Financial Snapshot&rdquo; (collectively defined as the &ldquo;Client Online Services&rdquo;). Stifel has adopted certain measures, such as the use of passwords and client identification numbers, to secure transactions and information communicated or stored electronically. However, Stifel cannot guarantee the privacy, security, or authenticity of your communication with Client Online Services. Accordingly, you are solely responsible for assessing whether use of Client Online Services or the Internet is adequately secure to meet your needs.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>ACCEPTANCE OF TERMS</p>\n\t\t\t</div>\n\t\t\t<li><span>By using Client Online Services, you acknowledge that you consent to receive this Agreement in electronic form and that you have read and agree to be bound by the terms of this Agreement. If you do not accept the terms of this Agreement, you will not be entitled to use Client Online Services.</span></li>\n\t\t\t<li><span>Except as otherwise required by law, we may, in our sole discretion, change the terms of this Agreement from time to time and at any time. This may include adding new or different terms, or removing terms from this Agreement. If you continue to use Client Online Services thereafter, your continued use constitutes acceptance of all revised terms and your agreement to be bound to the Agreement, as amended. If you do not agree to the changes, your only recourse is to stop using Client Online Services, and you agree to discontinue your use of Client Online Services. You may access the current Agreement in effect at any time by clicking on the User Agreement footer link on Stifel Client Online Services or by calling your Stifel financial advisor.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>CONFLICTS BETWEEN AGREEMENTS</p>\n\t\t\t</div>\t\t\n\t\t\t<li><span>If this Agreement conflicts with any other agreements related to your Stifel account(s) or the other agreements include terms that are not addressed in this Agreement, then the other agreements will control and take precedence, unless this Agreement specifically states otherwise. The other agreements will only control to the extent necessary to resolve the conflict or inconsistency. Additional provisions of other agreements regarding your Stifel account(s) that do not appear in this Agreement will continue to apply.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>DESCRIPTION OF CLIENT ONLINE SERVICES</p>\n\t\t\t</div>\t\t\t\t\n\t\t\t<li><span>Client Online Services is an information retrieval and management service that allows a User to, among other things, view, consolidate, and manage (i) information concerning their Stifel account(s) (&ldquo;Stifel Account Information&rdquo;) and/or (ii) information concerning their accounts at other institutions or third parties that is accessible via third-party account providers&rsquo; web sites (&ldquo;Account Information from Third-Party Sites&rdquo;). Quovo, Inc. (&ldquo;Quovo&rdquo;) is an unaffiliated Vendor of Stifel that can provide Stifel with access to Users&rsquo; data from such third-party account providers&rsquo; web sites (&ldquo;Third-Party Sites&rdquo;). If you choose and at your direction, Stifel or Quovo will obtain your Account Information from Third-Party Sites and make it available to view along with your Stifel Account Information on Stifel web sites and through a variety of web-based tools that Stifel may make available on its web sites. Client Online Services is provided strictly as a convenience and is not, nor shall it be considered, a substitute or replacement for account statements or other documentation provided by Stifel or third-party account providers. Please consult your official account statements for information regarding your account balances, positions, and transactions.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>THIRD-PARTY INFORMATION, CONTENT, PRODUCTS, AND SERVICES</p>\n\t\t\t</div>\t\t\t\t\n\t\t\t<li><span>We use one or more unaffiliated third-party service providers (&ldquo;Vendors&rdquo;) to act on our behalf in maintaining Client Online Services and to facilitate your use of Client Online Services. You agree that we have the right under this Agreement to delegate to Vendors all of the rights and performance obligations that we have under this Agreement, and that the Vendors will be third-party beneficiaries of this Agreement and will be entitled to all the rights and protections that this Agreement provides to us. We and our Vendors may share with each other information about you and your account(s) for the purpose of providing Client Online Services. All of our Vendors are required to implement measures to protect the privacy and security of your non-public personal information.</span></li>\n\t\t\t<li><span>Other than the Stifel Account Information, all other account information available through Client Online Services is provided by third parties. Stifel makes no effort to review the content or terms of use of any Third-Party Sites, including, but not limited to, the accuracy, validity, legality, copyright compliance, or decency of the content contained on these sites. You acknowledge that Stifel does not pre-screen content, but that Stifel and our designees have the right (but not the obligation) in our or their sole discretion to refuse, edit, move, or remove any content that may be available via Client Online Services. Stifel is not responsible for, nor does it recommend, endorse, or validate in any way, the information, products, and services on or available through Third-Party Sites, or any issues you may have related to your access to or use of Third-Party Sites via Client Online Services or otherwise. Reliance on any information contained on Third-Party Sites that may be accessible to you through Client Online Services is solely at your own risk. Your use of the Third-Party Sites is governed by the terms of use posted on such Third-Party Sites, including the privacy policies of such sites, and may differ from those described on a Stifel site, including, without limitation, Stifel.com. The information and content provided via Client Online Services is for informational purposes only and should not be construed as an offer to sell, a solicitation to buy, or a recommendation of any security or other investment by Stifel. You acknowledge that you must perform your own evaluation of any investment based on your investment objectives, financial resources, and risk tolerance.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>SERVICE LIMITATIONS</p>\n\t\t\t</div>\t\t\t\n\t\t\t<li><span>Technical or other service difficulties may result in loss of data, personalization settings, or other service interruptions. Stifel is not responsible for the timeliness, accuracy, deletion, error in delivery, or failure to store any user data, communications, or personalization settings. For example, when displayed through Client Online Services, the Stifel Account Information and Account Information from Third-Party Sites will only be as current as when the data was sourced, as opposed to when presented to you through Client Online Services. Such information may be more up-to-date when obtained directly from the relevant sites. You acknowledge and agree that the timeliness, sequence, accuracy, or completeness of any information provided by or through Client Online Services is not guaranteed by Stifel or any of its affiliates, subsidiaries, or information providers, nor are any warranties given with regards to the results obtained from its use.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>RIGHT TO CHANGE</p>\n\t\t\t</div>\t\t\t\n\t\t\t<li><span>Stifel reserves the right to modify, change, or cease providing access to Client Online Services, in whole or in part, including but not limited to any of the content or Third-Party Sites that may be available through Client Online Services, at any time and without prior notice.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>PRIVACY</p>\n\t\t\t</div>\t\t\t\n\t\t\t<li><span>Stifel is committed to maintaining the privacy and security of its customers&rsquo; personal information. Stifel&rsquo;s commitment to privacy is reflected in Stifel&rsquo;s Privacy Policy available at: <a href="http://www.stifel.com/docs/pdf/Disclosures/Privacy/statement.pdf">http://www.stifel.com/docs/pdf/Disclosures/Privacy/statement.pdf</a>.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>CANCELLATION</p>\n\t\t\t</div>\t\t\t\n\t\t\t<li><span>You have the option to discontinue your access to Client Online Services at any time. You may also separately disable the option to include Account Information from Third-Party Sites through Client Online Services by: (i) deleting all of the accounts you had previously identified for inclusion in Client Online Services, or (ii) contacting Stifel in writing.</span></li>\t\t\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>YOUR USE OF CLIENT ONLINE SERVICES</p>\n\t\t\t</div>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>ACCESS CREDENTIALS</p>\n\t\t\t</div>\n\t\t\t<li><span>Client Online Services, and any or all related products or services, are to be used exclusively by the authorized User or his or her authorized agents under this Agreement. You are responsible for any orders entered through Client Online Services in your account using your password, client identification number, or other verification code. You agree that you shall use quotes, and any and all other financial information obtained from Client Online Services, solely for your personal use. You may not report, reproduce, publish, distribute, retransmit, sell, or publicize any part of the information derived from using Client Online Services. You agree not to allow any other person or entity to access your account for any purpose, including order entry, account inquiry, to obtain quotes, or to access other financial market information.</span></li>\n\t\t\t<li><span>You are solely responsible for keeping your access identification, including your account number, password, client identification number, or other verification codes confidential. Further, you are responsible for all activities that occur in connection with such access credentials, including all instructions electronically transmitted, or any data or information obtained using your access credentials. Neither Stifel nor any of its third-party Vendors shall be under any duty to inquire as to the authority or propriety of any instructions provided by you or via your access credentials, and shall be entitled to act upon any such instructions. Neither Stifel nor its third-party Vendors shall be liable for any loss, cost, expense, or other liability arising out of any such instructions. Accordingly, you should take steps to protect the confidentiality of your access credentials. As an authorized User of the Service, you accept full responsibility for the monitoring of your accounts. The access Stifel grants to you to use Client Online Services is personal to you. You may not resell or make any commercial use of Client Online Services.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>YOUR OBLIGATION TO NOTIFY STIFEL</p>\n\t\t\t</div>\n\t\t\t<li><span>You agree to notify Stifel immediately if you become aware of:</span>\n\t\t\t\t<p><span>(i)</span>Loss or theft of your password, client identification number, account number, or other verification code;</p>\n\t\t\t\t<p><span>(ii)</span>Any unauthorized use of your password, client identification number, account number, or verification code, or any unauthorized use of Client Online Services or information obtained from use of Client Online Services;</p>\n\t\t\t\t<p><span>(iii)</span>Receipt of a confirmation for an order you did not enter or that has terms that differ from those of an order you did enter;</p>\n\t\t\t\t<p><span>(iv)</span>Receipt of any reports or financial information that you did not request;</p>\n\t\t\t\t<p><span>(v)</span>Any failure to receive a reference number for any order you initiated through Client Online Services; or</p>\n\t\t\t\t<p><span>(vi)</span>Any failure to receive within five (5) business days a written confirmation of any executed orders you entered through Client Online Services.</p>\n\t\t\t\t<p><span>(vii)</span>You agree to cooperate with Stifel in any investigation it may undertake with respect to the use of Client Online Services related to your account(s).</p>\n\t\t\t\t<p><span>(viii)</span>You further agree that, if you fail to notify Stifel regarding a confirmation described in subparagraph (iii) above, you will be deemed to have agreed to the terms of the execution set forth on the confirmation. You also agree that, if you do not notify Stifel of any failure to receive a reference number or confirmation of an executed order as provided above, you will be deemed to have agreed to the execution, if any, you actually received.</p>\n\t\t\t</li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>ORDER EXECUTION, VALIDATION, AND ACCEPTANCE</p>\n\t\t\t</div>\n\t\t\t<li><span>Orders entered through Client Online Services are subject to edit, validation, and acceptance by Stifel. This is for your protection but can delay execution of your order. Upon validation and acceptance, your order is routed to the Stifel trading desk, an exchange, or other market center for execution.</span></li>\n\t\t\t<li><span>If you enter a market order, you understand that the execution price you receive may be higher or lower than the quotes or prices for the security at the time you entered the order. Likewise, if you enter an order at a specified price (a &ldquo;limit&rdquo; order), you understand that you are subject to the risk that the order may not be executable at the limit price, even if that price appears to be available at the time you entered the order using Client Online Services.</span></li>\n\t\t\t<li><span>Any orders that cannot be accepted are &ldquo;rejected.&rdquo; If an order is rejected, Stifel will attempt to notify you (by phone or fax) at the number you have provided us in the &ldquo;Preferences&rdquo; sections of Client Online Services. However, you agree to monitor the status of your order until the transaction is rejected or an execution is confirmed.</span></li>\n\t\t\t<li><span>You understand and agree that all the terms and conditions of any of your Customer Agreement(s) with Stifel, including margin and options agreements, apply to your use of Client Online Services in connection with your account.</span></li>\n\t\t\t<li><span>Stifel may reject any order or prevent you from using Client Online Services to place an order, as it deems necessary, in its sole discretion, to comply with industry regulations or Stifel&rsquo;s internal policies, or for any other reason. You understand that Stifel also reserves the right to establish limits for use of Client Online Services and all other products and services. Furthermore, Stifel reserves the right, in its sole discretion, to request a deposit of cash or securities into your account before executing any order entered via Client Online Services. Stifel is not responsible, and you agree not to hold Stifel liable, for any delay or failure to execute any order.</span></li>\n\t\t\t<li><span>You agree that any orders you place, and any investments you maintain, through Client Online Services, are your own investment choices and are based on an independent evaluation by you of your investment experience, knowledge, financial means, investment objectives, risk tolerance, and investment time horizon. Although numerous research and other market information services may be made available to you through Stifel (which may or may not assist you in your investment decisions) you agree that all orders are solely your decision and have not been solicited by Stifel or any of its information providers. You understand and agree that Stifel has not made any evaluation of the suitability for you of any order or provided tax or legal advice with respect to any order or investment.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>YOUR OBLIGATION TO PROVIDE ACCURATE INFORMATION</p>\n\t\t\t</div>\n\t\t\t<li><span>If you enable the option to view Account Information from Third-Party Sites though Client Online Services, you understand and agree to provide true, accurate, current, and complete information about yourself and your accounts maintained at Third-Party Sites, as requested as part of the registration and account setup process. You agree not to misrepresent your identity or your account information. In order for Client Online Services to function effectively with respect to Account Information from Third-Party Sites, you understand that you must keep your registration and account information current.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>OBEY THE LAW</p>\n\t\t\t</div>\n\t\t\t<li><span>You may not use Client Online Services for illegal purposes or for the transmission of material that is unlawful, harassing, libelous (untrue and damaging to others), invasive of another&rsquo;s privacy, abusive, threatening, obscene, or that infringes the rights of others.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>PROPRIETARY RIGHTS</p>\n\t\t\t</div>\n\t\t\t<li><span>You acknowledge and agree that all trademarks and service marks displayed on the Client Online Services screens belong to Stifel or an affiliate, except third-party trademarks and service marks, if any, which are the property of their respective owners. You are only permitted to use the content as displayed on this site as expressly authorized by Client Online Services. You may not copy, reproduce, distribute, or create derivative works from this content. Further, you may not reverse engineer or reverse compile any of Stifel&rsquo;s or its third-party Vendors&rsquo; technology, including but not limited to, any Java applets associated with Client Online Services.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>RIGHTS THAT YOU GRANT TO US</p>\n\t\t\t</div>\t\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>INFORMATION AND CONTENT THAT YOU PROVIDE</p>\n\t\t\t</div>\n\t\t\t<li><span>You hereby license to Stifel and its applicable third-party Vendor(s) any information, data, passwords, usernames, other log-in information, materials, or other content (collectively, &ldquo;Content&rdquo;) you provide through Client Online Services, and Stifel, its affiliates, and applicable third-party Vendor(s) may use, modify, display, distribute, and create new material using such Content, subject to Stifel&rsquo;s privacy policy, as it may change from time to time. By submitting Content, you represent that you are entitled to submit such content and Stifel may use it without the payment of any fees and without any time limitation.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>ACCOUNT INFORMATION FROM THIRD-PARTY SITES</p>\n\t\t\t</div>\n\t\t\t<li><span>If you enable the option to view Account Information from Third-Party Sites though Client Online Services, you expressly authorize Stifel and its applicable third-party Vendor(s) to access Third-Party Sites, on your behalf as your agent, and to retrieve account information requested by you. Any transactions or other activities at such sites are not made through Client Online Services, and neither Stifel nor its applicable third-party Vendor(s) assume any responsibility for such activities. You hereby authorize and permit Stifel and its applicable third-party Vendor(s) to use information submitted by you to Client Online Services (such as account passwords and user names) to accomplish the foregoing and to configure Client Online Services so that it is compatible with the Third-Party Sites for which you submit your information. For all purposes hereof, you hereby grant Stifel and its applicable third-party Vendor(s) a limited power of attorney, and you hereby appoint Stifel and applicable third-party Vendor(s) as your true and lawful attorneys-in-fact and agents with full power of substitution and resubstitution, for you and in your name, place, and stead, in any and all capacities that are necessary to access third-party sites, retrieve information, and use your information, all as described above, with the full power and authority to do and perform each and every act and thing requisite and necessary to be done in connection with such activities, as fully to all intents and purposes as you might or could do in person.</span></li>\t\n\t\t\t<li><span>YOU ACKNOWLEDGE AND AGREE THAT WHEN STIFEL OR ITS APPLICABLE THIRD-PARTY VENDOR ACCESSES AND RETRIEVES INFORMATION FROM THIRD-PARTY SITES, STIFEL AND ITS APPLICABLE THIRD-PARTY VENDOR ARE ACTING AS YOUR AGENT, AND NOT AS THE AGENT OF OR ON BEHALF OF THE THIRD-PARTY ACCOUNT PROVIDER.</span></li>\n\t\t\t<li><span>You agree that the third-party account providers shall be entitled to rely on the foregoing authorization, agency, and power of attorney granted by you. You understand and agree that Client Online Services is not sponsored or endorsed by any third-party account providers accessible through Client Online Services.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>OTHER IMPORTANT LEGAL MATTERS</p>\n\t\t\t</div>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>DISCLAIMER OF WARRANTIES</p>\n\t\t\t</div>\n\t\t\t<li><span>YOU EXPRESSLY UNDERSTAND AND AGREE THAT: YOUR USE OF CLIENT ONLINE SERVICES AND ALL INFORMATION, PRODUCTS, AND OTHER CONTENT (INCLUDING THAT OF THIRD PARTIES) INCLUDED IN OR ACCESSIBLE FROM OR THROUGH CLIENT ONLINE SERVICES IS AT YOUR SOLE RISK. CLIENT ONLINE SERVICES IS PROVIDED ON AN &ldquo;AS IS&rdquo; AND &ldquo;AS AVAILABLE&rdquo; BASIS. STIFEL AND ITS APPLICABLE VENDOR(S) EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.</span></li>\n\t\t\t<li><span>STIFEL AND ITS APPLICABLE VENDOR(S) MAKE NO WARRANTIES THAT: (I) CLIENT ONLINE SERVICES WILL MEET YOUR REQUIREMENTS; (II) THE SERVICE WILL BE UNINTERRUPTED, TIMELY, SECURE, OR ERROR FREE; (III) THE RESULTS THAT MAY BE OBTAINED FROM THE USE OF CLIENT ONLINE SERVICES WILL BE ACCURATE OR RELIABLE; (IV) THE QUALITY OF ANY THIRD-PARTY PRODUCTS, SERVICES, INFORMATION, OR OTHER MATERIAL OBTAINED BY YOU THROUGH THE SERVICE WILL MEET YOUR EXPECTATIONS; (V) ANY ERRORS IN THE TECHNOLOGY WILL BE CORRECTED; OR (VI) THE CLIENT ONLINE SERVICES WEB SITE IS FREE OF VIRUSES OR HARMFUL COMPONENTS.</span></li>\n\t\t\t<li><span>ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF CLIENT ONLINE SERVICES IS DONE AT YOUR OWN DISCRETION AND RISK, AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE OR LOSS OF DATA THAT RESULTS FROM THE DOWNLOAD OF ANY SUCH MATERIAL. NO INFORMATION, WHETHER ORAL OR WRITTEN, OBTAINED BY YOU FROM STIFEL, STIFEL&rsquo;S THIRD PARTY VENDORS OR FROM CLIENT ONLINE SERVICES CREATES ANY WARRANTY NOT EXPRESSLY STATED IN THESE TERMS.</span></li>\n\t\t\t<li><span>Some jurisdictions do not allow the exclusion of certain warranties. Accordingly, some of the above limitations may not apply to you.</span></li>\n\t\t\t<li><span>TO THE EXTENT THAT ANY PART OF THIS SECTION IS NOT CONSISTENT WITH ANY OTHER PART OF THESE TERMS, THEN THIS SECTION WILL CONTROL.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>LIMITATION OF LIABILITY</p>\n\t\t\t</div>\n\t\t\t<li><span>YOU AGREE THAT NEITHER STIFEL NOT ANY OF ITS APPLICABLE THIRD-PARTY VENDORS, INCLUDING BUT NOT LIMITED TO QUOVO, NOR ANY OF STIFEL&rsquo;S NOR THEIR AFFILIATED ENTITIES OR EMPLOYEES WILL BE LIABLE FOR ANY DAMAGES THAT MAY BE INCURRED AS A RESULT OF, ARISING FROM, OR RELATED IN ANY WAY TO THE INTERRUPTION OF OR YOUR USE OF CLIENT ONLINE SERVICES FOR ANY REASON, WHETHER OR NOT SUCH DAMAGES ARE FORSEEABLE, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR TRADING LOSSES, PERSONAL INJURY, WRONGFUL DEATH, LOSS OF WAGES OR LIVELIHOOD, LOSS OF PROFITS, GOODWILL, USE, DATA OR OTHER INTANGIBLE LOSSES, OR DAMAGES RELATED TO THE CONTENT, INFORMATION, OR SERVICES PROVIDED.</span></li>\n\t\t\t<li><span>Neither Stifel nor its Vendors and both of their respective officers, employees, agents, affiliates, or subsidiaries are liable for lost profits, loss, or damage to you arising from circumstances over which they have no direct control, including but not limited to, the failure of electronic or mechanical equipment or communication lines, telephone, or other interconnection problems, operator errors, log-in sequences, suspension of trading, exchange or market rulings, severe weather, earthquakes, floods, or other such disasters. Nor are they liable for any lost profits, loss or damage arising from any inaccuracies, errors, omissions, delays, interruptions, or loss of use of Client Online Services, or from failure of any computer hardware, application software, or software which operates computer hardware as part of Client Online Services or from defective or unavailable market data. Stifel believes and has attempted to ensure that Client Online Services has adequate capacity to meet its clients&rsquo; needs. Nevertheless, it is possible that surges in client demand and transaction volume, at Stifel, on systems to which Stifel connects, or at the exchanges or other markets, may delay or prevent the entering or execution of orders. You agree that Stifel and its Vendors will not be liable for any losses from such delays or failures.</span></li>\n\t\t\t<li><span>Some jurisdictions do not allow the limitation or exclusion of liability for incidental or consequential damages. Accordingly, some of the above limitations may not apply to you.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>INDEMNIFICATION</p>\n\t\t\t</div>\n\t\t\t<li><span>You agree to hold harmless and fully compensate Stifel, its applicable third-party Vendor(s), and their respective affiliates from any and all third-party claims, liability, damages, expenses, and costs (including, but not limited to, reasonable attorney fees) caused by, arising from, or in any way related to your use of Client Online Services and any violation by you of this Agreement or willful infringement by you or infringement by any other User of your Client Online Services access credentials, of any intellectual property, or other rights of anyone. Notwithstanding anything to the contrary in any other agreement you may have with Stifel, you agree that Stifel&rsquo;s third-party Vendor, Quovo, is a third-party beneficiary of this Indemnification provision, with all rights to enforce such provision as if Quovo were a party to this agreement.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>OTHER</p>\n\t\t\t</div>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>SECTION HEADINGS</p>\n\t\t\t</div>\n\t\t\t<li><span>Section headings contained in this Agreement are for reference purposes only and shall not affect the meaning or interpretation of this Agreement.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>SEVERABILITY AND GOVERNING LAW</p>\n\t\t\t</div>\n\t\t\t<li><span>If any provision in this Agreement is held to be unenforceable, then such provision shall be construed, as nearly as possible, to reflect the intentions of the parties with the other provisions remaining in full force and effect. The laws of the State of Missouri govern the interpretation and performance of this Agreement.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>NO WAIVER</p>\n\t\t\t</div>\n\t\t\t<li><span>We shall not be deemed to have waived any of our rights or remedies under this Agreement unless such waiver is in writing and signed by us. No delay or omission on our part in exercising any rights or remedies shall operate as a waiver of such rights or remedies or any other rights or remedies. A waiver on any one occasion shall not be construed as a bar or waiver of any rights or remedies on future occasions.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>BROWSER SECURITY AND CONSENT TO TRANSMIT DATA</p>\n\t\t\t</div>\n\t\t\t<li><span>You recognize that use of Client Online Services may involve the transmission to you of personal financial information, such as your personal account data and the information included on transaction confirmations. You acknowledge that the transmission of data on the Internet is not secure. To minimize the risk of unauthorized access, you need to use a browser that supports the Secure Socket Layer (&ldquo;SSL&rdquo;) protocol and follow the Stifel log on procedures with respect to areas of our site(s) that employ SSL protocols. You acknowledge that Stifel is not responsible for notifying you of any upgrades, fixes, or enhancements to any such &ldquo;browser&rdquo; software or for any compromise of data transmitted across the Internet. You consent to the transmission by electronic means of such information through any system, service, or product named or referred to in this Agreement; it is understood that your consent shall be effective at all times that you use such system, product, or service.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>NOTICES TO YOU</p>\n\t\t\t</div>\n\t\t\t<li><span>You agree that we or our Vendor(s) may provide notice to you by posting it on the Client Online Services web site, sending you a message within or through Client Online Services, e-mailing it to an e-mail address that you have provided, mailing it to any postal address that you have provided, or by sending it as a text message to any mobile phone number that you have provided, including but not limited to the mobile phone number that you may have provided.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>TEXT MESSAGES, CALLS, AND/OR E-MAILS TO YOU</p>\n\t\t\t</div>\n\t\t\t<li><span>By providing us with a telephone number (including a wireless/cellular, mobile telephone number) and/or e-mail address, you consent to receiving calls from us and our Vendors at that number and/or e-mails from us for our everyday business purposes (including identify verification). You acknowledge and agree that such telephone calls include, but are not limited to, live telephone calls, prerecorded or artificial voice message calls, text messages, and calls made by an automatic telephone dialing system from us or our affiliates and agents. You further consent to receiving text messages from us at that number, and/or e-mails from us for marketing purposes in connection with the Service and consistent with our Privacy Policy. Please review our Privacy Policy for more information.</span></li>\n\t\t\t<div class="cos-subheading">\n\t\t\t\t<p>ARBITRATION</p>\n\t\t\t</div>\n\t\t\t<div class="cos-subheading">\n\t\t\t<div class="arbitration">\n\t\t\t\t<li><span><span class="italicTitle">General.</span> This Agreement contains a predispute arbitration clause. By signing an arbitration agreement, the parties agree as follows:</span></li>\n\t\t\t\t<ol type="a" class="alpha">\n\t\t\t\t\t<li><span>All parties to this Agreement are giving up the right to sue each other in court, including the right to a trial by jury, except as provided by the rules of the arbitration forum in which a claim is filed.</span></li>\n\t\t\t\t\t<li><span>Arbitration awards are generally final and binding; a party&rsquo;s ability to have a court reverse or modify an arbitration award is very limited.</span></li>\n\t\t\t\t\t<li><span>The ability of the parties to obtain documents, witness statements, and other discovery is generally more limited in arbitration than in court proceedings.</span></li>\n\t\t\t\t\t<li><span>The arbitrators do not have to explain the reason(s) for their award unless, in an eligible case, a joint request for an explained decision has been submitted by all parties to the panel at least 20 days prior to the first scheduled hearing date.</span></li>\n\t\t\t\t\t<li><span>The panel of arbitrators may include a minority of arbitrators who were or are affiliated with the securities industry.</span></li>\n\t\t\t\t\t<li><span>The rules of some arbitration forums may impose time limits for bringing a claim in arbitration. In some cases, a claim that is ineligible for arbitration may be brought in court.</span></li>\n\t\t\t\t\t<li><span>The rules of the arbitration forum in which the claim is filed, and any amendments thereto, are incorporated into this Agreement.</span></li>\t\t\n\t\t\t\t</ol>\n\t\t\t\t<div class="cos-subheading">\n\t\t\t\t\t<p>Claims Subject to Arbitration</p>\n\t\t\t\t</div>\n\t\t\t<li><span>You, Client (including your principals, agents, beneficiaries, successors, heirs, and assigns), agree that you and Stifel must resolve by binding arbitration all claims or controversies between you and Stifel and/or any of Stifel&rsquo;s present or former agents, employees, officers, and directors, whether such claims or controversies arose prior, on, or subsequent to the date hereof, concerning or arising from:\n\t\t\t\t<p><span>(i)</span>any account maintained by you with Stifel, whether held individually by you or jointly with others, in any capacity, including those in which you have a beneficial interest;</p>\n\t\t\t\t<p><span>(ii)</span>any transaction involving Stifel or any predecessor or successor firms by merger, acquisition, or other business combination and you, whether or not such transaction occurred in such account or accounts referenced in (i);</p>\n\t\t\t\t<p><span>(iii)</span>the construction, performance, or breach of this Agreement or any other agreement between you and Stifel or an affiliate; or</p>\n\t\t\t\t<p><span>(iv)</span>any duty arising from the business of Stifel or otherwise, to the extent consistent with FINRA&rsquo;s Code of Arbitration Procedure for Customer Disputes or other arbitration rules FINRA adopts (&ldquo;FINRA&rsquo;s Arbitration Code&rdquo;).  &ldquo;FINRA&rdquo; means the Financial Industry Regulatory Authority, Inc. </p>\n\t\t\t\t<p><span>This arbitration agreement shall be enforced and interpreted exclusively in accordance with applicable federal laws of the United States, including the Federal Arbitration Act. Any arbitration under this Agreement shall be conducted pursuant to the arbitration laws of the State of Missouri and the Federal Arbitration Act, where applicable, and any claim or dispute hereunder shall be submitted exclusively to FINRA Dispute Resolution and administered under applicable FINRA rules.</span></p>\n\t\t\t\t<p><span>This arbitration agreement will apply even if you ultimately decide not to utilize Client Online Services, and will survive the termination of this Agreement. Entering into the Agreement constitutes your consent to submit to the personal jurisdiction of the courts of the State of Missouri to interpret or enforce any or all of these arbitration provisions. Judgment on any arbitration award may be entered in any court having jurisdiction. You hereby waive any objection based on forum non conveniens, and any objection to venue of any action instituted hereunder.</span></p>\n\t\t\t\t<p><span>If you file a complaint in court against Stifel or its present or former employees, officers, or directors that contains claims that are subject to arbitration, Stifel may seek to compel arbitration of such claims.  If Stifel seeks to compel arbitration of such claims, Stifel must agree to arbitrate all of the claims contained in the complaint if the client so requests. </span></p>\n\t\t\t\t<p><span><span class="italicTitle">Class Actions.</span> No person shall bring a putative or certified class action to arbitration, nor seek to enforce any predispute arbitration agreement against any person who has initiated in court a putative class action, or who is a member of a putative class action who has not opted out of the class with respect to any claims encompassed by the putative class action until: (i) the class certification is denied; or (ii) the class is decertified; or (iii) the customer is excluded from the class by the court.</span></p>\n\t\t\t\t<p><span>Such forbearance to enforce an agreement to arbitrate shall not constitute a waiver of any rights under this agreement except to the extent stated herein.</span></p>\n\t\t\t\t<p><span>A copy of this arbitration agreement is hereby given to you, and you acknowledge receipt thereof by your acceptance of the terms of this Agreement.</span></p>\n\t\t\t</li>\n\t\t\t</div>\t\t\t\n\t\t\t<li><span class="italicTitle">Dispute Resolution.</span> In the unlikely event any controversy or dispute arising under this Agreement with Stifel is determined to be ineligible for arbitration, you agree as follows:  THE PARTIES TO THIS AGREEMENT SHALL NOT EXERCISE ANY RIGHTS THEY MAY HAVE TO ELECT OR DEMAND A TRIAL BY JURY.  YOU AND STIFEL HEREBY EXPRESSLY WAIVE ANY RIGHT TO A TRIAL BY JURY.  You acknowledge and agree that this provision is a specific and material aspect of the agreement between the parties and that Stifel would not enter into this Agreement with you if this provision were not part of the agreement.</li>\n\t\t\t<li><span class="italicTitle">Dispute Resolution Locale.</span> Any suit, arbitration proceeding, reparations proceeding, claim, or action against Stifel or its present or past officers, agents, or employees shall be brought and heard in the State of Missouri in St. Louis County Circuit Court or in accordance with applicable FINRA rules.  If the court, arbitration forum, or reparations tribunal does not conduct hearings in that city, then any such action must be brought and heard in the locale closest to that city in which the court, arbitration forum, or reparations tribunal conducts hearings.  This paragraph shall apply even if you have related disputes with other parties that cannot be resolved in the same locale.</li>\n\t\t\t</div>\t\n\t\t</ol>\n\t\t<p>Please read all of the information in this Agreement.  Please acknowledge that you have read, understand, and accept the entire above Agreement and disclosures regarding Online Access to your Stifel account(s) by clicking the &ldquo;I Agree&rdquo; button below.</p>\n\t\t<P class="cos-subheading"> I understand that this Agreement contains a predispute arbitration clause.</p>\n\t\t<p>Your access to Client Online Services will be activated immediately upon your acceptance of this Agreement.</p>\n\t\t<p style="color:red; float: right; font-size: 8px;"> SF1214-4/17</p>\n\t</div>\n</div>\n<br>')}]),$(document).ready(function(){var el;$(".idc-grid-container").attr("data-ng-non-bindable","");var fallbackInit=!0;if(0<(el=$("body.no-sviInvestor")).length&&(fallbackInit=!1),0<(el=$("body.sviInvestor")).length)svi.ngApp=angular.bootstrap(document,["sviInvestor"]);else{var retry=!1,attachApp=function(){0<(el=$(".sviInvestor")).length?el.each(function(index,element){0===$(element).parents(".sviInvestor").length&&(svi.ngApp=angular.bootstrap(element,["sviInvestor"]))}):fallbackInit&&(retry?svi.ngApp=angular.bootstrap(document,["sviInvestor"]):(retry=!0,setTimeout(attachApp,200)))};attachApp()}})};sviInitBundle(window,svi.angular,svi.$,svi.jQuery,svi.Highcharts,svi.moment);
//# sourceMappingURL=js_bundle-6.2.2.min.js.map