{"version":3,"names":[],"mappings":"","sources":["app.module.js"],"sourcesContent":["/**\n * @license AngularJS v1.7.9\n * (c) 2010-2018 Google, Inc. http://angularjs.org\n * License: MIT\n */(function(window){var minErrConfig={objectMaxDepth:5,urlErrorParamsEnabled:true};\nfunction errorHandlingConfig(config){if(isObject(config)){if(isDefined(config.objectMaxDepth)){minErrConfig.objectMaxDepth=isValidObjectMaxDepth(config.objectMaxDepth)?config.objectMaxDepth:NaN;}if(isDefined(config.urlErrorParamsEnabled)&&isBoolean(config.urlErrorParamsEnabled)){minErrConfig.urlErrorParamsEnabled=config.urlErrorParamsEnabled;}}else {return minErrConfig;}}\nfunction isValidObjectMaxDepth(maxDepth){return isNumber(maxDepth)&&maxDepth>0;}\nfunction minErr(module,ErrorConstructor){ErrorConstructor=ErrorConstructor||Error;var url='https://errors.angularjs.org/1.7.9/';var regex=url.replace('.','\\\\.')+'[\\\\s\\\\S]*';var errRegExp=new RegExp(regex,'g');return function(){var code=arguments[0],template=arguments[1],message='['+(module?module+':':'')+code+'] ',templateArgs=sliceArgs(arguments,2).map(function(arg){return toDebugString(arg,minErrConfig.objectMaxDepth);}),paramPrefix,i;\nmessage+=template.replace(/\\{\\d+\\}/g,function(match){var index=+match.slice(1,-1);if(index=0&&length-1 in obj||typeof obj.item==='function');}\nfunction forEach(obj,iterator,context){var key,length;if(obj){if(isFunction(obj)){for(key in obj){if(key!=='prototype'&&key!=='length'&&key!=='name'&&obj.hasOwnProperty(key)){iterator.call(context,obj[key],key,obj);}}}else if(isArray(obj)||isArrayLike(obj)){var isPrimitive=typeof obj!=='object';for(key=0,length=obj.length;key=0){array.splice(index,1);}return index;}\nfunction copy(source,destination,maxDepth){var stackSource=[];var stackDest=[];maxDepth=isValidObjectMaxDepth(maxDepth)?maxDepth:NaN;if(destination){if(isTypedArray(destination)||isArrayBuffer(destination)){throw ngMinErr('cpta','Can\\'t copy! TypedArray destination cannot be mutated.');}if(source===destination){throw ngMinErr('cpi','Can\\'t copy! Source and destination are identical.');}\nif(isArray(destination)){destination.length=0;}else {forEach(destination,function(value,key){if(key!=='$$hashKey'){delete destination[key];}});}stackSource.push(source);stackDest.push(destination);return copyRecurse(source,destination,maxDepth);}return copyElement(source,maxDepth);function copyRecurse(source,destination,maxDepth){maxDepth--;if(maxDepth<0){return '...';}var h=destination.$$hashKey;var key;if(isArray(source)){for(var i=0,ii=source.length;i2?sliceArgs(arguments,2):[];if(isFunction(fn)&&!(fn instanceof RegExp)){return curryArgs.length?function(){return arguments.length?fn.apply(self,concat(curryArgs,arguments,0)):fn.apply(self,curryArgs);}:function(){return arguments.length?fn.apply(self,arguments):fn.call(self);};}else {\nreturn fn;}}function toJsonReplacer(key,value){var val=value;if(typeof key==='string'&&key.charAt(0)==='$'&&key.charAt(1)==='$'){val=undefined;}else if(isWindow(value)){val='$WINDOW';}else if(value&&window.document===value){val='$DOCUMENT';}else if(isScope(value)){val='$SCOPE';}return val;}\nfunction toJson(obj,pretty){if(isUndefined(obj))return undefined;if(!isNumber(pretty)){pretty=pretty?2:null;}return JSON.stringify(obj,toJsonReplacer,pretty);}\nfunction fromJson(json){return isString(json)?JSON.parse(json):json;}var ALL_COLONS=/:/g;function timezoneToOffset(timezone,fallback){\ntimezone=timezone.replace(ALL_COLONS,'');var requestedTimezoneOffset=Date.parse('Jan 01, 1970 00:00:00 '+timezone)/60000;return isNumberNaN(requestedTimezoneOffset)?fallback:requestedTimezoneOffset;}function addDateMinutes(date,minutes){date=new Date(date.getTime());date.setMinutes(date.getMinutes()+minutes);return date;}function convertTimezoneToLocal(date,timezone,reverse){reverse=reverse?-1:1;var dateTimezoneOffset=date.getTimezoneOffset();var timezoneOffset=timezoneToOffset(timezone,dateTimezoneOffset);return addDateMinutes(date,reverse*(timezoneOffset-dateTimezoneOffset));}\nfunction startingTag(element){element=jqLite(element).clone().empty();var elemHtml=jqLite('
').append(element).html();try{return element[0].nodeType===NODE_TYPE_TEXT?lowercase(elemHtml):elemHtml.match(/^(<[^>]+>)/)[1].replace(/^<([\\w-]+)/,function(match,nodeName){return '<'+lowercase(nodeName);});}catch(e){return lowercase(elemHtml);}}\nfunction tryDecodeURIComponent(value){try{return decodeURIComponent(value);}catch(e){\n}}\nfunction parseKeyValue(keyValue){var obj={};forEach((keyValue||'').split('&'),function(keyValue){var splitPoint,key,val;if(keyValue){key=keyValue=keyValue.replace(/\\+/g,'%20');splitPoint=keyValue.indexOf('=');if(splitPoint!==-1){key=keyValue.substring(0,splitPoint);val=keyValue.substring(splitPoint+1);}key=tryDecodeURIComponent(key);if(isDefined(key)){val=isDefined(val)?tryDecodeURIComponent(val):true;if(!hasOwnProperty.call(obj,key)){obj[key]=val;}else if(isArray(obj[key])){obj[key].push(val);}else {obj[key]=[obj[key],val];}}}});return obj;}function toKeyValue(obj){var parts=[];forEach(obj,function(value,key){if(isArray(value)){forEach(value,function(arrayValue){parts.push(encodeUriQuery(key,true)+(arrayValue===true?'':'='+encodeUriQuery(arrayValue,true)));});}else {parts.push(encodeUriQuery(key,true)+(value===true?'':'='+encodeUriQuery(value,true)));}});return parts.length?parts.join('&'):'';}\nfunction encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}\nfunction encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,'@').replace(/%3A/gi,':').replace(/%24/g,'$').replace(/%2C/gi,',').replace(/%3B/gi,';').replace(/%20/g,pctEncodeSpaces?'%20':'+');}var ngAttrPrefixes=['ng-','data-ng-','ng:','x-ng-'];function getNgAttribute(element,ngAttr){var attr,i,ii=ngAttrPrefixes.length;for(i=0;i protocol indicates '+'an extension, document.location.href does not match.');return;}config.strictDi=getNgAttribute(appElement,'strict-di')!==null;bootstrap(appElement,module?[module]:[],config);}}\nfunction bootstrap(element,modules,config){if(!isObject(config))config={};var defaultConfig={strictDi:false};config=extend(defaultConfig,config);var doBootstrap=function(){element=jqLite(element);if(element.injector()){var tag=element[0]===window.document?'document':startingTag(element);\nthrow ngMinErr('btstrpd','App already bootstrapped with this element \\'{0}\\'',tag.replace(//,'>'));}modules=modules||[];modules.unshift(['$provide',function($provide){$provide.value('$rootElement',element);}]);if(config.debugInfoEnabled){\nmodules.push(['$compileProvider',function($compileProvider){$compileProvider.debugInfoEnabled(true);}]);}modules.unshift('ng');var injector=createInjector(modules,config.strictDi);injector.invoke(['$rootScope','$rootElement','$compile','$injector',function bootstrapApply(scope,element,compile,injector){scope.$apply(function(){element.data('$injector',injector);compile(element)(scope);});}]);return injector;};var NG_ENABLE_DEBUG_INFO=/^NG_ENABLE_DEBUG_INFO!/;var NG_DEFER_BOOTSTRAP=/^NG_DEFER_BOOTSTRAP!/;if(window&&NG_ENABLE_DEBUG_INFO.test(window.name)){config.debugInfoEnabled=true;window.name=window.name.replace(NG_ENABLE_DEBUG_INFO,'');}if(window&&!NG_DEFER_BOOTSTRAP.test(window.name)){return doBootstrap();}window.name=window.name.replace(NG_DEFER_BOOTSTRAP,'');angular.resumeBootstrap=function(extraModules){forEach(extraModules,function(module){modules.push(module);});return doBootstrap();};if(isFunction(angular.resumeDeferredBootstrap)){angular.resumeDeferredBootstrap();}}\nfunction reloadWithDebugInfo(){window.name='NG_ENABLE_DEBUG_INFO!'+window.name;window.location.reload();}\nfunction getTestability(rootElement){var injector=angular.element(rootElement).injector();if(!injector){throw ngMinErr('test','no injector found for element argument to getTestability');}return injector.get('$$testability');}var SNAKE_CASE_REGEXP=/[A-Z]/g;function snake_case(name,separator){separator=separator||'_';return name.replace(SNAKE_CASE_REGEXP,function(letter,pos){return (pos?separator:'')+letter.toLowerCase();});}var bindJQueryFired=false;function bindJQuery(){var originalCleanData;if(bindJQueryFired){return;}\nvar jqName=jq();jQuery=isUndefined(jqName)?window.jQuery:\n!jqName?undefined:\nwindow[jqName];\nif(jQuery&&jQuery.fn.on){jqLite=jQuery;extend(jQuery.fn,{scope:JQLitePrototype.scope,isolateScope:JQLitePrototype.isolateScope,controller:JQLitePrototype.controller,injector:JQLitePrototype.injector,inheritedData:JQLitePrototype.inheritedData});}else {jqLite=JQLite;}\noriginalCleanData=jqLite.cleanData;jqLite.cleanData=function(elems){var events;for(var i=0,elem;(elem=elems[i])!=null;i++){events=(jqLite._data(elem)||{}).events;if(events&&events.$destroy){jqLite(elem).triggerHandler('$destroy');}}originalCleanData(elems);};angular.element=jqLite;\nbindJQueryFired=true;}\nfunction assertArg(arg,name,reason){if(!arg){throw ngMinErr('areq','Argument \\'{0}\\' is {1}',name||'?',reason||'required');}return arg;}function assertArgFn(arg,name,acceptArrayAnnotation){if(acceptArrayAnnotation&&isArray(arg)){arg=arg[arg.length-1];}assertArg(isFunction(arg),name,'not a function, got '+(arg&&typeof arg==='object'?arg.constructor.name||'Object':typeof arg));return arg;}\nfunction assertNotHasOwnProperty(name,context){if(name==='hasOwnProperty'){throw ngMinErr('badname','hasOwnProperty is not a valid {0} name',context);}}\nfunction getter(obj,path,bindFnToScope){if(!path)return obj;var keys=path.split('.');var key;var lastInstance=obj;var len=keys.length;for(var i=0;i=0)return '...';seen.push(val);}return val;});}function toDebugString(obj,maxDepth){if(typeof obj==='function'){return obj.toString().replace(/ \\{[\\s\\S]*$/,'');}else if(isUndefined(obj)){return 'undefined';}else if(typeof obj!=='string'){return serializeObject(obj,maxDepth);}return obj;}\nvar version={\nfull:'1.7.9',major:1,minor:7,dot:9,codeName:'pollution-eradication'};function publishExternalAPI(angular){extend(angular,{'errorHandlingConfig':errorHandlingConfig,'bootstrap':bootstrap,'copy':copy,'extend':extend,'merge':merge,'equals':equals,'element':jqLite,'forEach':forEach,'injector':createInjector,'noop':noop,'bind':bind,'toJson':toJson,'fromJson':fromJson,'identity':identity,'isUndefined':isUndefined,'isDefined':isDefined,'isString':isString,'isFunction':isFunction,'isObject':isObject,'isNumber':isNumber,'isElement':isElement,'isArray':isArray,'version':version,'isDate':isDate,'callbacks':{$$counter:0},'getTestability':getTestability,'reloadWithDebugInfo':reloadWithDebugInfo,'$$minErr':minErr,'$$csp':csp,'$$encodeUriSegment':encodeUriSegment,'$$encodeUriQuery':encodeUriQuery,'$$lowercase':lowercase,'$$stringify':stringify,'$$uppercase':uppercase});angularModule=setupModuleLoader(window);angularModule('ng',['ngLocale'],['$provide',function ngModule($provide){\n$provide.provider({$$sanitizeUri:$$SanitizeUriProvider});$provide.provider('$compile',$CompileProvider).directive({a:htmlAnchorDirective,input:inputDirective,textarea:inputDirective,form:formDirective,script:scriptDirective,select:selectDirective,option:optionDirective,ngBind:ngBindDirective,ngBindHtml:ngBindHtmlDirective,ngBindTemplate:ngBindTemplateDirective,ngClass:ngClassDirective,ngClassEven:ngClassEvenDirective,ngClassOdd:ngClassOddDirective,ngCloak:ngCloakDirective,ngController:ngControllerDirective,ngForm:ngFormDirective,ngHide:ngHideDirective,ngIf:ngIfDirective,ngInclude:ngIncludeDirective,ngInit:ngInitDirective,ngNonBindable:ngNonBindableDirective,ngPluralize:ngPluralizeDirective,ngRef:ngRefDirective,ngRepeat:ngRepeatDirective,ngShow:ngShowDirective,ngStyle:ngStyleDirective,ngSwitch:ngSwitchDirective,ngSwitchWhen:ngSwitchWhenDirective,ngSwitchDefault:ngSwitchDefaultDirective,ngOptions:ngOptionsDirective,ngTransclude:ngTranscludeDirective,ngModel:ngModelDirective,ngList:ngListDirective,ngChange:ngChangeDirective,pattern:patternDirective,ngPattern:patternDirective,required:requiredDirective,ngRequired:requiredDirective,minlength:minlengthDirective,ngMinlength:minlengthDirective,maxlength:maxlengthDirective,ngMaxlength:maxlengthDirective,ngValue:ngValueDirective,ngModelOptions:ngModelOptionsDirective}).directive({ngInclude:ngIncludeFillContentDirective,input:hiddenInputBrowserCacheDirective}).directive(ngAttributeAliasDirectives).directive(ngEventDirectives);$provide.provider({$anchorScroll:$AnchorScrollProvider,$animate:$AnimateProvider,$animateCss:$CoreAnimateCssProvider,$$animateJs:$$CoreAnimateJsProvider,$$animateQueue:$$CoreAnimateQueueProvider,$$AnimateRunner:$$AnimateRunnerFactoryProvider,$$animateAsyncRun:$$AnimateAsyncRunFactoryProvider,$browser:$BrowserProvider,$cacheFactory:$CacheFactoryProvider,$controller:$ControllerProvider,$document:$DocumentProvider,$$isDocumentHidden:$$IsDocumentHiddenProvider,$exceptionHandler:$ExceptionHandlerProvider,$filter:$FilterProvider,$$forceReflow:$$ForceReflowProvider,$interpolate:$InterpolateProvider,$interval:$IntervalProvider,$$intervalFactory:$$IntervalFactoryProvider,$http:$HttpProvider,$httpParamSerializer:$HttpParamSerializerProvider,$httpParamSerializerJQLike:$HttpParamSerializerJQLikeProvider,$httpBackend:$HttpBackendProvider,$xhrFactory:$xhrFactoryProvider,$jsonpCallbacks:$jsonpCallbacksProvider,$location:$LocationProvider,$log:$LogProvider,$parse:$ParseProvider,$rootScope:$RootScopeProvider,$q:$QProvider,$$q:$$QProvider,$sce:$SceProvider,$sceDelegate:$SceDelegateProvider,$sniffer:$SnifferProvider,$$taskTrackerFactory:$$TaskTrackerFactoryProvider,$templateCache:$TemplateCacheProvider,$templateRequest:$TemplateRequestProvider,$$testability:$$TestabilityProvider,$timeout:$TimeoutProvider,$window:$WindowProvider,$$rAF:$$RAFProvider,$$jqLite:$$jqLiteProvider,$$Map:$$MapProvider,$$cookieReader:$$CookieReaderProvider});}]).info({angularVersion:'1.7.9'});}\nJQLite.expando='ng339';var jqCache=JQLite.cache={},jqId=1;\nJQLite._data=function(node){\nreturn this.cache[node[this.expando]]||{};};function jqNextId(){return ++jqId;}var DASH_LOWERCASE_REGEXP=/-([a-z])/g;var MS_HACK_REGEXP=/^-ms-/;var MOUSE_EVENT_MAP={mouseleave:'mouseout',mouseenter:'mouseover'};var jqLiteMinErr=minErr('jqLite');\nfunction cssKebabToCamel(name){return kebabToCamel(name.replace(MS_HACK_REGEXP,'ms-'));}function fnCamelCaseReplace(all,letter){return letter.toUpperCase();}\nfunction kebabToCamel(name){return name.replace(DASH_LOWERCASE_REGEXP,fnCamelCaseReplace);}var SINGLE_TAG_REGEXP=/^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/;var HTML_REGEXP=/<|&#?\\w+;/;var TAG_NAME_REGEXP=/<([\\w:-]+)/;var XHTML_TAG_REGEXP=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:-]+)[^>]*)\\/>/gi;var wrapMap={'option':[1,''],'thead':[1,'','
'],'col':[2,'','
'],'tr':[2,'','
'],'td':[3,'','
'],'_default':[0,'','']};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;function jqLiteIsTextNode(html){return !HTML_REGEXP.test(html);}function jqLiteAcceptsData(node){\nvar nodeType=node.nodeType;return nodeType===NODE_TYPE_ELEMENT||!nodeType||nodeType===NODE_TYPE_DOCUMENT;}function jqLiteHasData(node){for(var key in jqCache[node.ng339]){return true;}return false;}function jqLiteBuildFragment(html,context){var tmp,tag,wrap,fragment=context.createDocumentFragment(),nodes=[],i;if(jqLiteIsTextNode(html)){\nnodes.push(context.createTextNode(html));}else {\ntmp=fragment.appendChild(context.createElement('div'));tag=(TAG_NAME_REGEXP.exec(html)||['',''])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+html.replace(XHTML_TAG_REGEXP,'<$1>')+wrap[2];\ni=wrap[0];while(i--){tmp=tmp.lastChild;}nodes=concat(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent='';}\nfragment.textContent='';fragment.innerHTML='';\nforEach(nodes,function(node){fragment.appendChild(node);});return fragment;}function jqLiteParseHTML(html,context){context=context||window.document;var parsed;if(parsed=SINGLE_TAG_REGEXP.exec(html)){return [context.createElement(parsed[1])];}if(parsed=jqLiteBuildFragment(html,context)){return parsed.childNodes;}return [];}function jqLiteWrapNode(node,wrapper){var parent=node.parentNode;if(parent){parent.replaceChild(wrapper,node);}wrapper.appendChild(node);}\nvar jqLiteContains=window.Node.prototype.contains||function(arg){\nreturn !!(this.compareDocumentPosition(arg)&16);};\nfunction JQLite(element){if(element instanceof JQLite){return element;}var argIsString;if(isString(element)){element=trim(element);argIsString=true;}if(!(this instanceof JQLite)){if(argIsString&&element.charAt(0)!=='<'){throw jqLiteMinErr('nosel','Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');}return new JQLite(element);}if(argIsString){jqLiteAddNodes(this,jqLiteParseHTML(element));}else if(isFunction(element)){jqLiteReady(element);}else {jqLiteAddNodes(this,element);}}function jqLiteClone(element){return element.cloneNode(true);}function jqLiteDealoc(element,onlyDescendants){if(!onlyDescendants&&jqLiteAcceptsData(element))jqLite.cleanData([element]);if(element.querySelectorAll){jqLite.cleanData(element.querySelectorAll('*'));}}function isEmptyObject(obj){var name;for(name in obj){return false;}return true;}function removeIfEmptyData(element){var expandoId=element.ng339;var expandoStore=expandoId&&jqCache[expandoId];var events=expandoStore&&expandoStore.events;var data=expandoStore&&expandoStore.data;if((!data||isEmptyObject(data))&&(!events||isEmptyObject(events))){delete jqCache[expandoId];element.ng339=undefined;\n}}function jqLiteOff(element,type,fn,unsupported){if(isDefined(unsupported))throw jqLiteMinErr('offargs','jqLite#off() does not support the `selector` argument');var expandoStore=jqLiteExpandoStore(element);var events=expandoStore&&expandoStore.events;var handle=expandoStore&&expandoStore.handle;if(!handle)return;\nif(!type){for(type in events){if(type!=='$destroy'){element.removeEventListener(type,handle);}delete events[type];}}else {var removeHandler=function(type){var listenerFns=events[type];if(isDefined(fn)){arrayRemove(listenerFns||[],fn);}if(!(isDefined(fn)&&listenerFns&&listenerFns.length>0)){element.removeEventListener(type,handle);delete events[type];}};forEach(type.split(' '),function(type){removeHandler(type);if(MOUSE_EVENT_MAP[type]){removeHandler(MOUSE_EVENT_MAP[type]);}});}removeIfEmptyData(element);}function jqLiteRemoveData(element,name){var expandoId=element.ng339;var expandoStore=expandoId&&jqCache[expandoId];if(expandoStore){if(name){delete expandoStore.data[name];}else {expandoStore.data={};}removeIfEmptyData(element);}}function jqLiteExpandoStore(element,createIfNecessary){var expandoId=element.ng339,expandoStore=expandoId&&jqCache[expandoId];if(createIfNecessary&&!expandoStore){element.ng339=expandoId=jqNextId();expandoStore=jqCache[expandoId]={events:{},data:{},handle:undefined};}return expandoStore;}function jqLiteData(element,key,value){if(jqLiteAcceptsData(element)){var prop;var isSimpleSetter=isDefined(value);var isSimpleGetter=!isSimpleSetter&&key&&!isObject(key);var massGetter=!key;var expandoStore=jqLiteExpandoStore(element,!isSimpleGetter);var data=expandoStore&&expandoStore.data;if(isSimpleSetter){\ndata[kebabToCamel(key)]=value;}else {if(massGetter){\nreturn data;}else {if(isSimpleGetter){\nreturn data&&data[kebabToCamel(key)];}else {\nfor(prop in key){data[kebabToCamel(prop)]=key[prop];}}}}}}function jqLiteHasClass(element,selector){if(!element.getAttribute)return false;return (' '+(element.getAttribute('class')||'')+' ').replace(/[\\n\\t]/g,' ').indexOf(' '+selector+' ')>-1;}function jqLiteRemoveClass(element,cssClasses){if(cssClasses&&element.setAttribute){var existingClasses=(' '+(element.getAttribute('class')||'')+' ').replace(/[\\n\\t]/g,' ');var newClasses=existingClasses;forEach(cssClasses.split(' '),function(cssClass){cssClass=trim(cssClass);newClasses=newClasses.replace(' '+cssClass+' ',' ');});if(newClasses!==existingClasses){element.setAttribute('class',trim(newClasses));}}}function jqLiteAddClass(element,cssClasses){if(cssClasses&&element.setAttribute){var existingClasses=(' '+(element.getAttribute('class')||'')+' ').replace(/[\\n\\t]/g,' ');var newClasses=existingClasses;forEach(cssClasses.split(' '),function(cssClass){cssClass=trim(cssClass);if(newClasses.indexOf(' '+cssClass+' ')===-1){newClasses+=cssClass+' ';}});if(newClasses!==existingClasses){element.setAttribute('class',trim(newClasses));}}}function jqLiteAddNodes(root,elements){\nif(elements){\nif(elements.nodeType){root[root.length++]=elements;}else {var length=elements.length;\nif(typeof length==='number'&&elements.window!==elements){if(length){for(var i=0;i=0?jqLite(this[index]):jqLite(this[this.length+index]);},length:0,push:push,sort:[].sort,splice:[].splice};\nvar BOOLEAN_ATTR={};forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','),function(value){BOOLEAN_ATTR[lowercase(value)]=value;});var BOOLEAN_ELEMENTS={};forEach('input,select,option,textarea,button,form,details'.split(','),function(value){BOOLEAN_ELEMENTS[value]=true;});var ALIASED_ATTR={'ngMinlength':'minlength','ngMaxlength':'maxlength','ngMin':'min','ngMax':'max','ngPattern':'pattern','ngStep':'step'};function getBooleanAttrName(element,name){\nvar booleanAttr=BOOLEAN_ATTR[name.toLowerCase()];\nreturn booleanAttr&&BOOLEAN_ELEMENTS[nodeName_(element)]&&booleanAttr;}function getAliasedAttrName(name){return ALIASED_ATTR[name];}forEach({data:jqLiteData,removeData:jqLiteRemoveData,hasData:jqLiteHasData,cleanData:function jqLiteCleanData(nodes){for(var i=0,ii=nodes.length;i1){eventFns=shallowCopy(eventFns);}for(var i=0;i=0?type.split(' '):[type];var i=types.length;var addHandler=function(type,specialHandlerWrapper,noEventListener){var eventFns=events[type];if(!eventFns){eventFns=events[type]=[];eventFns.specialHandlerWrapper=specialHandlerWrapper;if(type!=='$destroy'&&!noEventListener){element.addEventListener(type,handle);}}eventFns.push(fn);};while(i--){type=types[i];if(MOUSE_EVENT_MAP[type]){addHandler(MOUSE_EVENT_MAP[type],specialMouseHandlerWrapper);addHandler(type,undefined,true);}else {addHandler(type);}}},off:jqLiteOff,one:function(element,type,fn){element=jqLite(element);\nelement.on(type,function onFn(){element.off(type,fn);element.off(type,onFn);});element.on(type,fn);},replaceWith:function(element,replaceNode){var index,parent=element.parentNode;jqLiteDealoc(element);forEach(new JQLite(replaceNode),function(node){if(index){parent.insertBefore(node,index.nextSibling);}else {parent.replaceChild(node,element);}index=node;});},children:function(element){var children=[];forEach(element.childNodes,function(element){if(element.nodeType===NODE_TYPE_ELEMENT){children.push(element);}});return children;},contents:function(element){return element.contentDocument||element.childNodes||[];},append:function(element,node){var nodeType=element.nodeType;if(nodeType!==NODE_TYPE_ELEMENT&&nodeType!==NODE_TYPE_DOCUMENT_FRAGMENT)return;node=new JQLite(node);for(var i=0,ii=node.length;i/;var FN_ARGS=/^[^(]*\\(\\s*([^)]*)\\)/m;var FN_ARG_SPLIT=/,/;var FN_ARG=/^\\s*(_?)(\\S+?)\\1\\s*$/;var STRIP_COMMENTS=/((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;var $injectorMinErr=minErr('$injector');function stringifyFn(fn){return Function.prototype.toString.call(fn);}function extractArgs(fn){var fnText=stringifyFn(fn).replace(STRIP_COMMENTS,''),args=fnText.match(ARROW_ARG)||fnText.match(FN_ARGS);return args;}function anonFn(fn){\nvar args=extractArgs(fn);if(args){return 'function('+(args[1]||'').replace(/[\\s\\r\\n]+/,' ')+')';}return 'fn';}function annotate(fn,strictDi,name){var $inject,argDecl,last;if(typeof fn==='function'){if(!($inject=fn.$inject)){$inject=[];if(fn.length){if(strictDi){if(!isString(name)||!name){name=fn.name||anonFn(fn);}throw $injectorMinErr('strictdi','{0} is not using explicit annotation and cannot be invoked in strict mode',name);}argDecl=extractArgs(fn);forEach(argDecl[1].split(FN_ARG_SPLIT),function(arg){arg.replace(FN_ARG,function(all,underscore,name){$inject.push(name);});});}fn.$inject=$inject;}}else if(isArray(fn)){last=fn.length-1;assertArgFn(fn[last],'fn');$inject=fn.slice(0,last);}else {assertArgFn(fn,'fn',true);}return $inject;}\nfunction createInjector(modulesToLoad,strictDi){strictDi=strictDi===true;var INSTANTIATING={},providerSuffix='Provider',path=[],loadedModules=new NgMap(),providerCache={$provide:{provider:supportObject(provider),factory:supportObject(factory),service:supportObject(service),value:supportObject(value),constant:supportObject(constant),decorator:decorator}},providerInjector=providerCache.$injector=createInternalInjector(providerCache,function(serviceName,caller){if(angular.isString(caller)){path.push(caller);}throw $injectorMinErr('unpr','Unknown provider: {0}',path.join(' <- '));}),instanceCache={},protoInstanceInjector=createInternalInjector(instanceCache,function(serviceName,caller){var provider=providerInjector.get(serviceName+providerSuffix,caller);return instanceInjector.invoke(provider.$get,provider,undefined,serviceName);}),instanceInjector=protoInstanceInjector;providerCache['$injector'+providerSuffix]={$get:valueFn(protoInstanceInjector)};instanceInjector.modules=providerInjector.modules=createMap();var runBlocks=loadModules(modulesToLoad);instanceInjector=protoInstanceInjector.get('$injector');instanceInjector.strictDi=strictDi;forEach(runBlocks,function(fn){if(fn)instanceInjector.invoke(fn);});instanceInjector.loadNewModules=function(mods){forEach(loadModules(mods),function(fn){if(fn)instanceInjector.invoke(fn);});};return instanceInjector;\nfunction supportObject(delegate){return function(key,value){if(isObject(key)){forEach(key,reverseParams(delegate));}else {return delegate(key,value);}};}function provider(name,provider_){assertNotHasOwnProperty(name,'service');if(isFunction(provider_)||isArray(provider_)){provider_=providerInjector.instantiate(provider_);}if(!provider_.$get){throw $injectorMinErr('pget','Provider \\'{0}\\' must define $get factory method.',name);}return providerCache[name+providerSuffix]=provider_;}function enforceReturnValue(name,factory){return(function enforcedReturnValue(){var result=instanceInjector.invoke(factory,this);if(isUndefined(result)){throw $injectorMinErr('undef','Provider \\'{0}\\' must return a value from $get factory method.',name);}return result;});}function factory(name,factoryFn,enforce){return provider(name,{$get:enforce!==false?enforceReturnValue(name,factoryFn):factoryFn});}function service(name,constructor){return factory(name,['$injector',function($injector){return $injector.instantiate(constructor);}]);}function value(name,val){return factory(name,valueFn(val),false);}function constant(name,value){assertNotHasOwnProperty(name,'constant');providerCache[name]=value;instanceCache[name]=value;}function decorator(serviceName,decorFn){var origProvider=providerInjector.get(serviceName+providerSuffix),orig$get=origProvider.$get;origProvider.$get=function(){var origInstance=instanceInjector.invoke(orig$get,origProvider);return instanceInjector.invoke(decorFn,null,{$delegate:origInstance});};}\nfunction loadModules(modulesToLoad){assertArg(isUndefined(modulesToLoad)||isArray(modulesToLoad),'modulesToLoad','not an array');var runBlocks=[],moduleFn;forEach(modulesToLoad,function(module){if(loadedModules.get(module))return;loadedModules.set(module,true);function runInvokeQueue(queue){var i,ii;for(i=0,ii=queue.length;i1)return;$$rAF(function(){for(var i=0;icapacity){this.remove(staleEnd.key);}return value;},\nget:function(key){if(capacity0){$animate.addClass(this.$$element,classVal);}},\n$removeClass:function(classVal){if(classVal&&classVal.length>0){$animate.removeClass(this.$$element,classVal);}},\n$updateClass:function(newClasses,oldClasses){var toAdd=tokenDifference(newClasses,oldClasses);if(toAdd&&toAdd.length){$animate.addClass(this.$$element,toAdd);}var toRemove=tokenDifference(oldClasses,newClasses);if(toRemove&&toRemove.length){$animate.removeClass(this.$$element,toRemove);}},\n$set:function(key,value,writeAttr,attrName){\nvar node=this.$$element[0],booleanKey=getBooleanAttrName(node,key),aliasedKey=getAliasedAttrName(key),observer=key,nodeName;if(booleanKey){this.$$element.prop(key,value);attrName=booleanKey;}else if(aliasedKey){this[aliasedKey]=value;observer=aliasedKey;}this[key]=value;\nif(attrName){this.$attr[key]=attrName;}else {attrName=this.$attr[key];if(!attrName){this.$attr[key]=attrName=snake_case(key,'-');}}nodeName=nodeName_(this.$$element);\nif(nodeName==='img'&&key==='srcset'){this[key]=value=sanitizeSrcset(value,'$set(\\'srcset\\', value)');}if(writeAttr!==false){if(value===null||isUndefined(value)){this.$$element.removeAttr(attrName);}else {if(SIMPLE_ATTR_NAME.test(attrName)){\nif(booleanKey&&value===false){this.$$element.removeAttr(attrName);}else {this.$$element.attr(attrName,value);}}else {setSpecialAttr(this.$$element[0],attrName,value);}}}\nvar $$observers=this.$$observers;if($$observers){forEach($$observers[observer],function(fn){try{fn(value);}catch(e){$exceptionHandler(e);}});}},\n$observe:function(key,fn){var attrs=this,$$observers=attrs.$$observers||(attrs.$$observers=createMap()),listeners=$$observers[key]||($$observers[key]=[]);listeners.push(fn);$rootScope.$evalAsync(function(){if(!listeners.$$inter&&attrs.hasOwnProperty(key)&&!isUndefined(attrs[key])){\nfn(attrs[key]);}});return function(){arrayRemove(listeners,fn);};}};function setSpecialAttr(element,attrName,value){\nspecialAttrHolder.innerHTML='';var attributes=specialAttrHolder.firstChild.attributes;var attribute=attributes[0];\nattributes.removeNamedItem(attribute.name);attribute.value=value;element.attributes.setNamedItem(attribute);}function safeAddClass($element,className){try{$element.addClass(className);}catch(e){\n}}var startSymbol=$interpolate.startSymbol(),endSymbol=$interpolate.endSymbol(),denormalizeTemplate=startSymbol==='{{'&&endSymbol==='}}'?identity:function denormalizeTemplate(template){return template.replace(/\\{\\{/g,startSymbol).replace(/}}/g,endSymbol);},NG_PREFIX_BINDING=/^ng(Attr|Prop|On)([A-Z].*)$/;var MULTI_ELEMENT_DIR_RE=/^(.+)Start$/;compile.$$addBindingInfo=debugInfoEnabled?function $$addBindingInfo($element,binding){var bindings=$element.data('$binding')||[];if(isArray(binding)){bindings=bindings.concat(binding);}else {bindings.push(binding);}$element.data('$binding',bindings);}:noop;compile.$$addBindingClass=debugInfoEnabled?function $$addBindingClass($element){safeAddClass($element,'ng-binding');}:noop;compile.$$addScopeInfo=debugInfoEnabled?function $$addScopeInfo($element,scope,isolated,noTemplate){var dataName=isolated?noTemplate?'$isolateScopeNoTemplate':'$isolateScope':'$scope';$element.data(dataName,scope);}:noop;compile.$$addScopeClass=debugInfoEnabled?function $$addScopeClass($element,isolated){safeAddClass($element,isolated?'ng-isolate-scope':'ng-scope');}:noop;compile.$$createComment=function(directiveName,comment){var content='';if(debugInfoEnabled){content=' '+(directiveName||'')+': ';if(comment)content+=comment+' ';}return window.document.createComment(content);};return compile;\nfunction compile($compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext){if(!($compileNodes instanceof jqLite)){\n$compileNodes=jqLite($compileNodes);}var compositeLinkFn=compileNodes($compileNodes,transcludeFn,$compileNodes,maxPriority,ignoreDirective,previousCompileContext);compile.$$addScopeClass($compileNodes);var namespace=null;return function publicLinkFn(scope,cloneConnectFn,options){if(!$compileNodes){throw $compileMinErr('multilink','This element has already been linked.');}assertArg(scope,'scope');if(previousCompileContext&&previousCompileContext.needsNewScope){\nscope=scope.$parent.$new();}options=options||{};var parentBoundTranscludeFn=options.parentBoundTranscludeFn,transcludeControllers=options.transcludeControllers,futureParentElement=options.futureParentElement;\nif(parentBoundTranscludeFn&&parentBoundTranscludeFn.$$boundTransclude){parentBoundTranscludeFn=parentBoundTranscludeFn.$$boundTransclude;}if(!namespace){namespace=detectNamespaceForChildElements(futureParentElement);}var $linkNode;if(namespace!=='html'){\n$linkNode=jqLite(wrapTemplate(namespace,jqLite('
').append($compileNodes).html()));}else if(cloneConnectFn){\n$linkNode=JQLitePrototype.clone.call($compileNodes);}else {$linkNode=$compileNodes;}if(transcludeControllers){for(var controllerName in transcludeControllers){$linkNode.data('$'+controllerName+'Controller',transcludeControllers[controllerName].instance);}}compile.$$addScopeInfo($linkNode,scope);if(cloneConnectFn)cloneConnectFn($linkNode,scope);if(compositeLinkFn)compositeLinkFn(scope,$linkNode,$linkNode,parentBoundTranscludeFn);if(!cloneConnectFn){$compileNodes=compositeLinkFn=null;}return $linkNode;};}function detectNamespaceForChildElements(parentElement){\nvar node=parentElement&&parentElement[0];if(!node){return 'html';}else {return nodeName_(node)!=='foreignobject'&&toString.call(node).match(/SVG/)?'svg':'html';}}\nfunction compileNodes(nodeList,transcludeFn,$rootElement,maxPriority,ignoreDirective,previousCompileContext){var linkFns=[],\nnotLiveList=isArray(nodeList)||nodeList instanceof jqLite,attrs,directives,nodeLinkFn,childNodes,childLinkFn,linkFnFound,nodeLinkFnFound;for(var i=0;i0);}else {nodes.push(node);}return jqLite(nodes);}\nfunction groupElementsLinkFnWrapper(linkFn,attrStart,attrEnd){return function groupedElementsLink(scope,element,attrs,controllers,transcludeFn){element=groupScan(element[0],attrStart,attrEnd);return linkFn(scope,element,attrs,controllers,transcludeFn);};}\nfunction compilationGenerator(eager,$compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext){var compiled;if(eager){return compile($compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext);}return(function lazyCompilation(){if(!compiled){compiled=compile($compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext);\n$compileNodes=transcludeFn=previousCompileContext=null;}return compiled.apply(this,arguments);});}\nfunction applyDirectivesToNode(directives,compileNode,templateAttrs,transcludeFn,jqCollection,originalReplaceDirective,preLinkFns,postLinkFns,previousCompileContext){previousCompileContext=previousCompileContext||{};var terminalPriority=-Number.MAX_VALUE,newScopeDirective=previousCompileContext.newScopeDirective,controllerDirectives=previousCompileContext.controllerDirectives,newIsolateScopeDirective=previousCompileContext.newIsolateScopeDirective,templateDirective=previousCompileContext.templateDirective,nonTlbTranscludeDirective=previousCompileContext.nonTlbTranscludeDirective,hasTranscludeDirective=false,hasTemplate=false,hasElementTranscludeDirective=previousCompileContext.hasElementTranscludeDirective,$compileNode=templateAttrs.$$element=jqLite(compileNode),directive,directiveName,$template,replaceDirective=originalReplaceDirective,childTranscludeFn=transcludeFn,linkFn,didScanForMultipleTransclusion=false,mightHaveMultipleTransclusionError=false,directiveValue;\nfor(var i=0,ii=directives.length;idirective.priority){break;\n}directiveValue=directive.scope;if(directiveValue){\nif(!directive.templateUrl){if(isObject(directiveValue)){\nassertNoDuplicate('new/isolated scope',newIsolateScopeDirective||newScopeDirective,directive,$compileNode);newIsolateScopeDirective=directive;}else {\nassertNoDuplicate('new/isolated scope',newIsolateScopeDirective,directive,$compileNode);}}newScopeDirective=newScopeDirective||directive;}directiveName=directive.name;\nif(!didScanForMultipleTransclusion&&(directive.replace&&(directive.templateUrl||directive.template)||directive.transclude&&!directive.$$tlb)){var candidateDirective;for(var scanningIndex=i+1;candidateDirective=directives[scanningIndex++];){if(candidateDirective.transclude&&!candidateDirective.$$tlb||candidateDirective.replace&&(candidateDirective.templateUrl||candidateDirective.template)){mightHaveMultipleTransclusionError=true;break;}}didScanForMultipleTransclusion=true;}if(!directive.templateUrl&&directive.controller){controllerDirectives=controllerDirectives||createMap();assertNoDuplicate('\\''+directiveName+'\\' controller',controllerDirectives[directiveName],directive,$compileNode);controllerDirectives[directiveName]=directive;}directiveValue=directive.transclude;if(directiveValue){hasTranscludeDirective=true;\nif(!directive.$$tlb){assertNoDuplicate('transclusion',nonTlbTranscludeDirective,directive,$compileNode);nonTlbTranscludeDirective=directive;}if(directiveValue==='element'){hasElementTranscludeDirective=true;terminalPriority=directive.priority;$template=$compileNode;$compileNode=templateAttrs.$$element=jqLite(compile.$$createComment(directiveName,templateAttrs[directiveName]));compileNode=$compileNode[0];replaceWith(jqCollection,sliceArgs($template),compileNode);childTranscludeFn=compilationGenerator(mightHaveMultipleTransclusionError,$template,transcludeFn,terminalPriority,replaceDirective&&replaceDirective.name,{\nnonTlbTranscludeDirective:nonTlbTranscludeDirective});}else {var slots=createMap();if(!isObject(directiveValue)){$template=jqLite(jqLiteClone(compileNode)).contents();}else {\n$template=window.document.createDocumentFragment();var slotMap=createMap();var filledSlots=createMap();\nforEach(directiveValue,function(elementSelector,slotName){\nvar optional=elementSelector.charAt(0)==='?';elementSelector=optional?elementSelector.substring(1):elementSelector;slotMap[elementSelector]=slotName;\nslots[slotName]=null;\nfilledSlots[slotName]=optional;});\nforEach($compileNode.contents(),function(node){var slotName=slotMap[directiveNormalize(nodeName_(node))];if(slotName){filledSlots[slotName]=true;slots[slotName]=slots[slotName]||window.document.createDocumentFragment();slots[slotName].appendChild(node);}else {$template.appendChild(node);}});\nforEach(filledSlots,function(filled,slotName){if(!filled){throw $compileMinErr('reqslot','Required transclusion slot `{0}` was not filled.',slotName);}});for(var slotName in slots){if(slots[slotName]){\nvar slotCompileNodes=jqLite(slots[slotName].childNodes);slots[slotName]=compilationGenerator(mightHaveMultipleTransclusionError,slotCompileNodes,transcludeFn);}}$template=jqLite($template.childNodes);}$compileNode.empty();\nchildTranscludeFn=compilationGenerator(mightHaveMultipleTransclusionError,$template,transcludeFn,undefined,undefined,{needsNewScope:directive.$$isolateScope||directive.$$newScope});childTranscludeFn.$$slots=slots;}}if(directive.template){hasTemplate=true;assertNoDuplicate('template',templateDirective,directive,$compileNode);templateDirective=directive;directiveValue=isFunction(directive.template)?directive.template($compileNode,templateAttrs):directive.template;directiveValue=denormalizeTemplate(directiveValue);if(directive.replace){replaceDirective=directive;if(jqLiteIsTextNode(directiveValue)){$template=[];}else {$template=removeComments(wrapTemplate(directive.templateNamespace,trim(directiveValue)));}compileNode=$template[0];if($template.length!==1||compileNode.nodeType!==NODE_TYPE_ELEMENT){throw $compileMinErr('tplrt','Template for directive \\'{0}\\' must have exactly one root element. {1}',directiveName,'');}replaceWith(jqCollection,$compileNode,compileNode);var newTemplateAttrs={$attr:{}};\nvar templateDirectives=collectDirectives(compileNode,[],newTemplateAttrs);var unprocessedDirectives=directives.splice(i+1,directives.length-(i+1));if(newIsolateScopeDirective||newScopeDirective){\nmarkDirectiveScope(templateDirectives,newIsolateScopeDirective,newScopeDirective);}directives=directives.concat(templateDirectives).concat(unprocessedDirectives);mergeTemplateAttributes(templateAttrs,newTemplateAttrs);ii=directives.length;}else {$compileNode.html(directiveValue);}}if(directive.templateUrl){hasTemplate=true;assertNoDuplicate('template',templateDirective,directive,$compileNode);templateDirective=directive;if(directive.replace){replaceDirective=directive;}\nnodeLinkFn=compileTemplateUrl(directives.splice(i,directives.length-i),$compileNode,templateAttrs,jqCollection,hasTranscludeDirective&&childTranscludeFn,preLinkFns,postLinkFns,{controllerDirectives:controllerDirectives,newScopeDirective:newScopeDirective!==directive&&newScopeDirective,newIsolateScopeDirective:newIsolateScopeDirective,templateDirective:templateDirective,nonTlbTranscludeDirective:nonTlbTranscludeDirective});ii=directives.length;}else if(directive.compile){try{linkFn=directive.compile($compileNode,templateAttrs,childTranscludeFn);var context=directive.$$originalDirective||directive;if(isFunction(linkFn)){addLinkFns(null,bind(context,linkFn),attrStart,attrEnd);}else if(linkFn){addLinkFns(bind(context,linkFn.pre),bind(context,linkFn.post),attrStart,attrEnd);}}catch(e){$exceptionHandler(e,startingTag($compileNode));}}if(directive.terminal){nodeLinkFn.terminal=true;terminalPriority=Math.max(terminalPriority,directive.priority);}}nodeLinkFn.scope=newScopeDirective&&newScopeDirective.scope===true;nodeLinkFn.transcludeOnThisElement=hasTranscludeDirective;nodeLinkFn.templateOnThisElement=hasTemplate;nodeLinkFn.transclude=childTranscludeFn;previousCompileContext.hasElementTranscludeDirective=hasElementTranscludeDirective;\nreturn nodeLinkFn;\nfunction addLinkFns(pre,post,attrStart,attrEnd){if(pre){if(attrStart)pre=groupElementsLinkFnWrapper(pre,attrStart,attrEnd);pre.require=directive.require;pre.directiveName=directiveName;if(newIsolateScopeDirective===directive||directive.$$isolateScope){pre=cloneAndAnnotateFn(pre,{isolateScope:true});}preLinkFns.push(pre);}if(post){if(attrStart)post=groupElementsLinkFnWrapper(post,attrStart,attrEnd);post.require=directive.require;post.directiveName=directiveName;if(newIsolateScopeDirective===directive||directive.$$isolateScope){post=cloneAndAnnotateFn(post,{isolateScope:true});}postLinkFns.push(post);}}function nodeLinkFn(childLinkFn,scope,linkNode,$rootElement,boundTranscludeFn){var i,ii,linkFn,isolateScope,controllerScope,elementControllers,transcludeFn,$element,attrs,scopeBindingInfo;if(compileNode===linkNode){attrs=templateAttrs;$element=templateAttrs.$$element;}else {$element=jqLite(linkNode);attrs=new Attributes($element,templateAttrs);}controllerScope=scope;if(newIsolateScopeDirective){isolateScope=scope.$new(true);}else if(newScopeDirective){controllerScope=scope.$parent;}if(boundTranscludeFn){\ntranscludeFn=controllersBoundTransclude;transcludeFn.$$boundTransclude=boundTranscludeFn;\ntranscludeFn.isSlotFilled=function(slotName){return !!boundTranscludeFn.$$slots[slotName];};}if(controllerDirectives){elementControllers=setupControllers($element,attrs,transcludeFn,controllerDirectives,isolateScope,scope,newIsolateScopeDirective);}if(newIsolateScopeDirective){\ncompile.$$addScopeInfo($element,isolateScope,true,!(templateDirective&&(templateDirective===newIsolateScopeDirective||templateDirective===newIsolateScopeDirective.$$originalDirective)));compile.$$addScopeClass($element,true);isolateScope.$$isolateBindings=newIsolateScopeDirective.$$isolateBindings;scopeBindingInfo=initializeDirectiveBindings(scope,attrs,isolateScope,isolateScope.$$isolateBindings,newIsolateScopeDirective);if(scopeBindingInfo.removeWatches){isolateScope.$on('$destroy',scopeBindingInfo.removeWatches);}}\nfor(var name in elementControllers){var controllerDirective=controllerDirectives[name];var controller=elementControllers[name];var bindings=controllerDirective.$$bindings.bindToController;controller.instance=controller();$element.data('$'+controllerDirective.name+'Controller',controller.instance);controller.bindingInfo=initializeDirectiveBindings(controllerScope,attrs,controller.instance,bindings,controllerDirective);}\nforEach(controllerDirectives,function(controllerDirective,name){var require=controllerDirective.require;if(controllerDirective.bindToController&&!isArray(require)&&isObject(require)){extend(elementControllers[name].instance,getControllers(name,require,$element,elementControllers));}});\nforEach(elementControllers,function(controller){var controllerInstance=controller.instance;if(isFunction(controllerInstance.$onChanges)){try{controllerInstance.$onChanges(controller.bindingInfo.initialChanges);}catch(e){$exceptionHandler(e);}}if(isFunction(controllerInstance.$onInit)){try{controllerInstance.$onInit();}catch(e){$exceptionHandler(e);}}if(isFunction(controllerInstance.$doCheck)){controllerScope.$watch(function(){controllerInstance.$doCheck();});controllerInstance.$doCheck();}if(isFunction(controllerInstance.$onDestroy)){controllerScope.$on('$destroy',function callOnDestroyHook(){controllerInstance.$onDestroy();});}});\nfor(i=0,ii=preLinkFns.length;i=0;i--){linkFn=postLinkFns[i];invokeLinkFn(linkFn,linkFn.isolateScope?isolateScope:scope,$element,attrs,linkFn.require&&getControllers(linkFn.directiveName,linkFn.require,$element,elementControllers),transcludeFn);}\nforEach(elementControllers,function(controller){var controllerInstance=controller.instance;if(isFunction(controllerInstance.$postLink)){controllerInstance.$postLink();}});\nfunction controllersBoundTransclude(scope,cloneAttachFn,futureParentElement,slotName){var transcludeControllers;\nif(!isScope(scope)){slotName=futureParentElement;futureParentElement=cloneAttachFn;cloneAttachFn=scope;scope=undefined;}if(hasElementTranscludeDirective){transcludeControllers=elementControllers;}if(!futureParentElement){futureParentElement=hasElementTranscludeDirective?$element.parent():$element;}if(slotName){\nvar slotTranscludeFn=boundTranscludeFn.$$slots[slotName];if(slotTranscludeFn){return slotTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}else if(isUndefined(slotTranscludeFn)){throw $compileMinErr('noslot','No parent directive that requires a transclusion with slot name \"{0}\". '+'Element: {1}',slotName,startingTag($element));}}else {return boundTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);}}}}function getControllers(directiveName,require,$element,elementControllers){var value;if(isString(require)){var match=require.match(REQUIRE_PREFIX_REGEXP);var name=require.substring(match[0].length);var inheritType=match[1]||match[3];var optional=match[2]==='?';\nif(inheritType==='^^'){$element=$element.parent();\n}else {value=elementControllers&&elementControllers[name];value=value&&value.instance;}if(!value){var dataName='$'+name+'Controller';if(inheritType==='^^'&&$element[0]&&$element[0].nodeType===NODE_TYPE_DOCUMENT){\nvalue=null;}else {value=inheritType?$element.inheritedData(dataName):$element.data(dataName);}}if(!value&&!optional){throw $compileMinErr('ctreq','Controller \\'{0}\\', required by directive \\'{1}\\', can\\'t be found!',name,directiveName);}}else if(isArray(require)){value=[];for(var i=0,ii=require.length;idirective.priority)&&directive.restrict.indexOf(location)!==-1){if(startAttrName){directive=inherit(directive,{$$start:startAttrName,$$end:endAttrName});}if(!directive.$$bindings){var bindings=directive.$$bindings=parseDirectiveBindings(directive,directive.name);if(isObject(bindings.isolateScope)){directive.$$isolateBindings=bindings.isolateScope;}}tDirectives.push(directive);match=directive;}}}return match;}\nfunction directiveIsMultiElement(name){if(hasDirectives.hasOwnProperty(name)){for(var directive,directives=$injector.get(name+Suffix),i=0,ii=directives.length;i'+template+'';return wrapper.childNodes[0].childNodes;default:return template;}}function getTrustedAttrContext(nodeName,attrNormalizedName){if(attrNormalizedName==='srcdoc'){return $sce.HTML;}\nif(attrNormalizedName==='src'||attrNormalizedName==='ngSrc'){if(['img','video','audio','source','track'].indexOf(nodeName)===-1){return $sce.RESOURCE_URL;}return $sce.MEDIA_URL;}else if(attrNormalizedName==='xlinkHref'){\nif(nodeName==='image')return $sce.MEDIA_URL;if(nodeName==='a')return $sce.URL;return $sce.RESOURCE_URL;}else if(\nnodeName==='form'&&attrNormalizedName==='action'||\nnodeName==='base'&&attrNormalizedName==='href'||\nnodeName==='link'&&attrNormalizedName==='href'){return $sce.RESOURCE_URL;}else if(nodeName==='a'&&(attrNormalizedName==='href'||attrNormalizedName==='ngHref')){return $sce.URL;}}function getTrustedPropContext(nodeName,propNormalizedName){var prop=propNormalizedName.toLowerCase();return PROP_CONTEXTS[nodeName+'|'+prop]||PROP_CONTEXTS['*|'+prop];}function sanitizeSrcsetPropertyValue(value){return sanitizeSrcset($sce.valueOf(value),'ng-prop-srcset');}function addPropertyDirective(node,directives,attrName,propName){if(EVENT_HANDLER_ATTR_REGEXP.test(propName)){throw $compileMinErr('nodomevents','Property bindings for HTML DOM event properties are disallowed');}var nodeName=nodeName_(node);var trustedContext=getTrustedPropContext(nodeName,propName);var sanitizer=identity;\nif(propName==='srcset'&&(nodeName==='img'||nodeName==='source')){sanitizer=sanitizeSrcsetPropertyValue;}else if(trustedContext){sanitizer=$sce.getTrusted.bind($sce,trustedContext);}directives.push({priority:100,compile:function ngPropCompileFn(_,attr){var ngPropGetter=$parse(attr[attrName]);var ngPropWatch=$parse(attr[attrName],function sceValueOf(val){\nreturn $sce.valueOf(val);});return {pre:function ngPropPreLinkFn(scope,$element){function applyPropValue(){var propValue=ngPropGetter(scope);$element[0][propName]=sanitizer(propValue);}applyPropValue();scope.$watch(ngPropWatch,applyPropValue);}};}});}function addEventDirective(directives,attrName,eventName){directives.push(createEventDirective($parse,$rootScope,$exceptionHandler,attrName,eventName,false));}function addAttrInterpolateDirective(node,directives,value,name,isNgAttr){var nodeName=nodeName_(node);var trustedContext=getTrustedAttrContext(nodeName,name);var mustHaveExpression=!isNgAttr;var allOrNothing=ALL_OR_NOTHING_ATTRS[name]||isNgAttr;var interpolateFn=$interpolate(value,mustHaveExpression,trustedContext,allOrNothing);\nif(!interpolateFn)return;if(name==='multiple'&&nodeName==='select'){throw $compileMinErr('selmulti','Binding to the \\'multiple\\' attribute is not supported. Element: {0}',startingTag(node));}if(EVENT_HANDLER_ATTR_REGEXP.test(name)){throw $compileMinErr('nodomevents','Interpolations for HTML DOM event attributes are disallowed');}directives.push({priority:100,compile:function(){return {pre:function attrInterpolatePreLinkFn(scope,element,attr){var $$observers=attr.$$observers||(attr.$$observers=createMap());\nvar newValue=attr[name];if(newValue!==value){\ninterpolateFn=newValue&&$interpolate(newValue,true,trustedContext,allOrNothing);value=newValue;}\nif(!interpolateFn)return;\nattr[name]=interpolateFn(scope);($$observers[name]||($$observers[name]=[])).$$inter=true;(attr.$$observers&&attr.$$observers[name].$$scope||scope).$watch(interpolateFn,function interpolateFnWatchAction(newValue,oldValue){\nif(name==='class'&&newValue!==oldValue){attr.$updateClass(newValue,oldValue);}else {attr.$set(name,newValue);}});}};}});}\nfunction replaceWith($rootElement,elementsToRemove,newNode){var firstElementToRemove=elementsToRemove[0],removeCount=elementsToRemove.length,parent=firstElementToRemove.parentNode,i,ii;if($rootElement){for(i=0,ii=$rootElement.length;i0?' ':'')+token;}return values;}function removeComments(jqNodes){jqNodes=jqLite(jqNodes);var i=jqNodes.length;if(i<=1){return jqNodes;}while(i--){var node=jqNodes[i];if(node.nodeType===NODE_TYPE_COMMENT||node.nodeType===NODE_TYPE_TEXT&&node.nodeValue.trim()===''){splice.call(jqNodes,i,1);}}return jqNodes;}var $controllerMinErr=minErr('$controller');var CNTRL_REG=/^(\\S+)(\\s+as\\s+([\\w$]+))?$/;function identifierForController(controller,ident){if(ident&&isString(ident))return ident;if(isString(controller)){var match=CNTRL_REG.exec(controller);if(match)return match[3];}}\nfunction $ControllerProvider(){var controllers={};\nthis.has=function(name){return controllers.hasOwnProperty(name);};\nthis.register=function(name,constructor){assertNotHasOwnProperty(name,'controller');if(isObject(name)){extend(controllers,name);}else {controllers[name]=constructor;}};this.$get=['$injector',function($injector){\nreturn function $controller(expression,locals,later,ident){\nvar instance,match,constructor,identifier;later=later===true;if(ident&&isString(ident)){identifier=ident;}if(isString(expression)){match=expression.match(CNTRL_REG);if(!match){throw $controllerMinErr('ctrlfmt','Badly formed controller string \\'{0}\\'. '+'Must match `__name__ as __id__` or `__name__`.',expression);}constructor=match[1];identifier=identifier||match[3];expression=controllers.hasOwnProperty(constructor)?controllers[constructor]:getter(locals.$scope,constructor,true);if(!expression){throw $controllerMinErr('ctrlreg','The controller with the name \\'{0}\\' is not registered.',constructor);}assertArgFn(expression,constructor,true);}if(later){\nvar controllerPrototype=(isArray(expression)?expression[expression.length-1]:expression).prototype;instance=Object.create(controllerPrototype||null);if(identifier){addIdentifier(locals,identifier,instance,constructor||expression.name);}return extend(function $controllerInit(){var result=$injector.invoke(expression,instance,locals,constructor);if(result!==instance&&(isObject(result)||isFunction(result))){instance=result;if(identifier){\naddIdentifier(locals,identifier,instance,constructor||expression.name);}}return instance;},{instance:instance,identifier:identifier});}instance=$injector.instantiate(expression,locals,constructor);if(identifier){addIdentifier(locals,identifier,instance,constructor||expression.name);}return instance;};function addIdentifier(locals,identifier,instance,name){if(!(locals&&isObject(locals.$scope))){throw minErr('$controller')('noscp','Cannot export controller \\'{0}\\' as \\'{1}\\'! No $scope object provided via `locals`.',name,identifier);}locals.$scope[identifier]=instance;}}];}\nfunction $DocumentProvider(){this.$get=['$window',function(window){return jqLite(window.document);}];}\nfunction $$IsDocumentHiddenProvider(){this.$get=['$document','$rootScope',function($document,$rootScope){var doc=$document[0];var hidden=doc&&doc.hidden;$document.on('visibilitychange',changeListener);$rootScope.$on('$destroy',function(){$document.off('visibilitychange',changeListener);});function changeListener(){hidden=doc.hidden;}return function(){return hidden;};}];}\nfunction $ExceptionHandlerProvider(){this.$get=['$log',function($log){return function(exception,cause){$log.error.apply($log,arguments);};}];}var $$ForceReflowProvider=function(){this.$get=['$document',function($document){return function(domNode){\nif(domNode){if(!domNode.nodeType&&domNode instanceof jqLite){domNode=domNode[0];}}else {domNode=$document[0].body;}return domNode.offsetWidth+1;};}];};var APPLICATION_JSON='application/json';var CONTENT_TYPE_APPLICATION_JSON={'Content-Type':APPLICATION_JSON+';charset=utf-8'};var JSON_START=/^\\[|^\\{(?!\\{)/;var JSON_ENDS={'[':/]$/,'{':/}$/};var JSON_PROTECTION_PREFIX=/^\\)]\\}',?\\n/;var $httpMinErr=minErr('$http');function serializeValue(v){if(isObject(v)){return isDate(v)?v.toISOString():toJson(v);}return v;}function $HttpParamSerializerProvider(){\nthis.$get=function(){return function ngParamSerializer(params){if(!params)return '';var parts=[];forEachSorted(params,function(value,key){if(value===null||isUndefined(value)||isFunction(value))return;if(isArray(value)){forEach(value,function(v){parts.push(encodeUriQuery(key)+'='+encodeUriQuery(serializeValue(v)));});}else {parts.push(encodeUriQuery(key)+'='+encodeUriQuery(serializeValue(value)));}});return parts.join('&');};};}function $HttpParamSerializerJQLikeProvider(){\nthis.$get=function(){return function jQueryLikeParamSerializer(params){if(!params)return '';var parts=[];serialize(params,'',true);return parts.join('&');function serialize(toSerialize,prefix,topLevel){if(isArray(toSerialize)){forEach(toSerialize,function(value,index){serialize(value,prefix+'['+(isObject(value)?index:'')+']');});}else if(isObject(toSerialize)&&!isDate(toSerialize)){forEachSorted(toSerialize,function(value,key){serialize(value,prefix+(topLevel?'':'[')+key+(topLevel?'':']'));});}else {if(isFunction(toSerialize)){toSerialize=toSerialize();}parts.push(encodeUriQuery(prefix)+'='+(toSerialize==null?'':encodeUriQuery(serializeValue(toSerialize))));}}};};}function defaultHttpResponseTransform(data,headers){if(isString(data)){\nvar tempData=data.replace(JSON_PROTECTION_PREFIX,'').trim();if(tempData){var contentType=headers('Content-Type');var hasJsonContentType=contentType&&contentType.indexOf(APPLICATION_JSON)===0;if(hasJsonContentType||isJsonLike(tempData)){try{data=fromJson(tempData);}catch(e){if(!hasJsonContentType){return data;}throw $httpMinErr('baddata','Data must be a valid JSON object. Received: \"{0}\". '+'Parse error: \"{1}\"',data,e);}}}}return data;}function isJsonLike(str){var jsonStart=str.match(JSON_START);return jsonStart&&JSON_ENDS[jsonStart[0]].test(str);}\nfunction parseHeaders(headers){var parsed=createMap(),i;function fillInParsed(key,val){if(key){parsed[key]=parsed[key]?parsed[key]+', '+val:val;}}if(isString(headers)){forEach(headers.split('\\n'),function(line){i=line.indexOf(':');fillInParsed(lowercase(trim(line.substr(0,i))),trim(line.substr(i+1)));});}else if(isObject(headers)){forEach(headers,function(headerVal,headerKey){fillInParsed(lowercase(headerKey),trim(headerVal));});}return parsed;}\nfunction headersGetter(headers){var headersObj;return function(name){if(!headersObj)headersObj=parseHeaders(headers);if(name){var value=headersObj[lowercase(name)];if(value===undefined){value=null;}return value;}return headersObj;};}\nfunction transformData(data,headers,status,fns){if(isFunction(fns)){return fns(data,headers,status);}forEach(fns,function(fn){data=fn(data,headers,status);});return data;}function isSuccess(status){return 200<=status&&status<300;}\nfunction $HttpProvider(){\nvar defaults=this.defaults={\ntransformResponse:[defaultHttpResponseTransform],\ntransformRequest:[function(d){return isObject(d)&&!isFile(d)&&!isBlob(d)&&!isFormData(d)?toJson(d):d;}],\nheaders:{common:{'Accept':'application/json, text/plain, */*'},post:shallowCopy(CONTENT_TYPE_APPLICATION_JSON),put:shallowCopy(CONTENT_TYPE_APPLICATION_JSON),patch:shallowCopy(CONTENT_TYPE_APPLICATION_JSON)},xsrfCookieName:'XSRF-TOKEN',xsrfHeaderName:'X-XSRF-TOKEN',paramSerializer:'$httpParamSerializer',jsonpCallbackParam:'callback'};var useApplyAsync=false;\nthis.useApplyAsync=function(value){if(isDefined(value)){useApplyAsync=!!value;return this;}return useApplyAsync;};\nvar interceptorFactories=this.interceptors=[];\nvar xsrfWhitelistedOrigins=this.xsrfWhitelistedOrigins=[];this.$get=['$browser','$httpBackend','$$cookieReader','$cacheFactory','$rootScope','$q','$injector','$sce',function($browser,$httpBackend,$$cookieReader,$cacheFactory,$rootScope,$q,$injector,$sce){var defaultCache=$cacheFactory('$http');\ndefaults.paramSerializer=isString(defaults.paramSerializer)?$injector.get(defaults.paramSerializer):defaults.paramSerializer;\nvar reversedInterceptors=[];forEach(interceptorFactories,function(interceptorFactory){reversedInterceptors.unshift(isString(interceptorFactory)?$injector.get(interceptorFactory):$injector.invoke(interceptorFactory));});\nvar urlIsAllowedOrigin=urlIsAllowedOriginFactory(xsrfWhitelistedOrigins);\nfunction $http(requestConfig){if(!isObject(requestConfig)){throw minErr('$http')('badreq','Http request configuration must be an object. Received: {0}',requestConfig);}if(!isString($sce.valueOf(requestConfig.url))){throw minErr('$http')('badreq','Http request configuration url must be a string or a $sce trusted object. Received: {0}',requestConfig.url);}var config=extend({method:'get',transformRequest:defaults.transformRequest,transformResponse:defaults.transformResponse,paramSerializer:defaults.paramSerializer,jsonpCallbackParam:defaults.jsonpCallbackParam},requestConfig);config.headers=mergeHeaders(requestConfig);config.method=uppercase(config.method);config.paramSerializer=isString(config.paramSerializer)?$injector.get(config.paramSerializer):config.paramSerializer;$browser.$$incOutstandingRequestCount('$http');var requestInterceptors=[];var responseInterceptors=[];var promise=$q.resolve(config);\nforEach(reversedInterceptors,function(interceptor){if(interceptor.request||interceptor.requestError){requestInterceptors.unshift(interceptor.request,interceptor.requestError);}if(interceptor.response||interceptor.responseError){responseInterceptors.push(interceptor.response,interceptor.responseError);}});promise=chainInterceptors(promise,requestInterceptors);promise=promise.then(serverRequest);promise=chainInterceptors(promise,responseInterceptors);promise=promise.finally(completeOutstandingRequest);return promise;function chainInterceptors(promise,interceptors){for(var i=0,ii=interceptors.length;i=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText,xhrStatus:xhrStatus});}function resolvePromiseWithResult(result){resolvePromise(result.data,result.status,shallowCopy(result.headers()),result.statusText,result.xhrStatus);}function removePendingReq(){var idx=$http.pendingRequests.indexOf(config);if(idx!==-1)$http.pendingRequests.splice(idx,1);}}function buildUrl(url,serializedParams){if(serializedParams.length>0){url+=(url.indexOf('?')===-1?'?':'&')+serializedParams;}return url;}function sanitizeJsonpCallbackParam(url,cbKey){var parts=url.split('?');if(parts.length>2){\nthrow $httpMinErr('badjsonp','Illegal use more than one \"?\", in url, \"{1}\"',url);}var params=parseKeyValue(parts[1]);forEach(params,function(value,key){if(value==='JSON_CALLBACK'){\nthrow $httpMinErr('badjsonp','Illegal use of JSON_CALLBACK in url, \"{0}\"',url);}if(key===cbKey){\nthrow $httpMinErr('badjsonp','Illegal use of callback param, \"{0}\", in url, \"{1}\"',cbKey,url);}});\nurl+=(url.indexOf('?')===-1?'?':'&')+cbKey+'=JSON_CALLBACK';return url;}}];}\nfunction $xhrFactoryProvider(){this.$get=function(){return function createXhr(){return new window.XMLHttpRequest();};};}\nfunction $HttpBackendProvider(){this.$get=['$browser','$jsonpCallbacks','$document','$xhrFactory',function($browser,$jsonpCallbacks,$document,$xhrFactory){return createHttpBackend($browser,$xhrFactory,$browser.defer,$jsonpCallbacks,$document[0]);}];}function createHttpBackend($browser,createXhr,$browserDefer,callbacks,rawDocument){\nreturn function(method,url,post,callback,headers,timeout,withCredentials,responseType,eventHandlers,uploadEventHandlers){url=url||$browser.url();if(lowercase(method)==='jsonp'){var callbackPath=callbacks.createCallback(url);var jsonpDone=jsonpReq(url,callbackPath,function(status,text){\nvar response=status===200&&callbacks.getResponse(callbackPath);completeRequest(callback,status,response,'',text,'complete');callbacks.removeCallback(callbackPath);});}else {var xhr=createXhr(method,url);var abortedByTimeout=false;xhr.open(method,url,true);forEach(headers,function(value,key){if(isDefined(value)){xhr.setRequestHeader(key,value);}});xhr.onload=function requestLoaded(){var statusText=xhr.statusText||'';\nvar response='response'in xhr?xhr.response:xhr.responseText;\nvar status=xhr.status===1223?204:xhr.status;\nif(status===0){status=response?200:urlResolve(url).protocol==='file'?404:0;}completeRequest(callback,status,response,xhr.getAllResponseHeaders(),statusText,'complete');};var requestError=function(){\ncompleteRequest(callback,-1,null,null,'','error');};var requestAborted=function(){completeRequest(callback,-1,null,null,'',abortedByTimeout?'timeout':'abort');};var requestTimeout=function(){\ncompleteRequest(callback,-1,null,null,'','timeout');};xhr.onerror=requestError;xhr.ontimeout=requestTimeout;xhr.onabort=requestAborted;forEach(eventHandlers,function(value,key){xhr.addEventListener(key,value);});forEach(uploadEventHandlers,function(value,key){xhr.upload.addEventListener(key,value);});if(withCredentials){xhr.withCredentials=true;}if(responseType){try{xhr.responseType=responseType;}catch(e){\nif(responseType!=='json'){throw e;}}}xhr.send(isUndefined(post)?null:post);}\nif(timeout>0){var timeoutId=$browserDefer(function(){timeoutRequest('timeout');},timeout);}else if(isPromiseLike(timeout)){timeout.then(function(){timeoutRequest(isDefined(timeout.$$timeoutId)?'timeout':'abort');});}function timeoutRequest(reason){abortedByTimeout=reason==='timeout';if(jsonpDone){jsonpDone();}if(xhr){xhr.abort();}}function completeRequest(callback,status,response,headersString,statusText,xhrStatus){\nif(isDefined(timeoutId)){$browserDefer.cancel(timeoutId);}jsonpDone=xhr=null;callback(status,response,headersString,statusText,xhrStatus);}};function jsonpReq(url,callbackPath,done){url=url.replace('JSON_CALLBACK',callbackPath);\nvar script=rawDocument.createElement('script'),callback=null;script.type='text/javascript';script.src=url;script.async=true;callback=function(event){script.removeEventListener('load',callback);script.removeEventListener('error',callback);rawDocument.body.removeChild(script);script=null;var status=-1;var text='unknown';if(event){if(event.type==='load'&&!callbacks.wasCalled(callbackPath)){event={type:'error'};}text=event.type;status=event.type==='error'?404:200;}if(done){done(status,text);}};script.addEventListener('load',callback);script.addEventListener('error',callback);rawDocument.body.appendChild(script);return callback;}}var $interpolateMinErr=angular.$interpolateMinErr=minErr('$interpolate');$interpolateMinErr.throwNoconcat=function(text){throw $interpolateMinErr('noconcat','Error while interpolating: {0}\\nStrict Contextual Escaping disallows '+'interpolations that concatenate multiple expressions when a trusted value is '+'required. See http://docs.angularjs.org/api/ng.$sce',text);};$interpolateMinErr.interr=function(text,err){return $interpolateMinErr('interr','Can\\'t interpolate: {0}\\n{1}',text,err.toString());};\nfunction $InterpolateProvider(){var startSymbol='{{';var endSymbol='}}';\nthis.startSymbol=function(value){if(value){startSymbol=value;return this;}return startSymbol;};\nthis.endSymbol=function(value){if(value){endSymbol=value;return this;}return endSymbol;};this.$get=['$parse','$exceptionHandler','$sce',function($parse,$exceptionHandler,$sce){var startSymbolLength=startSymbol.length,endSymbolLength=endSymbol.length,escapedStartRegexp=new RegExp(startSymbol.replace(/./g,escape),'g'),escapedEndRegexp=new RegExp(endSymbol.replace(/./g,escape),'g');function escape(ch){return '\\\\\\\\\\\\'+ch;}function unescapeText(text){return text.replace(escapedStartRegexp,startSymbol).replace(escapedEndRegexp,endSymbol);}\nfunction constantWatchDelegate(scope,listener,objectEquality,constantInterp){var unwatch=scope.$watch(function constantInterpolateWatch(scope){unwatch();return constantInterp(scope);},listener,objectEquality);return unwatch;}\nfunction $interpolate(text,mustHaveExpression,trustedContext,allOrNothing){var contextAllowsConcatenation=trustedContext===$sce.URL||trustedContext===$sce.MEDIA_URL;\nif(!text.length||text.indexOf(startSymbol)===-1){if(mustHaveExpression)return;var unescapedText=unescapeText(text);if(contextAllowsConcatenation){unescapedText=$sce.getTrusted(trustedContext,unescapedText);}var constantInterp=valueFn(unescapedText);constantInterp.exp=text;constantInterp.expressions=[];constantInterp.$$watchDelegate=constantWatchDelegate;return constantInterp;}allOrNothing=!!allOrNothing;var startIndex,endIndex,index=0,expressions=[],parseFns,textLength=text.length,exp,concat=[],expressionPositions=[],singleExpression;while(index1){\n$interpolateMinErr.throwNoconcat(text);}\nreturn concat.join('');};return extend(function interpolationFn(context){var i=0;var ii=expressions.length;var values=new Array(ii);try{for(;i4,args=hasParams?sliceArgs(arguments,4):[],iteration=0,skipApply=isDefined(invokeApply)&&!invokeApply,deferred=(skipApply?$$q:$q).defer(),promise=deferred.promise;count=isDefined(count)?count:0;function callback(){if(!hasParams){fn(iteration);}else {fn.apply(null,args);}}function tick(){if(skipApply){$browser.defer(callback);}else {$rootScope.$evalAsync(callback);}deferred.notify(iteration++);if(count>0&&iteration>=count){deferred.resolve(iteration);clearIntervalFn(promise.$$intervalId);}if(!skipApply)$rootScope.$apply();}promise.$$intervalId=setIntervalFn(tick,delay,deferred,skipApply);return promise;};};}];}\nvar $jsonpCallbacksProvider=function(){this.$get=function(){var callbacks=angular.callbacks;var callbackMap={};function createCallback(callbackId){var callback=function(data){callback.data=data;callback.called=true;};callback.id=callbackId;return callback;}return {\ncreateCallback:function(url){var callbackId='_'+(callbacks.$$counter++).toString(36);var callbackPath='angular.callbacks.'+callbackId;var callback=createCallback(callbackId);callbackMap[callbackPath]=callbacks[callbackId]=callback;return callbackPath;},\nwasCalled:function(callbackPath){return callbackMap[callbackPath].called;},\ngetResponse:function(callbackPath){return callbackMap[callbackPath].data;},\nremoveCallback:function(callbackPath){var callback=callbackMap[callbackPath];delete callbacks[callback.id];delete callbackMap[callbackPath];}};};};\n var PATH_MATCH=/^([^?#]*)(\\?([^#]*))?(#(.*))?$/,DEFAULT_PORTS={'http':80,'https':443,'ftp':21};var $locationMinErr=minErr('$location');\nfunction encodePath(path){var segments=path.split('/'),i=segments.length;while(i--){\nsegments[i]=encodeUriSegment(segments[i].replace(/%2F/g,'/'));}return segments.join('/');}function decodePath(path,html5Mode){var segments=path.split('/'),i=segments.length;while(i--){segments[i]=decodeURIComponent(segments[i]);if(html5Mode){\nsegments[i]=segments[i].replace(/\\//g,'%2F');}}return segments.join('/');}function normalizePath(pathValue,searchValue,hashValue){var search=toKeyValue(searchValue),hash=hashValue?'#'+encodeUriSegment(hashValue):'',path=encodePath(pathValue);return path+(search?'?'+search:'')+hash;}function parseAbsoluteUrl(absoluteUrl,locationObj){var parsedUrl=urlResolve(absoluteUrl);locationObj.$$protocol=parsedUrl.protocol;locationObj.$$host=parsedUrl.hostname;locationObj.$$port=toInt(parsedUrl.port)||DEFAULT_PORTS[parsedUrl.protocol]||null;}var DOUBLE_SLASH_REGEX=/^\\s*[\\\\/]{2,}/;function parseAppUrl(url,locationObj,html5Mode){if(DOUBLE_SLASH_REGEX.test(url)){throw $locationMinErr('badpath','Invalid url \"{0}\".',url);}var prefixed=url.charAt(0)!=='/';if(prefixed){url='/'+url;}var match=urlResolve(url);var path=prefixed&&match.pathname.charAt(0)==='/'?match.pathname.substring(1):match.pathname;locationObj.$$path=decodePath(path,html5Mode);locationObj.$$search=parseKeyValue(match.search);locationObj.$$hash=decodeURIComponent(match.hash);\nif(locationObj.$$path&&locationObj.$$path.charAt(0)!=='/'){locationObj.$$path='/'+locationObj.$$path;}}function startsWith(str,search){return str.slice(0,search.length)===search;}\nfunction stripBaseUrl(base,url){if(startsWith(url,base)){return url.substr(base.length);}}function stripHash(url){var index=url.indexOf('#');return index===-1?url:url.substr(0,index);}function stripFile(url){return url.substr(0,stripHash(url).lastIndexOf('/')+1);}function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//')+2));}\nfunction LocationHtml5Url(appBase,appBaseNoFile,basePrefix){this.$$html5=true;basePrefix=basePrefix||'';parseAbsoluteUrl(appBase,this);\nthis.$$parse=function(url){var pathUrl=stripBaseUrl(appBaseNoFile,url);if(!isString(pathUrl)){throw $locationMinErr('ipthprfx','Invalid url \"{0}\", missing path prefix \"{1}\".',url,appBaseNoFile);}parseAppUrl(pathUrl,this,true);if(!this.$$path){this.$$path='/';}this.$$compose();};this.$$normalizeUrl=function(url){return appBaseNoFile+url.substr(1);\n};this.$$parseLinkUrl=function(url,relHref){if(relHref&&relHref[0]==='#'){\nthis.hash(relHref.slice(1));return true;}var appUrl,prevAppUrl;var rewrittenUrl;if(isDefined(appUrl=stripBaseUrl(appBase,url))){prevAppUrl=appUrl;if(basePrefix&&isDefined(appUrl=stripBaseUrl(basePrefix,appUrl))){rewrittenUrl=appBaseNoFile+(stripBaseUrl('/',appUrl)||appUrl);}else {rewrittenUrl=appBase+prevAppUrl;}}else if(isDefined(appUrl=stripBaseUrl(appBaseNoFile,url))){rewrittenUrl=appBaseNoFile+appUrl;}else if(appBaseNoFile===url+'/'){rewrittenUrl=appBaseNoFile;}if(rewrittenUrl){this.$$parse(rewrittenUrl);}return !!rewrittenUrl;};}\nfunction LocationHashbangUrl(appBase,appBaseNoFile,hashPrefix){parseAbsoluteUrl(appBase,this);\nthis.$$parse=function(url){var withoutBaseUrl=stripBaseUrl(appBase,url)||stripBaseUrl(appBaseNoFile,url);var withoutHashUrl;if(!isUndefined(withoutBaseUrl)&&withoutBaseUrl.charAt(0)==='#'){\nwithoutHashUrl=stripBaseUrl(hashPrefix,withoutBaseUrl);if(isUndefined(withoutHashUrl)){\nwithoutHashUrl=withoutBaseUrl;}}else {\nif(this.$$html5){withoutHashUrl=withoutBaseUrl;}else {withoutHashUrl='';if(isUndefined(withoutBaseUrl)){appBase=url;this.replace();}}}parseAppUrl(withoutHashUrl,this,false);this.$$path=removeWindowsDriveName(this.$$path,withoutHashUrl,appBase);this.$$compose();\nfunction removeWindowsDriveName(path,url,base){\nvar windowsFilePathExp=/^\\/[A-Z]:(\\/.*)/;var firstPathSegmentMatch;\nif(startsWith(url,base)){url=url.replace(base,'');}\nif(windowsFilePathExp.exec(url)){return path;}firstPathSegmentMatch=windowsFilePathExp.exec(path);return firstPathSegmentMatch?firstPathSegmentMatch[1]:path;}};this.$$normalizeUrl=function(url){return appBase+(url?hashPrefix+url:'');};this.$$parseLinkUrl=function(url,relHref){if(stripHash(appBase)===stripHash(url)){this.$$parse(url);return true;}return false;};}\nfunction LocationHashbangInHtml5Url(appBase,appBaseNoFile,hashPrefix){this.$$html5=true;LocationHashbangUrl.apply(this,arguments);this.$$parseLinkUrl=function(url,relHref){if(relHref&&relHref[0]==='#'){\nthis.hash(relHref.slice(1));return true;}var rewrittenUrl;var appUrl;if(appBase===stripHash(url)){rewrittenUrl=url;}else if(appUrl=stripBaseUrl(appBaseNoFile,url)){rewrittenUrl=appBase+hashPrefix+appUrl;}else if(appBaseNoFile===url+'/'){rewrittenUrl=appBaseNoFile;}if(rewrittenUrl){this.$$parse(rewrittenUrl);}return !!rewrittenUrl;};this.$$normalizeUrl=function(url){\nreturn appBase+hashPrefix+url;};}var locationPrototype={\n$$absUrl:'',\n$$html5:false,\n$$replace:false,\n$$compose:function(){this.$$url=normalizePath(this.$$path,this.$$search,this.$$hash);this.$$absUrl=this.$$normalizeUrl(this.$$url);this.$$urlUpdatedByLocation=true;},\nabsUrl:locationGetter('$$absUrl'),\nurl:function(url){if(isUndefined(url)){return this.$$url;}var match=PATH_MATCH.exec(url);if(match[1]||url==='')this.path(decodeURIComponent(match[1]));if(match[2]||match[1]||url==='')this.search(match[3]||'');this.hash(match[5]||'');return this;},\nprotocol:locationGetter('$$protocol'),\nhost:locationGetter('$$host'),\nport:locationGetter('$$port'),\npath:locationGetterSetter('$$path',function(path){path=path!==null?path.toString():'';return path.charAt(0)==='/'?path:'/'+path;}),\nsearch:function(search,paramValue){switch(arguments.length){case 0:return this.$$search;case 1:if(isString(search)||isNumber(search)){search=search.toString();this.$$search=parseKeyValue(search);}else if(isObject(search)){search=copy(search,{});\nforEach(search,function(value,key){if(value==null)delete search[key];});this.$$search=search;}else {throw $locationMinErr('isrcharg','The first argument of the `$location#search()` call must be a string or an object.');}break;default:if(isUndefined(paramValue)||paramValue===null){delete this.$$search[search];}else {this.$$search[search]=paramValue;}}this.$$compose();return this;},\nhash:locationGetterSetter('$$hash',function(hash){return hash!==null?hash.toString():'';}),\nreplace:function(){this.$$replace=true;return this;}};forEach([LocationHashbangInHtml5Url,LocationHashbangUrl,LocationHtml5Url],function(Location){Location.prototype=Object.create(locationPrototype);\nLocation.prototype.state=function(state){if(!arguments.length){return this.$$state;}if(Location!==LocationHtml5Url||!this.$$html5){throw $locationMinErr('nostate','History API state support is available only '+'in HTML5 mode and only in browsers supporting HTML5 History API');}\nthis.$$state=isUndefined(state)?null:state;this.$$urlUpdatedByLocation=true;return this;};});function locationGetter(property){return(function(){return this[property];});}function locationGetterSetter(property,preprocess){return(function(value){if(isUndefined(value)){return this[property];}this[property]=preprocess(value);this.$$compose();return this;});}\nfunction $LocationProvider(){var hashPrefix='!',html5Mode={enabled:false,requireBase:true,rewriteLinks:true};\nthis.hashPrefix=function(prefix){if(isDefined(prefix)){hashPrefix=prefix;return this;}else {return hashPrefix;}};\nthis.html5Mode=function(mode){if(isBoolean(mode)){html5Mode.enabled=mode;return this;}else if(isObject(mode)){if(isBoolean(mode.enabled)){html5Mode.enabled=mode.enabled;}if(isBoolean(mode.requireBase)){html5Mode.requireBase=mode.requireBase;}if(isBoolean(mode.rewriteLinks)||isString(mode.rewriteLinks)){html5Mode.rewriteLinks=mode.rewriteLinks;}return this;}else {return html5Mode;}};\nthis.$get=['$rootScope','$browser','$sniffer','$rootElement','$window',function($rootScope,$browser,$sniffer,$rootElement,$window){var $location,LocationMode,baseHref=$browser.baseHref(),\ninitialUrl=$browser.url(),appBase;if(html5Mode.enabled){if(!baseHref&&html5Mode.requireBase){throw $locationMinErr('nobase','$location in HTML5 mode requires a tag to be present!');}appBase=serverBase(initialUrl)+(baseHref||'/');LocationMode=$sniffer.history?LocationHtml5Url:LocationHashbangInHtml5Url;}else {appBase=stripHash(initialUrl);LocationMode=LocationHashbangUrl;}var appBaseNoFile=stripFile(appBase);$location=new LocationMode(appBase,appBaseNoFile,'#'+hashPrefix);$location.$$parseLinkUrl(initialUrl,initialUrl);$location.$$state=$browser.state();var IGNORE_URI_REGEXP=/^\\s*(javascript|mailto):/i;\nfunction urlsEqual(a,b){return a===b||urlResolve(a).href===urlResolve(b).href;}function setBrowserUrlWithFallback(url,replace,state){var oldUrl=$location.url();var oldState=$location.$$state;try{$browser.url(url,replace,state);\n$location.$$state=$browser.state();}catch(e){\n$location.url(oldUrl);$location.$$state=oldState;throw e;}}$rootElement.on('click',function(event){var rewriteLinks=html5Mode.rewriteLinks;\nif(!rewriteLinks||event.ctrlKey||event.metaKey||event.shiftKey||event.which===2||event.button===2)return;var elm=jqLite(event.target);\nwhile(nodeName_(elm[0])!=='a'){\nif(elm[0]===$rootElement[0]||!(elm=elm.parent())[0])return;}if(isString(rewriteLinks)&&isUndefined(elm.attr(rewriteLinks)))return;var absHref=elm.prop('href');\nvar relHref=elm.attr('href')||elm.attr('xlink:href');if(isObject(absHref)&&absHref.toString()==='[object SVGAnimatedString]'){\nabsHref=urlResolve(absHref.animVal).href;}\nif(IGNORE_URI_REGEXP.test(absHref))return;if(absHref&&!elm.attr('target')&&!event.isDefaultPrevented()){if($location.$$parseLinkUrl(absHref,relHref)){\nevent.preventDefault();\nif($location.absUrl()!==$browser.url()){$rootScope.$apply();}}}});\nif($location.absUrl()!==initialUrl){$browser.url($location.absUrl(),true);}var initializing=true;\n$browser.onUrlChange(function(newUrl,newState){if(!startsWith(newUrl,appBaseNoFile)){\n$window.location.href=newUrl;return;}$rootScope.$evalAsync(function(){var oldUrl=$location.absUrl();var oldState=$location.$$state;var defaultPrevented;$location.$$parse(newUrl);$location.$$state=newState;defaultPrevented=$rootScope.$broadcast('$locationChangeStart',newUrl,oldUrl,newState,oldState).defaultPrevented;\nif($location.absUrl()!==newUrl)return;if(defaultPrevented){$location.$$parse(oldUrl);$location.$$state=oldState;setBrowserUrlWithFallback(oldUrl,false,oldState);}else {initializing=false;afterLocationChange(oldUrl,oldState);}});if(!$rootScope.$$phase)$rootScope.$digest();});\n$rootScope.$watch(function $locationWatch(){if(initializing||$location.$$urlUpdatedByLocation){$location.$$urlUpdatedByLocation=false;var oldUrl=$browser.url();var newUrl=$location.absUrl();var oldState=$browser.state();var currentReplace=$location.$$replace;var urlOrStateChanged=!urlsEqual(oldUrl,newUrl)||$location.$$html5&&$sniffer.history&&oldState!==$location.$$state;if(initializing||urlOrStateChanged){initializing=false;$rootScope.$evalAsync(function(){var newUrl=$location.absUrl();var defaultPrevented=$rootScope.$broadcast('$locationChangeStart',newUrl,oldUrl,$location.$$state,oldState).defaultPrevented;\nif($location.absUrl()!==newUrl)return;if(defaultPrevented){$location.$$parse(oldUrl);$location.$$state=oldState;}else {if(urlOrStateChanged){setBrowserUrlWithFallback(newUrl,currentReplace,oldState===$location.$$state?null:$location.$$state);}afterLocationChange(oldUrl,oldState);}});}}$location.$$replace=false;\n});return $location;function afterLocationChange(oldUrl,oldState){$rootScope.$broadcast('$locationChangeSuccess',$location.absUrl(),oldUrl,$location.$$state,oldState);}}];}\nfunction $LogProvider(){var debug=true,self=this;\nthis.debugEnabled=function(flag){if(isDefined(flag)){debug=flag;return this;}else {return debug;}};this.$get=['$window',function($window){\nvar formatStackTrace=msie||/\\bEdge\\//.test($window.navigator&&$window.navigator.userAgent);return {\nlog:consoleLog('log'),\ninfo:consoleLog('info'),\nwarn:consoleLog('warn'),\nerror:consoleLog('error'),\ndebug:function(){var fn=consoleLog('debug');return function(){if(debug){fn.apply(self,arguments);}};}()};function formatError(arg){if(isError(arg)){if(arg.stack&&formatStackTrace){arg=arg.message&&arg.stack.indexOf(arg.message)===-1?'Error: '+arg.message+'\\n'+arg.stack:arg.stack;}else if(arg.sourceURL){arg=arg.message+'\\n'+arg.sourceURL+':'+arg.line;}}return arg;}function consoleLog(type){var console=$window.console||{},logFn=console[type]||console.log||noop;return function(){var args=[];forEach(arguments,function(arg){args.push(formatError(arg));});\nreturn Function.prototype.apply.call(logFn,console,args);};}}];}\nvar $parseMinErr=minErr('$parse');var objectValueOf={}.constructor.prototype.valueOf;\nfunction getStringValue(name){\nreturn name+'';}var OPERATORS=createMap();forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '),function(operator){OPERATORS[operator]=true;});var ESCAPE={'n':'\\n','f':'\\f','r':'\\r','t':'\\t','v':'\\v','\\'':'\\'','\"':'\"'};\nvar Lexer=function Lexer(options){this.options=options;};Lexer.prototype={constructor:Lexer,lex:function(text){this.text=text;this.index=0;this.tokens=[];while(this.index=0xD800&&cp1<=0xDBFF&&cp2>=0xDC00&&cp2<=0xDFFF){return ch+peek;}return ch;},isExpOperator:function(ch){return ch==='-'||ch==='+'||this.isNumber(ch);},throwError:function(error,start,end){end=end||this.index;var colStr=isDefined(start)?'s '+start+'-'+this.index+' ['+this.text.substring(start,end)+']':' '+end;throw $parseMinErr('lexerr','Lexer Error: {0} at column{1} in expression [{2}].',error,colStr,this.text);},readNumber:function(){var number='';var start=this.index;while(this.index0&&!this.peek('}',')',';',']'))body.push(this.expressionStatement());if(!this.expect(';')){return {type:AST.Program,body:body};}}},expressionStatement:function(){return {type:AST.ExpressionStatement,expression:this.filterChain()};},filterChain:function(){var left=this.expression();while(this.expect('|')){left=this.filter(left);}return left;},expression:function(){return this.assignment();},assignment:function(){var result=this.ternary();if(this.expect('=')){if(!isAssignable(result)){throw $parseMinErr('lval','Trying to assign a value to a non l-value');}result={type:AST.AssignmentExpression,left:result,right:this.assignment(),operator:'='};}return result;},ternary:function(){var test=this.logicalOR();var alternate;var consequent;if(this.expect('?')){alternate=this.expression();if(this.consume(':')){consequent=this.expression();return {type:AST.ConditionalExpression,test:test,alternate:alternate,consequent:consequent};}}return test;},logicalOR:function(){var left=this.logicalAND();while(this.expect('||')){left={type:AST.LogicalExpression,operator:'||',left:left,right:this.logicalAND()};}return left;},logicalAND:function(){var left=this.equality();while(this.expect('&&')){left={type:AST.LogicalExpression,operator:'&&',left:left,right:this.equality()};}return left;},equality:function(){var left=this.relational();var token;while(token=this.expect('==','!=','===','!==')){left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.relational()};}return left;},relational:function(){var left=this.additive();var token;while(token=this.expect('<','>','<=','>=')){left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.additive()};}return left;},additive:function(){var left=this.multiplicative();var token;while(token=this.expect('+','-')){left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.multiplicative()};}return left;},multiplicative:function(){var left=this.unary();var token;while(token=this.expect('*','/','%')){left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.unary()};}return left;},unary:function(){var token;if(token=this.expect('+','-','!')){return {type:AST.UnaryExpression,operator:token.text,prefix:true,argument:this.unary()};}else {return this.primary();}},primary:function(){var primary;if(this.expect('(')){primary=this.filterChain();this.consume(')');}else if(this.expect('[')){primary=this.arrayDeclaration();}else if(this.expect('{')){primary=this.object();}else if(this.selfReferential.hasOwnProperty(this.peek().text)){primary=copy(this.selfReferential[this.consume().text]);}else if(this.options.literals.hasOwnProperty(this.peek().text)){primary={type:AST.Literal,value:this.options.literals[this.consume().text]};}else if(this.peek().identifier){primary=this.identifier();}else if(this.peek().constant){primary=this.constant();}else {this.throwError('not a primary expression',this.peek());}var next;while(next=this.expect('(','[','.')){if(next.text==='('){primary={type:AST.CallExpression,callee:primary,arguments:this.parseArguments()};this.consume(')');}else if(next.text==='['){primary={type:AST.MemberExpression,object:primary,property:this.expression(),computed:true};this.consume(']');}else if(next.text==='.'){primary={type:AST.MemberExpression,object:primary,property:this.identifier(),computed:false};}else {this.throwError('IMPOSSIBLE');}}return primary;},filter:function(baseExpression){var args=[baseExpression];var result={type:AST.CallExpression,callee:this.identifier(),arguments:args,filter:true};while(this.expect(':')){args.push(this.expression());}return result;},parseArguments:function(){var args=[];if(this.peekToken().text!==')'){do{args.push(this.filterChain());}while(this.expect(','));}return args;},identifier:function(){var token=this.consume();if(!token.identifier){this.throwError('is not a valid identifier',token);}return {type:AST.Identifier,name:token.text};},constant:function(){\nreturn {type:AST.Literal,value:this.consume().value};},arrayDeclaration:function(){var elements=[];if(this.peekToken().text!==']'){do{if(this.peek(']')){\nbreak;}elements.push(this.expression());}while(this.expect(','));}this.consume(']');return {type:AST.ArrayExpression,elements:elements};},object:function(){var properties=[],property;if(this.peekToken().text!=='}'){do{if(this.peek('}')){\nbreak;}property={type:AST.Property,kind:'init'};if(this.peek().constant){property.key=this.constant();property.computed=false;this.consume(':');property.value=this.expression();}else if(this.peek().identifier){property.key=this.identifier();property.computed=false;if(this.peek(':')){this.consume(':');property.value=this.expression();}else {property.value=property.key;}}else if(this.peek('[')){this.consume('[');property.key=this.expression();this.consume(']');property.computed=true;this.consume(':');property.value=this.expression();}else {this.throwError('invalid key',this.peek());}properties.push(property);}while(this.expect(','));}this.consume('}');return {type:AST.ObjectExpression,properties:properties};},throwError:function(msg,token){throw $parseMinErr('syntax','Syntax Error: Token \\'{0}\\' {1} at column {2} of the expression [{3}] starting at [{4}].',token.text,msg,token.index+1,this.text,this.text.substring(token.index));},consume:function(e1){if(this.tokens.length===0){throw $parseMinErr('ueoe','Unexpected end of expression: {0}',this.text);}var token=this.expect(e1);if(!token){this.throwError('is unexpected, expecting ['+e1+']',this.peek());}return token;},peekToken:function(){if(this.tokens.length===0){throw $parseMinErr('ueoe','Unexpected end of expression: {0}',this.text);}return this.tokens[0];},peek:function(e1,e2,e3,e4){return this.peekAhead(0,e1,e2,e3,e4);},peekAhead:function(i,e1,e2,e3,e4){if(this.tokens.length>i){var token=this.tokens[i];var t=token.text;if(t===e1||t===e2||t===e3||t===e4||!e1&&!e2&&!e3&&!e4){return token;}}return false;},expect:function(e1,e2,e3,e4){var token=this.peek(e1,e2,e3,e4);if(token){this.tokens.shift();return token;}return false;},selfReferential:{'this':{type:AST.ThisExpression},'$locals':{type:AST.LocalsExpression}}};function ifDefined(v,d){return typeof v!=='undefined'?v:d;}function plusFn(l,r){if(typeof l==='undefined')return r;if(typeof r==='undefined')return l;return l+r;}function isStateless($filter,filterName){var fn=$filter(filterName);return !fn.$stateful;}var PURITY_ABSOLUTE=1;var PURITY_RELATIVE=2;\nfunction isPure(node,parentIsPure){switch(node.type){\ncase AST.MemberExpression:if(node.computed){return false;}break;\ncase AST.UnaryExpression:return PURITY_ABSOLUTE;\ncase AST.BinaryExpression:return node.operator!=='+'?PURITY_ABSOLUTE:false;\ncase AST.CallExpression:return false;}return undefined===parentIsPure?PURITY_RELATIVE:parentIsPure;}function findConstantAndWatchExpressions(ast,$filter,parentIsPure){var allConstants;var argsToWatch;var isStatelessFilter;var astIsPure=ast.isPure=isPure(ast,parentIsPure);switch(ast.type){case AST.Program:allConstants=true;forEach(ast.body,function(expr){findConstantAndWatchExpressions(expr.expression,$filter,astIsPure);allConstants=allConstants&&expr.expression.constant;});ast.constant=allConstants;break;case AST.Literal:ast.constant=true;ast.toWatch=[];break;case AST.UnaryExpression:findConstantAndWatchExpressions(ast.argument,$filter,astIsPure);ast.constant=ast.argument.constant;ast.toWatch=ast.argument.toWatch;break;case AST.BinaryExpression:findConstantAndWatchExpressions(ast.left,$filter,astIsPure);findConstantAndWatchExpressions(ast.right,$filter,astIsPure);ast.constant=ast.left.constant&&ast.right.constant;ast.toWatch=ast.left.toWatch.concat(ast.right.toWatch);break;case AST.LogicalExpression:findConstantAndWatchExpressions(ast.left,$filter,astIsPure);findConstantAndWatchExpressions(ast.right,$filter,astIsPure);ast.constant=ast.left.constant&&ast.right.constant;ast.toWatch=ast.constant?[]:[ast];break;case AST.ConditionalExpression:findConstantAndWatchExpressions(ast.test,$filter,astIsPure);findConstantAndWatchExpressions(ast.alternate,$filter,astIsPure);findConstantAndWatchExpressions(ast.consequent,$filter,astIsPure);ast.constant=ast.test.constant&&ast.alternate.constant&&ast.consequent.constant;ast.toWatch=ast.constant?[]:[ast];break;case AST.Identifier:ast.constant=false;ast.toWatch=[ast];break;case AST.MemberExpression:findConstantAndWatchExpressions(ast.object,$filter,astIsPure);if(ast.computed){findConstantAndWatchExpressions(ast.property,$filter,astIsPure);}ast.constant=ast.object.constant&&(!ast.computed||ast.property.constant);ast.toWatch=ast.constant?[]:[ast];break;case AST.CallExpression:isStatelessFilter=ast.filter?isStateless($filter,ast.callee.name):false;allConstants=isStatelessFilter;argsToWatch=[];forEach(ast.arguments,function(expr){findConstantAndWatchExpressions(expr,$filter,astIsPure);allConstants=allConstants&&expr.constant;argsToWatch.push.apply(argsToWatch,expr.toWatch);});ast.constant=allConstants;ast.toWatch=isStatelessFilter?argsToWatch:[ast];break;case AST.AssignmentExpression:findConstantAndWatchExpressions(ast.left,$filter,astIsPure);findConstantAndWatchExpressions(ast.right,$filter,astIsPure);ast.constant=ast.left.constant&&ast.right.constant;ast.toWatch=[ast];break;case AST.ArrayExpression:allConstants=true;argsToWatch=[];forEach(ast.elements,function(expr){findConstantAndWatchExpressions(expr,$filter,astIsPure);allConstants=allConstants&&expr.constant;argsToWatch.push.apply(argsToWatch,expr.toWatch);});ast.constant=allConstants;ast.toWatch=argsToWatch;break;case AST.ObjectExpression:allConstants=true;argsToWatch=[];forEach(ast.properties,function(property){findConstantAndWatchExpressions(property.value,$filter,astIsPure);allConstants=allConstants&&property.value.constant;argsToWatch.push.apply(argsToWatch,property.value.toWatch);if(property.computed){\nfindConstantAndWatchExpressions(property.key,$filter,false);allConstants=allConstants&&property.key.constant;argsToWatch.push.apply(argsToWatch,property.key.toWatch);}});ast.constant=allConstants;ast.toWatch=argsToWatch;break;case AST.ThisExpression:ast.constant=false;ast.toWatch=[];break;case AST.LocalsExpression:ast.constant=false;ast.toWatch=[];break;}}function getInputs(body){if(body.length!==1)return;var lastExpression=body[0].expression;var candidate=lastExpression.toWatch;if(candidate.length!==1)return candidate;return candidate[0]!==lastExpression?candidate:undefined;}function isAssignable(ast){return ast.type===AST.Identifier||ast.type===AST.MemberExpression;}function assignableAST(ast){if(ast.body.length===1&&isAssignable(ast.body[0].expression)){return {type:AST.AssignmentExpression,left:ast.body[0].expression,right:{type:AST.NGValueParameter},operator:'='};}}function isLiteral(ast){return ast.body.length===0||ast.body.length===1&&(ast.body[0].expression.type===AST.Literal||ast.body[0].expression.type===AST.ArrayExpression||ast.body[0].expression.type===AST.ObjectExpression);}function isConstant(ast){return ast.constant;}function ASTCompiler($filter){this.$filter=$filter;}ASTCompiler.prototype={compile:function(ast){var self=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};findConstantAndWatchExpressions(ast,self.$filter);var extra='';var assignable;this.stage='assign';if(assignable=assignableAST(ast)){this.state.computing='assign';var result=this.nextId();this.recurse(assignable,result);this.return_(result);extra='fn.assign='+this.generateFunction('assign','s,v,l');}var toWatch=getInputs(ast.body);self.stage='inputs';forEach(toWatch,function(watch,key){var fnKey='fn'+key;self.state[fnKey]={vars:[],body:[],own:{}};self.state.computing=fnKey;var intoId=self.nextId();self.recurse(watch,intoId);self.return_(intoId);self.state.inputs.push({name:fnKey,isPure:watch.isPure});watch.watchId=key;});this.state.computing='fn';this.stage='main';this.recurse(ast);var fnString=\n'\"'+this.USE+' '+this.STRICT+'\";\\n'+this.filterPrefix()+'var fn='+this.generateFunction('fn','s,l,a,i')+extra+this.watchFns()+'return fn;';\nvar fn=new Function('$filter','getStringValue','ifDefined','plus',fnString)(this.$filter,getStringValue,ifDefined,plusFn);this.state=this.stage=undefined;return fn;},USE:'use',STRICT:'strict',watchFns:function(){var result=[];var inputs=this.state.inputs;var self=this;forEach(inputs,function(input){result.push('var '+input.name+'='+self.generateFunction(input.name,'s'));if(input.isPure){result.push(input.name,'.isPure='+JSON.stringify(input.isPure)+';');}});if(inputs.length){result.push('fn.inputs=['+inputs.map(function(i){return i.name;}).join(',')+'];');}return result.join('');},generateFunction:function(name,params){return 'function('+params+'){'+this.varsPrefix(name)+this.body(name)+'};';},filterPrefix:function(){var parts=[];var self=this;forEach(this.state.filters,function(id,filter){parts.push(id+'=$filter('+self.escape(filter)+')');});if(parts.length)return 'var '+parts.join(',')+';';return '';},varsPrefix:function(section){return this.state[section].vars.length?'var '+this.state[section].vars.join(',')+';':'';},body:function(section){return this.state[section].body.join('');},recurse:function(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck){var left,right,self=this,args,expression,computed;recursionFn=recursionFn||noop;if(!skipWatchIdCheck&&isDefined(ast.watchId)){intoId=intoId||this.nextId();this.if_('i',this.lazyAssign(intoId,this.computedMember('i',ast.watchId)),this.lazyRecurse(ast,intoId,nameId,recursionFn,create,true));return;}switch(ast.type){case AST.Program:forEach(ast.body,function(expression,pos){self.recurse(expression.expression,undefined,undefined,function(expr){right=expr;});if(pos!==ast.body.length-1){self.current().body.push(right,';');}else {self.return_(right);}});break;case AST.Literal:expression=this.escape(ast.value);this.assign(intoId,expression);recursionFn(intoId||expression);break;case AST.UnaryExpression:this.recurse(ast.argument,undefined,undefined,function(expr){right=expr;});expression=ast.operator+'('+this.ifDefined(right,0)+')';this.assign(intoId,expression);recursionFn(expression);break;case AST.BinaryExpression:this.recurse(ast.left,undefined,undefined,function(expr){left=expr;});this.recurse(ast.right,undefined,undefined,function(expr){right=expr;});if(ast.operator==='+'){expression=this.plus(left,right);}else if(ast.operator==='-'){expression=this.ifDefined(left,0)+ast.operator+this.ifDefined(right,0);}else {expression='('+left+')'+ast.operator+'('+right+')';}this.assign(intoId,expression);recursionFn(expression);break;case AST.LogicalExpression:intoId=intoId||this.nextId();self.recurse(ast.left,intoId);self.if_(ast.operator==='&&'?intoId:self.not(intoId),self.lazyRecurse(ast.right,intoId));recursionFn(intoId);break;case AST.ConditionalExpression:intoId=intoId||this.nextId();self.recurse(ast.test,intoId);self.if_(intoId,self.lazyRecurse(ast.alternate,intoId),self.lazyRecurse(ast.consequent,intoId));recursionFn(intoId);break;case AST.Identifier:intoId=intoId||this.nextId();if(nameId){nameId.context=self.stage==='inputs'?'s':this.assign(this.nextId(),this.getHasOwnProperty('l',ast.name)+'?l:s');nameId.computed=false;nameId.name=ast.name;}self.if_(self.stage==='inputs'||self.not(self.getHasOwnProperty('l',ast.name)),function(){self.if_(self.stage==='inputs'||'s',function(){if(create&&create!==1){self.if_(self.isNull(self.nonComputedMember('s',ast.name)),self.lazyAssign(self.nonComputedMember('s',ast.name),'{}'));}self.assign(intoId,self.nonComputedMember('s',ast.name));});},intoId&&self.lazyAssign(intoId,self.nonComputedMember('l',ast.name)));recursionFn(intoId);break;case AST.MemberExpression:left=nameId&&(nameId.context=this.nextId())||this.nextId();intoId=intoId||this.nextId();self.recurse(ast.object,left,undefined,function(){self.if_(self.notNull(left),function(){if(ast.computed){right=self.nextId();self.recurse(ast.property,right);self.getStringValue(right);if(create&&create!==1){self.if_(self.not(self.computedMember(left,right)),self.lazyAssign(self.computedMember(left,right),'{}'));}expression=self.computedMember(left,right);self.assign(intoId,expression);if(nameId){nameId.computed=true;nameId.name=right;}}else {if(create&&create!==1){self.if_(self.isNull(self.nonComputedMember(left,ast.property.name)),self.lazyAssign(self.nonComputedMember(left,ast.property.name),'{}'));}expression=self.nonComputedMember(left,ast.property.name);self.assign(intoId,expression);if(nameId){nameId.computed=false;nameId.name=ast.property.name;}}},function(){self.assign(intoId,'undefined');});recursionFn(intoId);},!!create);break;case AST.CallExpression:intoId=intoId||this.nextId();if(ast.filter){right=self.filter(ast.callee.name);args=[];forEach(ast.arguments,function(expr){var argument=self.nextId();self.recurse(expr,argument);args.push(argument);});expression=right+'('+args.join(',')+')';self.assign(intoId,expression);recursionFn(intoId);}else {right=self.nextId();left={};args=[];self.recurse(ast.callee,right,left,function(){self.if_(self.notNull(right),function(){forEach(ast.arguments,function(expr){self.recurse(expr,ast.constant?undefined:self.nextId(),undefined,function(argument){args.push(argument);});});if(left.name){expression=self.member(left.context,left.name,left.computed)+'('+args.join(',')+')';}else {expression=right+'('+args.join(',')+')';}self.assign(intoId,expression);},function(){self.assign(intoId,'undefined');});recursionFn(intoId);});}break;case AST.AssignmentExpression:right=this.nextId();left={};this.recurse(ast.left,undefined,left,function(){self.if_(self.notNull(left.context),function(){self.recurse(ast.right,right);expression=self.member(left.context,left.name,left.computed)+ast.operator+right;self.assign(intoId,expression);recursionFn(intoId||expression);});},1);break;case AST.ArrayExpression:args=[];forEach(ast.elements,function(expr){self.recurse(expr,ast.constant?undefined:self.nextId(),undefined,function(argument){args.push(argument);});});expression='['+args.join(',')+']';this.assign(intoId,expression);recursionFn(intoId||expression);break;case AST.ObjectExpression:args=[];computed=false;forEach(ast.properties,function(property){if(property.computed){computed=true;}});if(computed){intoId=intoId||this.nextId();this.assign(intoId,'{}');forEach(ast.properties,function(property){if(property.computed){left=self.nextId();self.recurse(property.key,left);}else {left=property.key.type===AST.Identifier?property.key.name:''+property.key.value;}right=self.nextId();self.recurse(property.value,right);self.assign(self.member(intoId,left,property.computed),right);});}else {forEach(ast.properties,function(property){self.recurse(property.value,ast.constant?undefined:self.nextId(),undefined,function(expr){args.push(self.escape(property.key.type===AST.Identifier?property.key.name:''+property.key.value)+':'+expr);});});expression='{'+args.join(',')+'}';this.assign(intoId,expression);}recursionFn(intoId||expression);break;case AST.ThisExpression:this.assign(intoId,'s');recursionFn(intoId||'s');break;case AST.LocalsExpression:this.assign(intoId,'l');recursionFn(intoId||'l');break;case AST.NGValueParameter:this.assign(intoId,'v');recursionFn(intoId||'v');break;}},getHasOwnProperty:function(element,property){var key=element+'.'+property;var own=this.current().own;if(!own.hasOwnProperty(key)){own[key]=this.nextId(false,element+'&&('+this.escape(property)+' in '+element+')');}return own[key];},assign:function(id,value){if(!id)return;this.current().body.push(id,'=',value,';');return id;},filter:function(filterName){if(!this.state.filters.hasOwnProperty(filterName)){this.state.filters[filterName]=this.nextId(true);}return this.state.filters[filterName];},ifDefined:function(id,defaultValue){return 'ifDefined('+id+','+this.escape(defaultValue)+')';},plus:function(left,right){return 'plus('+left+','+right+')';},return_:function(id){this.current().body.push('return ',id,';');},if_:function(test,alternate,consequent){if(test===true){alternate();}else {var body=this.current().body;body.push('if(',test,'){');alternate();body.push('}');if(consequent){body.push('else{');consequent();body.push('}');}}},not:function(expression){return '!('+expression+')';},isNull:function(expression){return expression+'==null';},notNull:function(expression){return expression+'!=null';},nonComputedMember:function(left,right){var SAFE_IDENTIFIER=/^[$_a-zA-Z][$_a-zA-Z0-9]*$/;var UNSAFE_CHARACTERS=/[^$_a-zA-Z0-9]/g;if(SAFE_IDENTIFIER.test(right)){return left+'.'+right;}else {return left+'[\"'+right.replace(UNSAFE_CHARACTERS,this.stringEscapeFn)+'\"]';}},computedMember:function(left,right){return left+'['+right+']';},member:function(left,right,computed){if(computed)return this.computedMember(left,right);return this.nonComputedMember(left,right);},getStringValue:function(item){this.assign(item,'getStringValue('+item+')');},lazyRecurse:function(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck){var self=this;return function(){self.recurse(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck);};},lazyAssign:function(id,value){var self=this;return function(){self.assign(id,value);};},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(c){return '\\\\u'+('0000'+c.charCodeAt(0).toString(16)).slice(-4);},escape:function(value){if(isString(value))return '\\''+value.replace(this.stringEscapeRegex,this.stringEscapeFn)+'\\'';if(isNumber(value))return value.toString();if(value===true)return 'true';if(value===false)return 'false';if(value===null)return 'null';if(typeof value==='undefined')return 'undefined';throw $parseMinErr('esc','IMPOSSIBLE');},nextId:function(skip,init){var id='v'+this.state.nextId++;if(!skip){this.current().vars.push(id+(init?'='+init:''));}return id;},current:function(){return this.state[this.state.computing];}};function ASTInterpreter($filter){this.$filter=$filter;}ASTInterpreter.prototype={compile:function(ast){var self=this;findConstantAndWatchExpressions(ast,self.$filter);var assignable;var assign;if(assignable=assignableAST(ast)){assign=this.recurse(assignable);}var toWatch=getInputs(ast.body);var inputs;if(toWatch){inputs=[];forEach(toWatch,function(watch,key){var input=self.recurse(watch);input.isPure=watch.isPure;watch.input=input;inputs.push(input);watch.watchId=key;});}var expressions=[];forEach(ast.body,function(expression){expressions.push(self.recurse(expression.expression));});var fn=ast.body.length===0?noop:ast.body.length===1?expressions[0]:function(scope,locals){var lastValue;forEach(expressions,function(exp){lastValue=exp(scope,locals);});return lastValue;};if(assign){fn.assign=function(scope,value,locals){return assign(scope,locals,value);};}if(inputs){fn.inputs=inputs;}return fn;},recurse:function(ast,context,create){var left,right,self=this,args;if(ast.input){return this.inputs(ast.input,ast.watchId);}switch(ast.type){case AST.Literal:return this.value(ast.value,context);case AST.UnaryExpression:right=this.recurse(ast.argument);return this['unary'+ast.operator](right,context);case AST.BinaryExpression:left=this.recurse(ast.left);right=this.recurse(ast.right);return this['binary'+ast.operator](left,right,context);case AST.LogicalExpression:left=this.recurse(ast.left);right=this.recurse(ast.right);return this['binary'+ast.operator](left,right,context);case AST.ConditionalExpression:return this['ternary?:'](this.recurse(ast.test),this.recurse(ast.alternate),this.recurse(ast.consequent),context);case AST.Identifier:return self.identifier(ast.name,context,create);case AST.MemberExpression:left=this.recurse(ast.object,false,!!create);if(!ast.computed){right=ast.property.name;}if(ast.computed)right=this.recurse(ast.property);return ast.computed?this.computedMember(left,right,context,create):this.nonComputedMember(left,right,context,create);case AST.CallExpression:args=[];forEach(ast.arguments,function(expr){args.push(self.recurse(expr));});if(ast.filter)right=this.$filter(ast.callee.name);if(!ast.filter)right=this.recurse(ast.callee,true);return ast.filter?function(scope,locals,assign,inputs){var values=[];for(var i=0;i':function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)>right(scope,locals,assign,inputs);return context?{value:arg}:arg;};},'binary<=':function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)<=right(scope,locals,assign,inputs);return context?{value:arg}:arg;};},'binary>=':function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)>=right(scope,locals,assign,inputs);return context?{value:arg}:arg;};},'binary&&':function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)&&right(scope,locals,assign,inputs);return context?{value:arg}:arg;};},'binary||':function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)||right(scope,locals,assign,inputs);return context?{value:arg}:arg;};},'ternary?:':function(test,alternate,consequent,context){return function(scope,locals,assign,inputs){var arg=test(scope,locals,assign,inputs)?alternate(scope,locals,assign,inputs):consequent(scope,locals,assign,inputs);return context?{value:arg}:arg;};},value:function(value,context){return function(){return context?{context:undefined,name:undefined,value:value}:value;};},identifier:function(name,context,create){return function(scope,locals,assign,inputs){var base=locals&&name in locals?locals:scope;if(create&&create!==1&&base&&base[name]==null){base[name]={};}var value=base?base[name]:undefined;if(context){return {context:base,name:name,value:value};}else {return value;}};},computedMember:function(left,right,context,create){return function(scope,locals,assign,inputs){var lhs=left(scope,locals,assign,inputs);var rhs;var value;if(lhs!=null){rhs=right(scope,locals,assign,inputs);rhs=getStringValue(rhs);if(create&&create!==1){if(lhs&&!lhs[rhs]){lhs[rhs]={};}}value=lhs[rhs];}if(context){return {context:lhs,name:rhs,value:value};}else {return value;}};},nonComputedMember:function(left,right,context,create){return function(scope,locals,assign,inputs){var lhs=left(scope,locals,assign,inputs);if(create&&create!==1){if(lhs&&lhs[right]==null){lhs[right]={};}}var value=lhs!=null?lhs[right]:undefined;if(context){return {context:lhs,name:right,value:value};}else {return value;}};},inputs:function(input,watchId){return function(scope,value,locals,inputs){if(inputs)return inputs[watchId];return input(scope,value,locals);};}};\nfunction Parser(lexer,$filter,options){this.ast=new AST(lexer,options);this.astCompiler=options.csp?new ASTInterpreter($filter):new ASTCompiler($filter);}Parser.prototype={constructor:Parser,parse:function(text){var ast=this.getAst(text);var fn=this.astCompiler.compile(ast.ast);fn.literal=isLiteral(ast.ast);fn.constant=isConstant(ast.ast);fn.oneTime=ast.oneTime;return fn;},getAst:function(exp){var oneTime=false;exp=exp.trim();if(exp.charAt(0)===':'&&exp.charAt(1)===':'){oneTime=true;exp=exp.substring(2);}return {ast:this.ast.ast(exp),oneTime:oneTime};}};function getValueOf(value){return isFunction(value.valueOf)?value.valueOf():objectValueOf.call(value);}\nfunction $ParseProvider(){var cache=createMap();var literals={'true':true,'false':false,'null':null,'undefined':undefined};var identStart,identContinue;\nthis.addLiteral=function(literalName,literalValue){literals[literalName]=literalValue;};\nthis.setIdentifierFns=function(identifierStart,identifierContinue){identStart=identifierStart;identContinue=identifierContinue;return this;};this.$get=['$filter',function($filter){var noUnsafeEval=csp().noUnsafeEval;var $parseOptions={csp:noUnsafeEval,literals:copy(literals),isIdentifierStart:isFunction(identStart)&&identStart,isIdentifierContinue:isFunction(identContinue)&&identContinue};$parse.$$getAst=$$getAst;return $parse;function $parse(exp,interceptorFn){var parsedExpression,cacheKey;switch(typeof exp){case'string':exp=exp.trim();cacheKey=exp;parsedExpression=cache[cacheKey];if(!parsedExpression){var lexer=new Lexer($parseOptions);var parser=new Parser(lexer,$filter,$parseOptions);parsedExpression=parser.parse(exp);cache[cacheKey]=addWatchDelegate(parsedExpression);}return addInterceptor(parsedExpression,interceptorFn);case'function':return addInterceptor(exp,interceptorFn);default:return addInterceptor(noop,interceptorFn);}}function $$getAst(exp){var lexer=new Lexer($parseOptions);var parser=new Parser(lexer,$filter,$parseOptions);return parser.getAst(exp).ast;}function expressionInputDirtyCheck(newValue,oldValueOfValue,compareObjectIdentity){if(newValue==null||oldValueOfValue==null){\nreturn newValue===oldValueOfValue;}if(typeof newValue==='object'){\nnewValue=getValueOf(newValue);if(typeof newValue==='object'&&!compareObjectIdentity){\nreturn false;}\n}\nreturn newValue===oldValueOfValue||newValue!==newValue&&oldValueOfValue!==oldValueOfValue;}function inputsWatchDelegate(scope,listener,objectEquality,parsedExpression,prettyPrintExpression){var inputExpressions=parsedExpression.inputs;var lastResult;if(inputExpressions.length===1){var oldInputValueOf=expressionInputDirtyCheck;\ninputExpressions=inputExpressions[0];return scope.$watch(function expressionInputWatch(scope){var newInputValue=inputExpressions(scope);if(!expressionInputDirtyCheck(newInputValue,oldInputValueOf,inputExpressions.isPure)){lastResult=parsedExpression(scope,undefined,undefined,[newInputValue]);oldInputValueOf=newInputValue&&getValueOf(newInputValue);}return lastResult;},listener,objectEquality,prettyPrintExpression);}var oldInputValueOfValues=[];var oldInputValues=[];for(var i=0,ii=inputExpressions.length;i0)scheduleProcessQueue(this.$$state);return result;},'catch':function(callback){return this.then(null,callback);},'finally':function(callback,progressBack){return this.then(function(value){return handleCallback(value,resolve,callback);},function(error){return handleCallback(error,reject,callback);},progressBack);}});function processQueue(state){var fn,promise,pending;pending=state.pending;state.processScheduled=false;state.pending=undefined;try{for(var i=0,ii=pending.length;i=0){incrementWatchersCount(scope,-1);if(index1;var changeDetected=0;var changeDetector=$parse(obj,$watchCollectionInterceptor);var internalArray=[];var internalObject={};var initRun=true;var oldLength=0;function $watchCollectionInterceptor(_value){newValue=_value;var newLength,key,bothNaN,newItem,oldItem;\nif(isUndefined(newValue))return;if(!isObject(newValue)){\nif(oldValue!==newValue){oldValue=newValue;changeDetected++;}}else if(isArrayLike(newValue)){if(oldValue!==internalArray){\noldValue=internalArray;oldLength=oldValue.length=0;changeDetected++;}newLength=newValue.length;if(oldLength!==newLength){\nchangeDetected++;oldValue.length=oldLength=newLength;}\nfor(var i=0;inewLength){\nchangeDetected++;for(key in oldValue){if(!hasOwnProperty.call(newValue,key)){oldLength--;delete oldValue[key];}}}}return changeDetected;}function $watchCollectionAction(){if(initRun){initRun=false;listener(newValue,newValue,self);}else {listener(newValue,veryOldValue,self);}\nif(trackVeryOldValue){if(!isObject(newValue)){\nveryOldValue=newValue;}else if(isArrayLike(newValue)){veryOldValue=new Array(newValue.length);for(var i=0;i-1){throw $sceMinErr('iwcard','Illegal sequence *** in string matcher. String: {0}',matcher);}matcher=escapeForRegexp(matcher).replace(/\\\\\\*\\\\\\*/g,'.*').replace(/\\\\\\*/g,'[^:/.?&;]*');return new RegExp('^'+matcher+'$');}else if(isRegExp(matcher)){\nreturn new RegExp('^'+matcher.source+'$');}else {throw $sceMinErr('imatcher','Matchers may only be \"self\", string patterns or RegExp objects');}}function adjustMatchers(matchers){var adjustedMatchers=[];if(isDefined(matchers)){forEach(matchers,function(matcher){adjustedMatchers.push(adjustMatcher(matcher));});}return adjustedMatchers;}\nfunction $SceDelegateProvider(){this.SCE_CONTEXTS=SCE_CONTEXTS;\nvar resourceUrlWhitelist=['self'],resourceUrlBlacklist=[];\nthis.resourceUrlWhitelist=function(value){if(arguments.length){resourceUrlWhitelist=adjustMatchers(value);}return resourceUrlWhitelist;};\nthis.resourceUrlBlacklist=function(value){if(arguments.length){resourceUrlBlacklist=adjustMatchers(value);}return resourceUrlBlacklist;};this.$get=['$injector','$$sanitizeUri',function($injector,$$sanitizeUri){var htmlSanitizer=function htmlSanitizer(html){throw $sceMinErr('unsafe','Attempting to use an unsafe value in a safe context.');};if($injector.has('$sanitize')){htmlSanitizer=$injector.get('$sanitize');}function matchUrl(matcher,parsedUrl){if(matcher==='self'){return urlIsSameOrigin(parsedUrl)||urlIsSameOriginAsBaseUrl(parsedUrl);}else {\nreturn !!matcher.exec(parsedUrl.href);}}function isResourceUrlAllowedByPolicy(url){var parsedUrl=urlResolve(url.toString());var i,n,allowed=false;\nfor(i=0,n=resourceUrlWhitelist.length;i to the top of your HTML '+'document. See http://docs.angularjs.org/api/ng.$sce for more information.');}var sce=shallowCopy(SCE_CONTEXTS);\nsce.isEnabled=function(){return enabled;};sce.trustAs=$sceDelegate.trustAs;sce.getTrusted=$sceDelegate.getTrusted;sce.valueOf=$sceDelegate.valueOf;if(!enabled){sce.trustAs=sce.getTrusted=function(type,value){return value;};sce.valueOf=identity;}\nsce.parseAs=function sceParseAs(type,expr){var parsed=$parse(expr);if(parsed.literal&&parsed.constant){return parsed;}else {return $parse(expr,function(value){return sce.getTrusted(type,value);});}};\nvar parse=sce.parseAs,getTrusted=sce.getTrusted,trustAs=sce.trustAs;forEach(SCE_CONTEXTS,function(enumValue,name){var lName=lowercase(name);sce[snakeToCamel('parse_as_'+lName)]=function(expr){return parse(enumValue,expr);};sce[snakeToCamel('get_trusted_'+lName)]=function(value){return getTrusted(enumValue,value);};sce[snakeToCamel('trust_as_'+lName)]=function(value){return trustAs(enumValue,value);};});return sce;}];}\nfunction $SnifferProvider(){this.$get=['$window','$document',function($window,$document){var eventSupport={},\nisNw=$window.nw&&$window.nw.process,isChromePackagedApp=!isNw&&$window.chrome&&($window.chrome.app&&$window.chrome.app.runtime||!$window.chrome.app&&$window.chrome.runtime&&$window.chrome.runtime.id),hasHistoryPushState=!isChromePackagedApp&&$window.history&&$window.history.pushState,android=toInt((/android (\\d+)/.exec(lowercase(($window.navigator||{}).userAgent))||[])[1]),boxee=/Boxee/i.test(($window.navigator||{}).userAgent),document=$document[0]||{},bodyStyle=document.body&&document.body.style,transitions=false,animations=false;if(bodyStyle){\ntransitions=!!('transition'in bodyStyle||'webkitTransition'in bodyStyle);animations=!!('animation'in bodyStyle||'webkitAnimation'in bodyStyle);}return {\nhistory:!!(hasHistoryPushState&&!(android<4)&&!boxee),hasEvent:function(event){\nif(event==='input'&&msie)return false;if(isUndefined(eventSupport[event])){var divElm=document.createElement('div');eventSupport[event]='on'+event in divElm;}return eventSupport[event];},csp:csp(),transitions:transitions,animations:animations,android:android};}];}\nfunction $$TaskTrackerFactoryProvider(){this.$get=valueFn(function(log){return new TaskTracker(log);});}function TaskTracker(log){var self=this;var taskCounts={};var taskCallbacks=[];var ALL_TASKS_TYPE=self.ALL_TASKS_TYPE='$$all$$';var DEFAULT_TASK_TYPE=self.DEFAULT_TASK_TYPE='$$default$$';\nself.completeTask=completeTask;\nself.incTaskCount=incTaskCount;\nself.notifyWhenNoPendingTasks=notifyWhenNoPendingTasks;function completeTask(fn,taskType){taskType=taskType||DEFAULT_TASK_TYPE;try{fn();}finally{decTaskCount(taskType);var countForType=taskCounts[taskType];var countForAll=taskCounts[ALL_TASKS_TYPE];\nif(!countForAll||!countForType){var getNextCallback=!countForAll?getLastCallback:getLastCallbackForType;var nextCb;while(nextCb=getNextCallback(taskType)){try{nextCb();}catch(e){log.error(e);}}}}}function decTaskCount(taskType){taskType=taskType||DEFAULT_TASK_TYPE;if(taskCounts[taskType]){taskCounts[taskType]--;taskCounts[ALL_TASKS_TYPE]--;}}function getLastCallback(){var cbInfo=taskCallbacks.pop();return cbInfo&&cbInfo.cb;}function getLastCallbackForType(taskType){for(var i=taskCallbacks.length-1;i>=0;--i){var cbInfo=taskCallbacks[i];if(cbInfo.type===taskType){taskCallbacks.splice(i,1);return cbInfo.cb;}}}function incTaskCount(taskType){taskType=taskType||DEFAULT_TASK_TYPE;taskCounts[taskType]=(taskCounts[taskType]||0)+1;taskCounts[ALL_TASKS_TYPE]=(taskCounts[ALL_TASKS_TYPE]||0)+1;}function notifyWhenNoPendingTasks(callback,taskType){taskType=taskType||ALL_TASKS_TYPE;if(!taskCounts[taskType]){callback();}else {taskCallbacks.push({type:taskType,cb:callback});}}}var $templateRequestMinErr=minErr('$templateRequest');\nfunction $TemplateRequestProvider(){var httpOptions;\nthis.httpOptions=function(val){if(val){httpOptions=val;return this;}return httpOptions;};\nthis.$get=['$exceptionHandler','$templateCache','$http','$q','$sce',function($exceptionHandler,$templateCache,$http,$q,$sce){function handleRequestFn(tpl,ignoreRequestError){handleRequestFn.totalPendingRequests++;\nif(!isString(tpl)||isUndefined($templateCache.get(tpl))){tpl=$sce.getTrustedResourceUrl(tpl);}var transformResponse=$http.defaults&&$http.defaults.transformResponse;if(isArray(transformResponse)){transformResponse=transformResponse.filter(function(transformer){return transformer!==defaultHttpResponseTransform;});}else if(transformResponse===defaultHttpResponseTransform){transformResponse=null;}return $http.get(tpl,extend({cache:$templateCache,transformResponse:transformResponse},httpOptions)).finally(function(){handleRequestFn.totalPendingRequests--;}).then(function(response){return $templateCache.put(tpl,response.data);},handleError);function handleError(resp){if(!ignoreRequestError){resp=$templateRequestMinErr('tpload','Failed to load template: {0} (HTTP status: {1} {2})',tpl,resp.status,resp.statusText);$exceptionHandler(resp);}return $q.reject(resp);}}handleRequestFn.totalPendingRequests=0;return handleRequestFn;}];}function $$TestabilityProvider(){this.$get=['$rootScope','$browser','$location',function($rootScope,$browser,$location){\nvar testability={};\ntestability.findBindings=function(element,expression,opt_exactMatch){var bindings=element.getElementsByClassName('ng-binding');var matches=[];forEach(bindings,function(binding){var dataBinding=angular.element(binding).data('$binding');if(dataBinding){forEach(dataBinding,function(bindingName){if(opt_exactMatch){var matcher=new RegExp('(^|\\\\s)'+escapeForRegexp(expression)+'(\\\\s|\\\\||$)');if(matcher.test(bindingName)){matches.push(binding);}}else {if(bindingName.indexOf(expression)!==-1){matches.push(binding);}}});}});return matches;};\ntestability.findModels=function(element,expression,opt_exactMatch){var prefixes=['ng-','data-ng-','ng\\\\:'];for(var p=0;p-1){hostname='['+hostname+']';}return {href:urlParsingNode.href,protocol:urlParsingNode.protocol?urlParsingNode.protocol.replace(/:$/,''):'',host:urlParsingNode.host,search:urlParsingNode.search?urlParsingNode.search.replace(/^\\?/,''):'',hash:urlParsingNode.hash?urlParsingNode.hash.replace(/^#/,''):'',hostname:hostname,port:urlParsingNode.port,pathname:urlParsingNode.pathname.charAt(0)==='/'?urlParsingNode.pathname:'/'+urlParsingNode.pathname};}\nfunction urlIsSameOrigin(requestUrl){return urlsAreSameOrigin(requestUrl,originUrl);}\nfunction urlIsSameOriginAsBaseUrl(requestUrl){return urlsAreSameOrigin(requestUrl,getBaseUrl());}\nfunction urlIsAllowedOriginFactory(whitelistedOriginUrls){var parsedAllowedOriginUrls=[originUrl].concat(whitelistedOriginUrls.map(urlResolve));\nreturn function urlIsAllowedOrigin(requestUrl){var parsedUrl=urlResolve(requestUrl);return parsedAllowedOriginUrls.some(urlsAreSameOrigin.bind(null,parsedUrl));};}\nfunction urlsAreSameOrigin(url1,url2){url1=urlResolve(url1);url2=urlResolve(url2);return url1.protocol===url2.protocol&&url1.host===url2.host;}\nfunction getBaseUrl(){if(window.document.baseURI){return window.document.baseURI;}\nif(!baseUrlParsingNode){baseUrlParsingNode=window.document.createElement('a');baseUrlParsingNode.href='.';\nbaseUrlParsingNode=baseUrlParsingNode.cloneNode(false);}return baseUrlParsingNode.href;}\nfunction $WindowProvider(){this.$get=valueFn(window);}\nfunction $$CookieReader($document){var rawDocument=$document[0]||{};var lastCookies={};var lastCookieString='';function safeGetCookie(rawDocument){try{return rawDocument.cookie||'';}catch(e){return '';}}function safeDecodeURIComponent(str){try{return decodeURIComponent(str);}catch(e){return str;}}return function(){var cookieArray,cookie,i,index,name;var currentCookieString=safeGetCookie(rawDocument);if(currentCookieString!==lastCookieString){lastCookieString=currentCookieString;cookieArray=lastCookieString.split('; ');lastCookies={};for(i=0;i0){\nname=safeDecodeURIComponent(cookie.substring(0,index));\nif(isUndefined(lastCookies[name])){lastCookies[name]=safeDecodeURIComponent(cookie.substring(index+1));}}}}return lastCookies;};}$$CookieReader.$inject=['$document'];function $$CookieReaderProvider(){this.$get=$$CookieReader;}\n$FilterProvider.$inject=['$provide'];function $FilterProvider($provide){var suffix='Filter';\nfunction register(name,factory){if(isObject(name)){var filters={};forEach(name,function(filter,key){filters[key]=register(key,filter);});return filters;}else {return $provide.factory(name+suffix,factory);}}this.register=register;this.$get=['$injector',function($injector){return function(name){return $injector.get(name+suffix);};}];\nregister('currency',currencyFilter);register('date',dateFilter);register('filter',filterFilter);register('json',jsonFilter);register('limitTo',limitToFilter);register('lowercase',lowercaseFilter);register('number',numberFilter);register('orderBy',orderByFilter);register('uppercase',uppercaseFilter);}\nfunction filterFilter(){return function(array,expression,comparator,anyPropertyKey){if(!isArrayLike(array)){if(array==null){return array;}else {throw minErr('filter')('notarray','Expected array but received: {0}',array);}}anyPropertyKey=anyPropertyKey||'$';var expressionType=getTypeForFilter(expression);var predicateFn;var matchAgainstAnyProp;switch(expressionType){case'function':predicateFn=expression;break;case'boolean':case'null':case'number':case'string':matchAgainstAnyProp=true;\ncase'object':predicateFn=createPredicateFn(expression,comparator,anyPropertyKey,matchAgainstAnyProp);break;default:return array;}return Array.prototype.filter.call(array,predicateFn);};}\nfunction createPredicateFn(expression,comparator,anyPropertyKey,matchAgainstAnyProp){var shouldMatchPrimitives=isObject(expression)&&anyPropertyKey in expression;var predicateFn;if(comparator===true){comparator=equals;}else if(!isFunction(comparator)){comparator=function(actual,expected){if(isUndefined(actual)){\nreturn false;}if(actual===null||expected===null){\nreturn actual===expected;}if(isObject(expected)||isObject(actual)&&!hasCustomToString(actual)){\nreturn false;}actual=lowercase(''+actual);expected=lowercase(''+expected);return actual.indexOf(expected)!==-1;};}predicateFn=function(item){if(shouldMatchPrimitives&&!isObject(item)){return deepCompare(item,expression[anyPropertyKey],comparator,anyPropertyKey,false);}return deepCompare(item,expression,comparator,anyPropertyKey,matchAgainstAnyProp);};return predicateFn;}function deepCompare(actual,expected,comparator,anyPropertyKey,matchAgainstAnyProp,dontMatchWholeObject){var actualType=getTypeForFilter(actual);var expectedType=getTypeForFilter(expected);if(expectedType==='string'&&expected.charAt(0)==='!'){return !deepCompare(actual,expected.substring(1),comparator,anyPropertyKey,matchAgainstAnyProp);}else if(isArray(actual)){\nreturn actual.some(function(item){return deepCompare(item,expected,comparator,anyPropertyKey,matchAgainstAnyProp);});}switch(actualType){case'object':var key;if(matchAgainstAnyProp){for(key in actual){\nif(key.charAt&&key.charAt(0)!=='$'&&deepCompare(actual[key],expected,comparator,anyPropertyKey,true)){return true;}}return dontMatchWholeObject?false:deepCompare(actual,expected,comparator,anyPropertyKey,false);}else if(expectedType==='object'){for(key in expected){var expectedVal=expected[key];if(isFunction(expectedVal)||isUndefined(expectedVal)){continue;}var matchAnyProperty=key===anyPropertyKey;var actualVal=matchAnyProperty?actual:actual[key];if(!deepCompare(actualVal,expectedVal,comparator,anyPropertyKey,matchAnyProperty,matchAnyProperty)){return false;}}return true;}else {return comparator(actual,expected);}case'function':return false;default:return comparator(actual,expected);}}\nfunction getTypeForFilter(val){return val===null?'null':typeof val;}var MAX_DIGITS=22;var DECIMAL_SEP='.';var ZERO_CHAR='0';\ncurrencyFilter.$inject=['$locale'];function currencyFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(amount,currencySymbol,fractionSize){if(isUndefined(currencySymbol)){currencySymbol=formats.CURRENCY_SYM;}if(isUndefined(fractionSize)){fractionSize=formats.PATTERNS[1].maxFrac;}\nvar currencySymbolRe=!currencySymbol?/\\s*\\u00A4\\s*/g:/\\u00A4/g;\nreturn amount==null?amount:formatNumber(amount,formats.PATTERNS[1],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize).replace(currencySymbolRe,currencySymbol);};}\nnumberFilter.$inject=['$locale'];function numberFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(number,fractionSize){\nreturn number==null?number:formatNumber(number,formats.PATTERNS[0],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize);};}\nfunction parse(numStr){var exponent=0,digits,numberOfIntegerDigits;var i,j,zeros;\nif((numberOfIntegerDigits=numStr.indexOf(DECIMAL_SEP))>-1){numStr=numStr.replace(DECIMAL_SEP,'');}\nif((i=numStr.search(/e/i))>0){\nif(numberOfIntegerDigits<0)numberOfIntegerDigits=i;numberOfIntegerDigits+=+numStr.slice(i+1);numStr=numStr.substring(0,i);}else if(numberOfIntegerDigits<0){\nnumberOfIntegerDigits=numStr.length;}\nfor(i=0;numStr.charAt(i)===ZERO_CHAR;i++){}if(i===(zeros=numStr.length)){\ndigits=[0];numberOfIntegerDigits=1;}else {\nzeros--;while(numStr.charAt(zeros)===ZERO_CHAR)zeros--;\nnumberOfIntegerDigits-=i;digits=[];\nfor(j=0;i<=zeros;i++,j++){digits[j]=+numStr.charAt(i);}}\nif(numberOfIntegerDigits>MAX_DIGITS){digits=digits.splice(0,MAX_DIGITS-1);exponent=numberOfIntegerDigits-1;numberOfIntegerDigits=1;}return {d:digits,e:exponent,i:numberOfIntegerDigits};}\nfunction roundNumber(parsedNumber,fractionSize,minFrac,maxFrac){var digits=parsedNumber.d;var fractionLen=digits.length-parsedNumber.i;\nfractionSize=isUndefined(fractionSize)?Math.min(Math.max(minFrac,fractionLen),maxFrac):+fractionSize;\nvar roundAt=fractionSize+parsedNumber.i;var digit=digits[roundAt];if(roundAt>0){\ndigits.splice(Math.max(parsedNumber.i,roundAt));\nfor(var j=roundAt;j=5){if(roundAt-1<0){for(var k=0;k>roundAt;k--){digits.unshift(0);parsedNumber.i++;}digits.unshift(1);parsedNumber.i++;}else {digits[roundAt-1]++;}}\nfor(;fractionLen0){decimals=digits.splice(integerLen,digits.length);}else {decimals=digits;digits=[0];}\nvar groups=[];if(digits.length>=pattern.lgSize){groups.unshift(digits.splice(-pattern.lgSize,digits.length).join(''));}while(digits.length>pattern.gSize){groups.unshift(digits.splice(-pattern.gSize,digits.length).join(''));}if(digits.length){groups.unshift(digits.join(''));}formattedText=groups.join(groupSep);\nif(decimals.length){formattedText+=decimalSep+decimals.join('');}if(exponent){formattedText+='e+'+exponent;}}if(number<0&&!isZero){return pattern.negPre+formattedText+pattern.negSuf;}else {return pattern.posPre+formattedText+pattern.posSuf;}}function padNumber(num,digits,trim,negWrap){var neg='';if(num<0||negWrap&&num<=0){if(negWrap){num=-num+1;}else {num=-num;neg='-';}}num=''+num;while(num.length0||value>-offset){value+=offset;}if(value===0&&offset===-12)value=12;return padNumber(value,size,trim,negWrap);};}function dateStrGetter(name,shortForm,standAlone){return function(date,formats){var value=date['get'+name]();var propPrefix=(standAlone?'STANDALONE':'')+(shortForm?'SHORT':'');var get=uppercase(propPrefix+name);return formats[get][value];};}function timeZoneGetter(date,formats,offset){var zone=-1*offset;var paddedZone=zone>=0?'+':'';paddedZone+=padNumber(Math[zone>0?'floor':'ceil'](zone/60),2)+padNumber(Math.abs(zone%60),2);return paddedZone;}function getFirstThursdayOfYear(year){\nvar dayOfWeekOnFirst=new Date(year,0,1).getDay();\nreturn new Date(year,0,(dayOfWeekOnFirst<=4?5:12)-dayOfWeekOnFirst);}function getThursdayThisWeek(datetime){return new Date(datetime.getFullYear(),datetime.getMonth(),\ndatetime.getDate()+(4-datetime.getDay()));}function weekGetter(size){return function(date){var firstThurs=getFirstThursdayOfYear(date.getFullYear()),thisThurs=getThursdayThisWeek(date);var diff=+thisThurs-+firstThurs,result=1+Math.round(diff/6.048e8);\nreturn padNumber(result,size);};}function ampmGetter(date,formats){return date.getHours()<12?formats.AMPMS[0]:formats.AMPMS[1];}function eraGetter(date,formats){return date.getFullYear()<=0?formats.ERAS[0]:formats.ERAS[1];}function longEraGetter(date,formats){return date.getFullYear()<=0?formats.ERANAMES[0]:formats.ERANAMES[1];}var DATE_FORMATS={yyyy:dateGetter('FullYear',4,0,false,true),yy:dateGetter('FullYear',2,0,true,true),y:dateGetter('FullYear',1,0,false,true),MMMM:dateStrGetter('Month'),MMM:dateStrGetter('Month',true),MM:dateGetter('Month',2,1),M:dateGetter('Month',1,1),LLLL:dateStrGetter('Month',false,true),dd:dateGetter('Date',2),d:dateGetter('Date',1),HH:dateGetter('Hours',2),H:dateGetter('Hours',1),hh:dateGetter('Hours',2,-12),h:dateGetter('Hours',1,-12),mm:dateGetter('Minutes',2),m:dateGetter('Minutes',1),ss:dateGetter('Seconds',2),s:dateGetter('Seconds',1),\nsss:dateGetter('Milliseconds',3),EEEE:dateStrGetter('Day'),EEE:dateStrGetter('Day',true),a:ampmGetter,Z:timeZoneGetter,ww:weekGetter(2),w:weekGetter(1),G:eraGetter,GG:eraGetter,GGG:eraGetter,GGGG:longEraGetter};var DATE_FORMATS_SPLIT=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\\s\\S]*)/,NUMBER_STRING=/^-?\\d+$/;\ndateFilter.$inject=['$locale'];function dateFilter($locale){var R_ISO8601_STR=/^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\nfunction jsonStringToDate(string){var match;if(match=string.match(R_ISO8601_STR)){var date=new Date(0),tzHour=0,tzMin=0,dateSetter=match[8]?date.setUTCFullYear:date.setFullYear,timeSetter=match[8]?date.setUTCHours:date.setHours;if(match[9]){tzHour=toInt(match[9]+match[10]);tzMin=toInt(match[9]+match[11]);}dateSetter.call(date,toInt(match[1]),toInt(match[2])-1,toInt(match[3]));var h=toInt(match[4]||0)-tzHour;var m=toInt(match[5]||0)-tzMin;var s=toInt(match[6]||0);var ms=Math.round(parseFloat('0.'+(match[7]||0))*1000);timeSetter.call(date,h,m,s,ms);return date;}return string;}return function(date,format,timezone){var text='',parts=[],fn,match;format=format||'mediumDate';format=$locale.DATETIME_FORMATS[format]||format;if(isString(date)){date=NUMBER_STRING.test(date)?toInt(date):jsonStringToDate(date);}if(isNumber(date)){date=new Date(date);}if(!isDate(date)||!isFinite(date.getTime())){return date;}while(format){match=DATE_FORMATS_SPLIT.exec(format);if(match){parts=concat(parts,match,1);format=parts.pop();}else {parts.push(format);format=null;}}var dateTimezoneOffset=date.getTimezoneOffset();if(timezone){dateTimezoneOffset=timezoneToOffset(timezone,dateTimezoneOffset);date=convertTimezoneToLocal(date,timezone,true);}forEach(parts,function(value){fn=DATE_FORMATS[value];text+=fn?fn(date,$locale.DATETIME_FORMATS,dateTimezoneOffset):value==='\\'\\''?'\\'':value.replace(/(^'|'$)/g,'').replace(/''/g,'\\'');});return text;};}\nfunction jsonFilter(){return function(object,spacing){if(isUndefined(spacing)){spacing=2;}return toJson(object,spacing);};}\nvar lowercaseFilter=valueFn(lowercase);\nvar uppercaseFilter=valueFn(uppercase);\nfunction limitToFilter(){return function(input,limit,begin){if(Math.abs(Number(limit))===Infinity){limit=Number(limit);}else {limit=toInt(limit);}if(isNumberNaN(limit))return input;if(isNumber(input))input=input.toString();if(!isArrayLike(input))return input;begin=!begin||isNaN(begin)?0:toInt(begin);begin=begin<0?Math.max(0,input.length+begin):begin;if(limit>=0){return sliceFn(input,begin,begin+limit);}else {if(begin===0){return sliceFn(input,limit,input.length);}else {return sliceFn(input,Math.max(0,begin+limit),begin);}}};}function sliceFn(input,begin,end){if(isString(input))return input.slice(begin,end);return slice.call(input,begin,end);}\norderByFilter.$inject=['$parse'];function orderByFilter($parse){return function(array,sortPredicate,reverseOrder,compareFn){if(array==null)return array;if(!isArrayLike(array)){throw minErr('orderBy')('notarray','Expected array but received: {0}',array);}if(!isArray(sortPredicate)){sortPredicate=[sortPredicate];}if(sortPredicate.length===0){sortPredicate=['+'];}var predicates=processPredicates(sortPredicate);var descending=reverseOrder?-1:1;\nvar compare=isFunction(compareFn)?compareFn:defaultCompare;\nvar compareValues=Array.prototype.map.call(array,getComparisonObject);compareValues.sort(doComparison);array=compareValues.map(function(item){return item.value;});return array;function getComparisonObject(value,index){\nreturn {value:value,tieBreaker:{value:index,type:'number',index:index},predicateValues:predicates.map(function(predicate){return getPredicateValue(predicate.get(value),index);})};}function doComparison(v1,v2){for(var i=0,ii=predicates.length;i=parsedMinVal;};attr.$observe('min',function(val){if(val!==minVal){parsedMinVal=parseObservedDateValue(val);minVal=val;ctrl.$validate();}});}if(isDefined(attr.max)||attr.ngMax){var maxVal=attr.max||$parse(attr.ngMax)(scope);var parsedMaxVal=parseObservedDateValue(maxVal);ctrl.$validators.max=function(value){return !isValidDate(value)||isUndefined(parsedMaxVal)||parseDate(value)<=parsedMaxVal;};attr.$observe('max',function(val){if(val!==maxVal){parsedMaxVal=parseObservedDateValue(val);maxVal=val;ctrl.$validate();}});}function isValidDate(value){\nreturn value&&!(value.getTime&&value.getTime()!==value.getTime());}function parseObservedDateValue(val){return isDefined(val)&&!isDate(val)?parseDateAndConvertTimeZoneToLocal(val)||undefined:val;}function parseDateAndConvertTimeZoneToLocal(value,previousDate){var timezone=ctrl.$options.getOption('timezone');if(previousTimezone&&previousTimezone!==timezone){\npreviousDate=addDateMinutes(previousDate,timezoneToOffset(previousTimezone));}var parsedDate=parseDate(value,previousDate);if(!isNaN(parsedDate)&&timezone){parsedDate=convertTimezoneToLocal(parsedDate,timezone);}return parsedDate;}function formatter(value,timezone){var targetFormat=format;if(isTimeType&&isString(ctrl.$options.getOption('timeSecondsFormat'))){targetFormat=format.replace('ss.sss',ctrl.$options.getOption('timeSecondsFormat')).replace(/:$/,'');}var formatted=$filter('date')(value,targetFormat,timezone);if(isTimeType&&ctrl.$options.getOption('timeStripZeroSeconds')){formatted=formatted.replace(/(?::00)?(?:\\.000)?$/,'');}return formatted;}};}function badInputChecker(scope,element,attr,ctrl,parserName){var node=element[0];var nativeValidation=ctrl.$$hasNativeValidators=isObject(node.validity);if(nativeValidation){ctrl.$parsers.push(function(value){var validity=element.prop(VALIDITY_STATE_PROPERTY)||{};if(validity.badInput||validity.typeMismatch){ctrl.$$parserName=parserName;return undefined;}return value;});}}function numberFormatterParser(ctrl){ctrl.$parsers.push(function(value){if(ctrl.$isEmpty(value))return null;if(NUMBER_REGEXP.test(value))return parseFloat(value);ctrl.$$parserName='number';return undefined;});ctrl.$formatters.push(function(value){if(!ctrl.$isEmpty(value)){if(!isNumber(value)){throw ngModelMinErr('numfmt','Expected `{0}` to be a number',value);}value=value.toString();}return value;});}function parseNumberAttrVal(val){if(isDefined(val)&&!isNumber(val)){val=parseFloat(val);}return !isNumberNaN(val)?val:undefined;}function isNumberInteger(num){\nreturn (num|0)===num;}function countDecimals(num){var numString=num.toString();var decimalSymbolIndex=numString.indexOf('.');if(decimalSymbolIndex===-1){if(-1=parsedMinVal;};attr.$observe('min',function(val){if(val!==minVal){parsedMinVal=parseNumberAttrVal(val);minVal=val;\nctrl.$validate();}});}if(isDefined(attr.max)||attr.ngMax){var maxVal=attr.max||$parse(attr.ngMax)(scope);var parsedMaxVal=parseNumberAttrVal(maxVal);ctrl.$validators.max=function(modelValue,viewValue){return ctrl.$isEmpty(viewValue)||isUndefined(parsedMaxVal)||viewValue<=parsedMaxVal;};attr.$observe('max',function(val){if(val!==maxVal){parsedMaxVal=parseNumberAttrVal(val);maxVal=val;\nctrl.$validate();}});}if(isDefined(attr.step)||attr.ngStep){var stepVal=attr.step||$parse(attr.ngStep)(scope);var parsedStepVal=parseNumberAttrVal(stepVal);ctrl.$validators.step=function(modelValue,viewValue){return ctrl.$isEmpty(viewValue)||isUndefined(parsedStepVal)||isValidForStep(viewValue,parsedMinVal||0,parsedStepVal);};attr.$observe('step',function(val){\nif(val!==stepVal){parsedStepVal=parseNumberAttrVal(val);stepVal=val;ctrl.$validate();}});}}function rangeInputType(scope,element,attr,ctrl,$sniffer,$browser){badInputChecker(scope,element,attr,ctrl,'range');numberFormatterParser(ctrl);baseInputType(scope,element,attr,ctrl,$sniffer,$browser);var supportsRange=ctrl.$$hasNativeValidators&&element[0].type==='range',minVal=supportsRange?0:undefined,maxVal=supportsRange?100:undefined,stepVal=supportsRange?1:undefined,validity=element[0].validity,hasMinAttr=isDefined(attr.min),hasMaxAttr=isDefined(attr.max),hasStepAttr=isDefined(attr.step);var originalRender=ctrl.$render;ctrl.$render=supportsRange&&isDefined(validity.rangeUnderflow)&&isDefined(validity.rangeOverflow)?\nfunction rangeRender(){originalRender();ctrl.$setViewValue(element.val());}:originalRender;if(hasMinAttr){minVal=parseNumberAttrVal(attr.min);ctrl.$validators.min=supportsRange?\nfunction noopMinValidator(){return true;}:\nfunction minValidator(modelValue,viewValue){return ctrl.$isEmpty(viewValue)||isUndefined(minVal)||viewValue>=minVal;};setInitialValueAndObserver('min',minChange);}if(hasMaxAttr){maxVal=parseNumberAttrVal(attr.max);ctrl.$validators.max=supportsRange?\nfunction noopMaxValidator(){return true;}:\nfunction maxValidator(modelValue,viewValue){return ctrl.$isEmpty(viewValue)||isUndefined(maxVal)||viewValue<=maxVal;};setInitialValueAndObserver('max',maxChange);}if(hasStepAttr){stepVal=parseNumberAttrVal(attr.step);ctrl.$validators.step=supportsRange?function nativeStepValidator(){\nreturn !validity.stepMismatch;}:\nfunction stepValidator(modelValue,viewValue){return ctrl.$isEmpty(viewValue)||isUndefined(stepVal)||isValidForStep(viewValue,minVal||0,stepVal);};setInitialValueAndObserver('step',stepChange);}function setInitialValueAndObserver(htmlAttrName,changeFn){\nelement.attr(htmlAttrName,attr[htmlAttrName]);var oldVal=attr[htmlAttrName];attr.$observe(htmlAttrName,function wrappedObserver(val){if(val!==oldVal){oldVal=val;changeFn(val);}});}function minChange(val){minVal=parseNumberAttrVal(val);\nif(isNumberNaN(ctrl.$modelValue)){return;}if(supportsRange){var elVal=element.val();\nif(minVal>elVal){elVal=minVal;element.val(elVal);}ctrl.$setViewValue(elVal);}else {\nctrl.$validate();}}function maxChange(val){maxVal=parseNumberAttrVal(val);\nif(isNumberNaN(ctrl.$modelValue)){return;}if(supportsRange){var elVal=element.val();\nif(maxVal0||classCounts[className]){classCounts[className]=(classCounts[className]||0)+count;if(classCounts[className]===+(count>0)){classesToUpdate.push(className);}}});return classesToUpdate.join(' ');}function ngClassIndexWatchAction(newModulo){\nif(newModulo===selector){addClasses(oldClassString);}else {removeClasses(oldClassString);}oldModulo=newModulo;}function ngClassWatchAction(newClassString){if(oldModulo===selector){updateClasses(oldClassString,newClassString);}oldClassString=newClassString;}}};}];\nfunction arrayDifference(tokens1,tokens2){if(!tokens1||!tokens1.length)return [];if(!tokens2||!tokens2.length)return tokens1;var values=[];outer:for(var i=0;i0){\nthis.$$pendingDebounce=this.$$timeout(function(){that.$commitViewValue();},debounceDelay);}else if(this.$$rootScope.$$phase){this.$commitViewValue();}else {this.$$scope.$apply(function(){that.$commitViewValue();});}},\n$overrideModelOptions:function(options){this.$options=this.$options.createChild(options);this.$$setUpdateOnEvents();},\n$processModelValue:function(){var viewValue=this.$$format();if(this.$viewValue!==viewValue){this.$$updateEmptyClasses(viewValue);this.$viewValue=this.$$lastCommittedViewValue=viewValue;this.$render();\nthis.$$runValidators(this.$modelValue,this.$viewValue,noop);}},\n$$format:function(){var formatters=this.$formatters,idx=formatters.length;var viewValue=this.$modelValue;while(idx--){viewValue=formatters[idx](viewValue);}return viewValue;},\n$$setModelValue:function(modelValue){this.$modelValue=this.$$rawModelValue=modelValue;this.$$parserValid=undefined;this.$processModelValue();},$$setUpdateOnEvents:function(){if(this.$$updateEvents){this.$$element.off(this.$$updateEvents,this.$$updateEventHandler);}this.$$updateEvents=this.$options.getOption('updateOn');if(this.$$updateEvents){this.$$element.on(this.$$updateEvents,this.$$updateEventHandler);}},$$updateEventHandler:function(ev){this.$$debounceViewValueCommit(ev&&ev.type);}};function setupModelWatcher(ctrl){\nctrl.$$scope.$watch(function ngModelWatch(scope){var modelValue=ctrl.$$ngModelGet(scope);\nif(modelValue!==ctrl.$modelValue&&(\nctrl.$modelValue===ctrl.$modelValue||modelValue===modelValue)){ctrl.$$setModelValue(modelValue);}return modelValue;});}\naddSetValidityMethod({clazz:NgModelController,set:function(object,property){object[property]=true;},unset:function(object,property){delete object[property];}});\nvar ngModelDirective=['$rootScope',function($rootScope){return {restrict:'A',require:['ngModel','^?form','^?ngModelOptions'],controller:NgModelController,\npriority:1,compile:function ngModelCompile(element){\nelement.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);return {pre:function ngModelPreLink(scope,element,attr,ctrls){var modelCtrl=ctrls[0],formCtrl=ctrls[1]||modelCtrl.$$parentForm,optionsCtrl=ctrls[2];if(optionsCtrl){modelCtrl.$options=optionsCtrl.$options;}modelCtrl.$$initGetterSetters();\nformCtrl.$addControl(modelCtrl);attr.$observe('name',function(newValue){if(modelCtrl.$name!==newValue){modelCtrl.$$parentForm.$$renameControl(modelCtrl,newValue);}});scope.$on('$destroy',function(){modelCtrl.$$parentForm.$removeControl(modelCtrl);});},post:function ngModelPostLink(scope,element,attr,ctrls){var modelCtrl=ctrls[0];modelCtrl.$$setUpdateOnEvents();function setTouched(){modelCtrl.$setTouched();}element.on('blur',function(){if(modelCtrl.$touched)return;if($rootScope.$$phase){scope.$evalAsync(setTouched);}else {scope.$apply(setTouched);}});}};}};}];var defaultModelOptions;var DEFAULT_REGEXP=/(\\s+|^)default(\\s+|$)/;\nfunction ModelOptions(options){this.$$options=options;}ModelOptions.prototype={\ngetOption:function(name){return this.$$options[name];},\ncreateChild:function(options){var inheritAll=false;\noptions=extend({},options);\nforEach(options,function(option,key){if(option==='$inherit'){if(key==='*'){inheritAll=true;}else {options[key]=this.$$options[key];\nif(key==='updateOn'){options.updateOnDefault=this.$$options.updateOnDefault;}}}else {if(key==='updateOn'){\noptions.updateOnDefault=false;options[key]=trim(option.replace(DEFAULT_REGEXP,function(){options.updateOnDefault=true;return ' ';}));}}},this);if(inheritAll){\ndelete options['*'];defaults(options,this.$$options);}\ndefaults(options,defaultModelOptions.$$options);return new ModelOptions(options);}};defaultModelOptions=new ModelOptions({updateOn:'',updateOnDefault:true,debounce:0,getterSetter:false,allowInvalid:false,timezone:null});\nvar ngModelOptionsDirective=function(){NgModelOptionsController.$inject=['$attrs','$scope'];function NgModelOptionsController($attrs,$scope){this.$$attrs=$attrs;this.$$scope=$scope;}NgModelOptionsController.prototype={$onInit:function(){var parentOptions=this.parentCtrl?this.parentCtrl.$options:defaultModelOptions;var modelOptionsDefinition=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=parentOptions.createChild(modelOptionsDefinition);}};return {restrict:'A',\npriority:10,require:{parentCtrl:'?^^ngModelOptions'},bindToController:true,controller:NgModelOptionsController};};\nfunction defaults(dst,src){forEach(src,function(value,key){if(!isDefined(dst[key])){dst[key]=value;}});}\nvar ngNonBindableDirective=ngDirective({terminal:true,priority:1000}); var ngOptionsMinErr=minErr('ngOptions');\nvar NG_OPTIONS_REGEXP=/^\\s*([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+group\\s+by\\s+([\\s\\S]+?))?(?:\\s+disable\\s+when\\s+([\\s\\S]+?))?\\s+for\\s+(?:([$\\w][$\\w]*)|(?:\\(\\s*([$\\w][$\\w]*)\\s*,\\s*([$\\w][$\\w]*)\\s*\\)))\\s+in\\s+([\\s\\S]+?)(?:\\s+track\\s+by\\s+([\\s\\S]+?))?$/;\nvar ngOptionsDirective=['$compile','$document','$parse',function($compile,$document,$parse){function parseOptionsExpression(optionsExp,selectElement,scope){var match=optionsExp.match(NG_OPTIONS_REGEXP);if(!match){throw ngOptionsMinErr('iexp','Expected expression in form of '+'\\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\\''+' but got \\'{0}\\'. Element: {1}',optionsExp,startingTag(selectElement));}\nvar valueName=match[5]||match[7];\nvar keyName=match[6];\nvar selectAs=/ as /.test(match[0])&&match[1];\nvar trackBy=match[9];\nvar valueFn=$parse(match[2]?match[1]:valueName);var selectAsFn=selectAs&&$parse(selectAs);var viewValueFn=selectAsFn||valueFn;var trackByFn=trackBy&&$parse(trackBy);\nvar getTrackByValueFn=trackBy?function(value,locals){return trackByFn(scope,locals);}:function getHashOfValue(value){return hashKey(value);};var getTrackByValue=function(value,key){return getTrackByValueFn(value,getLocals(value,key));};var displayFn=$parse(match[2]||match[1]);var groupByFn=$parse(match[3]||'');var disableWhenFn=$parse(match[4]||'');var valuesFn=$parse(match[8]);var locals={};var getLocals=keyName?function(value,key){locals[keyName]=key;locals[valueName]=value;return locals;}:function(value){locals[valueName]=value;return locals;};function Option(selectValue,viewValue,label,group,disabled){this.selectValue=selectValue;this.viewValue=viewValue;this.label=label;this.group=group;this.disabled=disabled;}function getOptionValuesKeys(optionValues){var optionValuesKeys;if(!keyName&&isArrayLike(optionValues)){optionValuesKeys=optionValues;}else {\noptionValuesKeys=[];for(var itemKey in optionValues){if(optionValues.hasOwnProperty(itemKey)&&itemKey.charAt(0)!=='$'){optionValuesKeys.push(itemKey);}}}return optionValuesKeys;}return {trackBy:trackBy,getTrackByValue:getTrackByValue,getWatchables:$parse(valuesFn,function(optionValues){\nvar watchedArray=[];optionValues=optionValues||[];var optionValuesKeys=getOptionValuesKeys(optionValues);var optionValuesLength=optionValuesKeys.length;for(var index=0;index=0;i--){var option=options.items[i];if(isDefined(option.group)){jqLiteRemove(option.element.parentNode);}else {jqLiteRemove(option.element);}}}options=ngOptions.getOptions();var groupElementMap={};options.items.forEach(function addOption(option){var groupElement;if(isDefined(option.group)){\ngroupElement=groupElementMap[option.group];if(!groupElement){groupElement=optGroupTemplate.cloneNode(false);listFragment.appendChild(groupElement);\ngroupElement.label=option.group===null?'null':option.group;\ngroupElementMap[option.group]=groupElement;}addOptionElement(option,groupElement);}else {\naddOptionElement(option,listFragment);}});selectElement[0].appendChild(listFragment);ngModelCtrl.$render();\nif(!ngModelCtrl.$isEmpty(previousValue)){var nextValue=selectCtrl.readValue();var isNotPrimitive=ngOptions.trackBy||multiple;if(isNotPrimitive?!equals(previousValue,nextValue):previousValue!==nextValue){ngModelCtrl.$setViewValue(nextValue);ngModelCtrl.$render();}}}}return {restrict:'A',terminal:true,require:['select','ngModel'],link:{pre:function ngOptionsPreLink(scope,selectElement,attr,ctrls){\nctrls[0].registerOption=noop;},post:ngOptionsPostLink}};}];\nvar ngPluralizeDirective=['$locale','$interpolate','$log',function($locale,$interpolate,$log){var BRACE=/{}/g,IS_WHEN=/^when(Minus)?(.+)$/;return {link:function(scope,element,attr){var numberExp=attr.count,whenExp=attr.$attr.when&&element.attr(attr.$attr.when),\noffset=attr.offset||0,whens=scope.$eval(whenExp)||{},whensExpFns={},startSymbol=$interpolate.startSymbol(),endSymbol=$interpolate.endSymbol(),braceReplacement=startSymbol+numberExp+'-'+offset+endSymbol,watchRemover=angular.noop,lastCount;forEach(attr,function(expression,attributeName){var tmpMatch=IS_WHEN.exec(attributeName);if(tmpMatch){var whenKey=(tmpMatch[1]?'-':'')+lowercase(tmpMatch[2]);whens[whenKey]=element.attr(attr.$attr[attributeName]);}});forEach(whens,function(expression,key){whensExpFns[key]=$interpolate(expression.replace(BRACE,braceReplacement));});scope.$watch(numberExp,function ngPluralizeWatchAction(newVal){var count=parseFloat(newVal);var countIsNaN=isNumberNaN(count);if(!countIsNaN&&!(count in whens)){\ncount=$locale.pluralCat(count-offset);}\nif(count!==lastCount&&!(countIsNaN&&isNumberNaN(lastCount))){watchRemover();var whenExpFn=whensExpFns[count];if(isUndefined(whenExpFn)){if(newVal!=null){$log.debug('ngPluralize: no rule defined for \\''+count+'\\' in '+whenExp);}watchRemover=noop;updateElementText();}else {watchRemover=scope.$watch(whenExpFn,updateElementText);}lastCount=count;}});function updateElementText(newText){element.text(newText||'');}}};}];\nvar ngRefMinErr=minErr('ngRef');var ngRefDirective=['$parse',function($parse){return {priority:-1,\nrestrict:'A',compile:function(tElement,tAttrs){\nvar controllerName=directiveNormalize(nodeName_(tElement));\nvar getter=$parse(tAttrs.ngRef);var setter=getter.assign||function(){throw ngRefMinErr('nonassign','Expression in ngRef=\"{0}\" is non-assignable!',tAttrs.ngRef);};return function(scope,element,attrs){var refValue;if(attrs.hasOwnProperty('ngRefRead')){if(attrs.ngRefRead==='$element'){refValue=element;}else {refValue=element.data('$'+attrs.ngRefRead+'Controller');if(!refValue){throw ngRefMinErr('noctrl','The controller for ngRefRead=\"{0}\" could not be found on ngRef=\"{1}\"',attrs.ngRefRead,tAttrs.ngRef);}}}else {refValue=element.data('$'+controllerName+'Controller');}refValue=refValue||element;setter(scope,refValue);\nelement.on('$destroy',function(){\nif(getter(scope)===refValue){setter(scope,null);}});};}};}];\nvar ngRepeatDirective=['$parse','$animate','$compile',function($parse,$animate,$compile){var NG_REMOVED='$$NG_REMOVED';var ngRepeatMinErr=minErr('ngRepeat');var updateScope=function(scope,index,valueIdentifier,value,keyIdentifier,key,arrayLength){\nscope[valueIdentifier]=value;if(keyIdentifier)scope[keyIdentifier]=key;scope.$index=index;scope.$first=index===0;scope.$last=index===arrayLength-1;scope.$middle=!(scope.$first||scope.$last);\nscope.$odd=!(scope.$even=(index&1)===0);};var getBlockStart=function(block){return block.clone[0];};var getBlockEnd=function(block){return block.clone[block.clone.length-1];};var trackByIdArrayFn=function($scope,key,value){return hashKey(value);};var trackByIdObjFn=function($scope,key){return key;};return {restrict:'A',multiElement:true,transclude:'element',priority:1000,terminal:true,$$tlb:true,compile:function ngRepeatCompile($element,$attr){var expression=$attr.ngRepeat;var ngRepeatEndComment=$compile.$$createComment('end ngRepeat',expression);var match=expression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);if(!match){throw ngRepeatMinErr('iexp','Expected expression in form of \\'_item_ in _collection_[ track by _id_]\\' but got \\'{0}\\'.',expression);}var lhs=match[1];var rhs=match[2];var aliasAs=match[3];var trackByExp=match[4];match=lhs.match(/^(?:(\\s*[$\\w]+)|\\(\\s*([$\\w]+)\\s*,\\s*([$\\w]+)\\s*\\))$/);if(!match){throw ngRepeatMinErr('iidexp','\\'_item_\\' in \\'_item_ in _collection_\\' should be an identifier or \\'(_key_, _value_)\\' expression, but got \\'{0}\\'.',lhs);}var valueIdentifier=match[3]||match[1];var keyIdentifier=match[2];if(aliasAs&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs)||/^(null|undefined|this|\\$index|\\$first|\\$middle|\\$last|\\$even|\\$odd|\\$parent|\\$root|\\$id)$/.test(aliasAs))){throw ngRepeatMinErr('badident','alias \\'{0}\\' is invalid --- must be a valid JS identifier which is not a reserved name.',aliasAs);}var trackByIdExpFn;if(trackByExp){var hashFnLocals={$id:hashKey};var trackByExpGetter=$parse(trackByExp);trackByIdExpFn=function($scope,key,value,index){\nif(keyIdentifier)hashFnLocals[keyIdentifier]=key;hashFnLocals[valueIdentifier]=value;hashFnLocals.$index=index;return trackByExpGetter($scope,hashFnLocals);};}return function ngRepeatLink($scope,$element,$attr,ctrl,$transclude){\nvar lastBlockMap=createMap();\n$scope.$watchCollection(rhs,function ngRepeatAction(collection){var index,length,previousNode=$element[0],\nnextNode,\nnextBlockMap=createMap(),collectionLength,key,value,\ntrackById,trackByIdFn,collectionKeys,block,\nnextBlockOrder,elementsToRemove;if(aliasAs){$scope[aliasAs]=collection;}if(isArrayLike(collection)){collectionKeys=collection;trackByIdFn=trackByIdExpFn||trackByIdArrayFn;}else {trackByIdFn=trackByIdExpFn||trackByIdObjFn;\ncollectionKeys=[];for(var itemKey in collection){if(hasOwnProperty.call(collection,itemKey)&&itemKey.charAt(0)!=='$'){collectionKeys.push(itemKey);}}}collectionLength=collectionKeys.length;nextBlockOrder=new Array(collectionLength);\nfor(index=0;index=minlengthParsed;};}};}];function parsePatternAttr(regex,patternExp,elm){if(!regex)return undefined;if(isString(regex)){regex=new RegExp('^'+regex+'$');}if(!regex.test){throw minErr('ngPattern')('noregexp','Expected {0} to be a RegExp but was {1}. Element: {2}',patternExp,regex,startingTag(elm));}return regex;}function parseLength(val){var intVal=toInt(val);return isNumberNaN(intVal)?-1:intVal;}if(window.angular.bootstrap){\nif(window.console){console.log('WARNING: Tried to load AngularJS more than once.');}return;}\nbindJQuery();publishExternalAPI(angular);angular.module(\"ngLocale\",[],[\"$provide\",function($provide){var PLURAL_CATEGORY={ZERO:\"zero\",ONE:\"one\",TWO:\"two\",FEW:\"few\",MANY:\"many\",OTHER:\"other\"};function getDecimals(n){n=n+'';var i=n.indexOf('.');return i==-1?0:n.length-i-1;}function getVF(n,opt_precision){var v=opt_precision;if(undefined===v){v=Math.min(getDecimals(n),3);}var base=Math.pow(10,v);var f=(n*base|0)%base;return {v:v,f:f};}$provide.value(\"$locale\",{\"DATETIME_FORMATS\":{\"AMPMS\":[\"AM\",\"PM\"],\"DAY\":[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],\"ERANAMES\":[\"Before Christ\",\"Anno Domini\"],\"ERAS\":[\"BC\",\"AD\"],\"FIRSTDAYOFWEEK\":6,\"MONTH\":[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\"SHORTDAY\":[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],\"SHORTMONTH\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],\"STANDALONEMONTH\":[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\"WEEKENDRANGE\":[5,6],\"fullDate\":\"EEEE, MMMM d, y\",\"longDate\":\"MMMM d, y\",\"medium\":\"MMM d, y h:mm:ss a\",\"mediumDate\":\"MMM d, y\",\"mediumTime\":\"h:mm:ss a\",\"short\":\"M/d/yy h:mm a\",\"shortDate\":\"M/d/yy\",\"shortTime\":\"h:mm a\"},\"NUMBER_FORMATS\":{\"CURRENCY_SYM\":\"$\",\"DECIMAL_SEP\":\".\",\"GROUP_SEP\":\",\",\"PATTERNS\":[{\"gSize\":3,\"lgSize\":3,\"maxFrac\":3,\"minFrac\":0,\"minInt\":1,\"negPre\":\"-\",\"negSuf\":\"\",\"posPre\":\"\",\"posSuf\":\"\"},{\"gSize\":3,\"lgSize\":3,\"maxFrac\":2,\"minFrac\":2,\"minInt\":1,\"negPre\":\"-\\u00a4\",\"negSuf\":\"\",\"posPre\":\"\\u00a4\",\"posSuf\":\"\"}]},\"id\":\"en-us\",\"localeID\":\"en_US\",\"pluralCat\":function(n,opt_precision){var i=n|0;var vf=getVF(n,opt_precision);if(i==1&&vf.v==0){return PLURAL_CATEGORY.ONE;}return PLURAL_CATEGORY.OTHER;}});}]);jqLite(function(){angularInit(window.document,bootstrap);});})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('');\n\nvar angular_1 = angular;\n\nvar ng_from_import = /*#__PURE__*/Object.freeze({\n __proto__: null,\n 'default': angular_1,\n __moduleExports: angular_1\n});\n\nvar ng_from_global = angular;\nvar ng = ng_from_import && undefined ? ng_from_import : ng_from_global;\n\nvar __spreadArrays = undefined && undefined.__spreadArrays || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n};\nfunction curry(fn) {\n return function curried() {\n if (arguments.length >= fn.length) {\n return fn.apply(this, arguments);\n }\n var args = Array.prototype.slice.call(arguments);\n return curried.bind.apply(curried, __spreadArrays([this], args));\n };\n}\nfunction compose() {\n var args = arguments;\n var start = args.length - 1;\n return function () {\n var i = start,\n result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}\nfunction pipe() {\n var funcs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n funcs[_i] = arguments[_i];\n }\n return compose.apply(null, [].slice.call(arguments).reverse());\n}\nvar prop = function (name) {\n return function (obj) {\n return obj && obj[name];\n };\n};\nvar propEq = curry(function (name, _val, obj) {\n return obj && obj[name] === _val;\n});\nvar parse = function (name) {\n return pipe.apply(null, name.split('.').map(prop));\n};\nvar not = function (fn) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return !fn.apply(null, args);\n };\n};\nfunction and(fn1, fn2) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fn1.apply(null, args) && fn2.apply(null, args);\n };\n}\nfunction or(fn1, fn2) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fn1.apply(null, args) || fn2.apply(null, args);\n };\n}\nvar all = function (fn1) {\n return function (arr) {\n return arr.reduce(function (b, x) {\n return b && !!fn1(x);\n }, true);\n };\n};\nvar any = function (fn1) {\n return function (arr) {\n return arr.reduce(function (b, x) {\n return b || !!fn1(x);\n }, false);\n };\n};\nvar is = function (ctor) {\n return function (obj) {\n return obj != null && obj.constructor === ctor || obj instanceof ctor;\n };\n};\nvar val = function (v) {\n return function () {\n return v;\n };\n};\nfunction pattern(struct) {\n return function (x) {\n for (var i = 0; i < struct.length; i++) {\n if (struct[i][0](x)) return struct[i][1](x);\n }\n };\n}\n\nvar toStr = Object.prototype.toString;\nvar tis = function (t) {\n return function (x) {\n return typeof x === t;\n };\n};\nvar isUndefined = tis('undefined');\nvar isDefined = not(isUndefined);\nvar isNull = function (o) {\n return o === null;\n};\nvar isNullOrUndefined = or(isNull, isUndefined);\nvar isFunction = tis('function');\nvar isNumber = tis('number');\nvar isString = tis('string');\nvar isObject = function (x) {\n return x !== null && typeof x === 'object';\n};\nvar isArray = Array.isArray;\nvar isDate = function (x) {\n return toStr.call(x) === '[object Date]';\n};\nvar isRegExp = function (x) {\n return toStr.call(x) === '[object RegExp]';\n};\nfunction isInjectable(val) {\n if (isArray(val) && val.length) {\n var head = val.slice(0, -1),\n tail = val.slice(-1);\n return !(head.filter(not(isString)).length || tail.filter(not(isFunction)).length);\n }\n return isFunction(val);\n}\nvar isPromise = and(isObject, pipe(prop('then'), isFunction));\n\nvar noImpl = function (fnname) {\n return function () {\n throw new Error(\"No implementation for \" + fnname + \". The framework specific code did not implement this method.\");\n };\n};\nvar makeStub = function (service, methods) {\n return methods.reduce(function (acc, key) {\n return acc[key] = noImpl(service + \".\" + key + \"()\"), acc;\n }, {});\n};\nvar services = {\n $q: undefined,\n $injector: undefined\n};\n\nvar __spreadArrays$1 = undefined && undefined.__spreadArrays || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n};\nvar root = typeof self === 'object' && self.self === self && self || typeof global === 'object' && global.global === global && global || undefined;\nvar angular$1 = root.angular || {};\nvar fromJson = angular$1.fromJson || JSON.parse.bind(JSON);\nvar toJson = angular$1.toJson || JSON.stringify.bind(JSON);\nvar forEach = angular$1.forEach || _forEach;\nvar extend = Object.assign || _extend;\nvar equals = angular$1.equals || _equals;\nfunction identity(x) {\n return x;\n}\nfunction noop() {}\nfunction createProxyFunctions(source, target, bind, fnNames, latebind) {\n if (latebind === void 0) {\n latebind = false;\n }\n var bindFunction = function (fnName) {\n return source()[fnName].bind(bind());\n };\n var makeLateRebindFn = function (fnName) {\n return function lateRebindFunction() {\n target[fnName] = bindFunction(fnName);\n return target[fnName].apply(null, arguments);\n };\n };\n fnNames = fnNames || Object.keys(source());\n return fnNames.reduce(function (acc, name) {\n acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name);\n return acc;\n }, target);\n}\nvar inherit = function (parent, extra) {\n return extend(Object.create(parent), extra);\n};\nvar inArray = curry(_inArray);\nfunction _inArray(array, obj) {\n return array.indexOf(obj) !== -1;\n}\nvar removeFrom = curry(_removeFrom);\nfunction _removeFrom(array, obj) {\n var idx = array.indexOf(obj);\n if (idx >= 0) array.splice(idx, 1);\n return array;\n}\nvar pushTo = curry(_pushTo);\nfunction _pushTo(arr, val) {\n return arr.push(val), val;\n}\nvar deregAll = function (functions) {\n return functions.slice().forEach(function (fn) {\n typeof fn === 'function' && fn();\n removeFrom(functions, fn);\n });\n};\nfunction defaults(opts) {\n var defaultsList = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n defaultsList[_i - 1] = arguments[_i];\n }\n var defaultVals = extend.apply(void 0, __spreadArrays$1([{}], defaultsList.reverse()));\n return extend(defaultVals, pick(opts || {}, Object.keys(defaultVals)));\n}\nvar mergeR = function (memo, item) {\n return extend(memo, item);\n};\nfunction ancestors(first, second) {\n var path = [];\n for (var n in first.path) {\n if (first.path[n] !== second.path[n]) break;\n path.push(first.path[n]);\n }\n return path;\n}\nfunction pick(obj, propNames) {\n var objCopy = {};\n for (var _prop in obj) {\n if (propNames.indexOf(_prop) !== -1) {\n objCopy[_prop] = obj[_prop];\n }\n }\n return objCopy;\n}\nfunction omit(obj, propNames) {\n return Object.keys(obj).filter(not(inArray(propNames))).reduce(function (acc, key) {\n return acc[key] = obj[key], acc;\n }, {});\n}\nfunction filter(collection, callback) {\n var arr = isArray(collection),\n result = arr ? [] : {};\n var accept = arr ? function (x) {\n return result.push(x);\n } : function (x, key) {\n return result[key] = x;\n };\n forEach(collection, function (item, i) {\n if (callback(item, i)) accept(item, i);\n });\n return result;\n}\nfunction find(collection, callback) {\n var result;\n forEach(collection, function (item, i) {\n if (result) return;\n if (callback(item, i)) result = item;\n });\n return result;\n}\nvar mapObj = map;\nfunction map(collection, callback, target) {\n target = target || (isArray(collection) ? [] : {});\n forEach(collection, function (item, i) {\n return target[i] = callback(item, i);\n });\n return target;\n}\nvar values = function (obj) {\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n};\nvar allTrueR = function (memo, elem) {\n return memo && elem;\n};\nvar anyTrueR = function (memo, elem) {\n return memo || elem;\n};\nvar unnestR = function (memo, elem) {\n return memo.concat(elem);\n};\nvar flattenR = function (memo, elem) {\n return isArray(elem) ? memo.concat(elem.reduce(flattenR, [])) : pushR(memo, elem);\n};\nfunction pushR(arr, obj) {\n arr.push(obj);\n return arr;\n}\nvar uniqR = function (acc, token) {\n return inArray(acc, token) ? acc : pushR(acc, token);\n};\nvar unnest = function (arr) {\n return arr.reduce(unnestR, []);\n};\nvar assertPredicate = assertFn;\nfunction assertFn(predicateOrMap, errMsg) {\n if (errMsg === void 0) {\n errMsg = 'assert failure';\n }\n return function (obj) {\n var result = predicateOrMap(obj);\n if (!result) {\n throw new Error(isFunction(errMsg) ? errMsg(obj) : errMsg);\n }\n return result;\n };\n}\nfunction arrayTuples() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 0) return [];\n var maxArrayLen = args.reduce(function (min, arr) {\n return Math.min(arr.length, min);\n }, 9007199254740991);\n var result = [];\n var _loop_1 = function (i) {\n switch (args.length) {\n case 1:\n result.push([args[0][i]]);\n break;\n case 2:\n result.push([args[0][i], args[1][i]]);\n break;\n case 3:\n result.push([args[0][i], args[1][i], args[2][i]]);\n break;\n case 4:\n result.push([args[0][i], args[1][i], args[2][i], args[3][i]]);\n break;\n default:\n result.push(args.map(function (array) {\n return array[i];\n }));\n break;\n }\n };\n for (var i = 0; i < maxArrayLen; i++) {\n _loop_1(i);\n }\n return result;\n}\nfunction applyPairs(memo, keyValTuple) {\n var key, value;\n if (isArray(keyValTuple)) key = keyValTuple[0], value = keyValTuple[1];\n if (!isString(key)) throw new Error('invalid parameters to applyPairs');\n memo[key] = value;\n return memo;\n}\nfunction tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}\nfunction copy(src, dest) {\n if (dest) Object.keys(dest).forEach(function (key) {\n return delete dest[key];\n });\n if (!dest) dest = {};\n return extend(dest, src);\n}\nfunction _forEach(obj, cb, _this) {\n if (isArray(obj)) return obj.forEach(cb, _this);\n Object.keys(obj).forEach(function (key) {\n return cb(obj[key], key);\n });\n}\nfunction _extend(toObj) {\n for (var i = 1; i < arguments.length; i++) {\n var obj = arguments[i];\n if (!obj) continue;\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; j++) {\n toObj[keys[j]] = obj[keys[j]];\n }\n }\n return toObj;\n}\nfunction _equals(o1, o2) {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true;\n var t1 = typeof o1,\n t2 = typeof o2;\n if (t1 !== t2 || t1 !== 'object') return false;\n var tup = [o1, o2];\n if (all(isArray)(tup)) return _arraysEq(o1, o2);\n if (all(isDate)(tup)) return o1.getTime() === o2.getTime();\n if (all(isRegExp)(tup)) return o1.toString() === o2.toString();\n if (all(isFunction)(tup)) return true;\n var predicates = [isFunction, isArray, isDate, isRegExp];\n if (predicates.map(any).reduce(function (b, fn) {\n return b || !!fn(tup);\n }, false)) return false;\n var keys = {};\n for (var key in o1) {\n if (!_equals(o1[key], o2[key])) return false;\n keys[key] = true;\n }\n for (var key in o2) {\n if (!keys[key]) return false;\n }\n return true;\n}\nfunction _arraysEq(a1, a2) {\n if (a1.length !== a2.length) return false;\n return arrayTuples(a1, a2).reduce(function (b, t) {\n return b && _equals(t[0], t[1]);\n }, true);\n}\nvar silenceUncaughtInPromise = function (promise) {\n return promise.catch(function (e) {\n return 0;\n }) && promise;\n};\nvar silentRejection = function (error) {\n return silenceUncaughtInPromise(services.$q.reject(error));\n};\n\nvar Glob =\nfunction () {\n function Glob(text) {\n this.text = text;\n this.glob = text.split('.');\n var regexpString = this.text.split('.').map(function (seg) {\n if (seg === '**') return '(?:|(?:\\\\.[^.]*)*)';\n if (seg === '*') return '\\\\.[^.]*';\n return '\\\\.' + seg;\n }).join('');\n this.regexp = new RegExp('^' + regexpString + '$');\n }\n Glob.is = function (text) {\n return !!/[!,*]+/.exec(text);\n };\n Glob.fromString = function (text) {\n return Glob.is(text) ? new Glob(text) : null;\n };\n Glob.prototype.matches = function (name) {\n return this.regexp.test('.' + name);\n };\n return Glob;\n}();\n\nvar Queue =\nfunction () {\n function Queue(_items, _limit) {\n if (_items === void 0) {\n _items = [];\n }\n if (_limit === void 0) {\n _limit = null;\n }\n this._items = _items;\n this._limit = _limit;\n this._evictListeners = [];\n this.onEvict = pushTo(this._evictListeners);\n }\n Queue.prototype.enqueue = function (item) {\n var items = this._items;\n items.push(item);\n if (this._limit && items.length > this._limit) this.evict();\n return item;\n };\n Queue.prototype.evict = function () {\n var item = this._items.shift();\n this._evictListeners.forEach(function (fn) {\n return fn(item);\n });\n return item;\n };\n Queue.prototype.dequeue = function () {\n if (this.size()) return this._items.splice(0, 1)[0];\n };\n Queue.prototype.clear = function () {\n var current = this._items;\n this._items = [];\n return current;\n };\n Queue.prototype.size = function () {\n return this._items.length;\n };\n Queue.prototype.remove = function (item) {\n var idx = this._items.indexOf(item);\n return idx > -1 && this._items.splice(idx, 1)[0];\n };\n Queue.prototype.peekTail = function () {\n return this._items[this._items.length - 1];\n };\n Queue.prototype.peekHead = function () {\n if (this.size()) return this._items[0];\n };\n return Queue;\n}();\n\nvar RejectType;\n(function (RejectType) {\n RejectType[RejectType[\"SUPERSEDED\"] = 2] = \"SUPERSEDED\";\n RejectType[RejectType[\"ABORTED\"] = 3] = \"ABORTED\";\n RejectType[RejectType[\"INVALID\"] = 4] = \"INVALID\";\n RejectType[RejectType[\"IGNORED\"] = 5] = \"IGNORED\";\n RejectType[RejectType[\"ERROR\"] = 6] = \"ERROR\";\n})(RejectType || (RejectType = {}));\nvar id = 0;\nvar Rejection =\nfunction () {\n function Rejection(type, message, detail) {\n this.$id = id++;\n this.type = type;\n this.message = message;\n this.detail = detail;\n }\n Rejection.isRejectionPromise = function (obj) {\n return obj && typeof obj.then === 'function' && is(Rejection)(obj._transitionRejection);\n };\n Rejection.superseded = function (detail, options) {\n var message = 'The transition has been superseded by a different transition';\n var rejection = new Rejection(RejectType.SUPERSEDED, message, detail);\n if (options && options.redirected) {\n rejection.redirected = true;\n }\n return rejection;\n };\n Rejection.redirected = function (detail) {\n return Rejection.superseded(detail, {\n redirected: true\n });\n };\n Rejection.invalid = function (detail) {\n var message = 'This transition is invalid';\n return new Rejection(RejectType.INVALID, message, detail);\n };\n Rejection.ignored = function (detail) {\n var message = 'The transition was ignored';\n return new Rejection(RejectType.IGNORED, message, detail);\n };\n Rejection.aborted = function (detail) {\n var message = 'The transition has been aborted';\n return new Rejection(RejectType.ABORTED, message, detail);\n };\n Rejection.errored = function (detail) {\n var message = 'The transition errored';\n return new Rejection(RejectType.ERROR, message, detail);\n };\n Rejection.normalize = function (detail) {\n return is(Rejection)(detail) ? detail : Rejection.errored(detail);\n };\n Rejection.prototype.toString = function () {\n var detailString = function (d) {\n return d && d.toString !== Object.prototype.toString ? d.toString() : stringify(d);\n };\n var detail = detailString(this.detail);\n var _a = this,\n $id = _a.$id,\n type = _a.type,\n message = _a.message;\n return \"Transition Rejection($id: \" + $id + \" type: \" + type + \", message: \" + message + \", detail: \" + detail + \")\";\n };\n Rejection.prototype.toPromise = function () {\n return extend(silentRejection(this), {\n _transitionRejection: this\n });\n };\n return Rejection;\n}();\n\nfunction maxLength(max, str) {\n if (str.length <= max) return str;\n return str.substr(0, max - 3) + '...';\n}\nfunction padString(length, str) {\n while (str.length < length) str += ' ';\n return str;\n}\nfunction kebobString(camelCase) {\n return camelCase.replace(/^([A-Z])/, function ($1) {\n return $1.toLowerCase();\n })\n .replace(/([A-Z])/g, function ($1) {\n return '-' + $1.toLowerCase();\n });\n}\nfunction functionToString(fn) {\n var fnStr = fnToString(fn);\n var namedFunctionMatch = fnStr.match(/^(function [^ ]+\\([^)]*\\))/);\n var toStr = namedFunctionMatch ? namedFunctionMatch[1] : fnStr;\n var fnName = fn['name'] || '';\n if (fnName && toStr.match(/function \\(/)) {\n return 'function ' + fnName + toStr.substr(9);\n }\n return toStr;\n}\nfunction fnToString(fn) {\n var _fn = isArray(fn) ? fn.slice(-1)[0] : fn;\n return _fn && _fn.toString() || 'undefined';\n}\nvar isRejection = Rejection.isRejectionPromise;\nvar hasToString = function (obj) {\n return isObject(obj) && !isArray(obj) && obj.constructor !== Object && isFunction(obj.toString);\n};\nvar stringifyPattern = pattern([[isUndefined, val('undefined')], [isNull, val('null')], [isPromise, val('[Promise]')], [isRejection, function (x) {\n return x._transitionRejection.toString();\n}], [hasToString, function (x) {\n return x.toString();\n}], [isInjectable, functionToString], [val(true), identity]]);\nfunction stringify(o) {\n var seen = [];\n function format(value) {\n if (isObject(value)) {\n if (seen.indexOf(value) !== -1) return '[circular ref]';\n seen.push(value);\n }\n return stringifyPattern(value);\n }\n if (isUndefined(o)) {\n return format(o);\n }\n return JSON.stringify(o, function (key, value) {\n return format(value);\n }).replace(/\\\\\"/g, '\"');\n}\nvar beforeAfterSubstr = function (char) {\n return function (str) {\n if (!str) return ['', ''];\n var idx = str.indexOf(char);\n if (idx === -1) return [str, ''];\n return [str.substr(0, idx), str.substr(idx + 1)];\n };\n};\nvar stripLastPathElement = function (str) {\n return str.replace(/\\/[^/]*$/, '');\n};\nvar splitHash = beforeAfterSubstr('#');\nvar splitQuery = beforeAfterSubstr('?');\nvar splitEqual = beforeAfterSubstr('=');\nvar trimHashVal = function (str) {\n return str ? str.replace(/^#/, '') : '';\n};\nfunction splitOnDelim(delim) {\n var re = new RegExp('(' + delim + ')', 'g');\n return function (str) {\n return str.split(re).filter(identity);\n };\n}\nfunction joinNeighborsR(acc, x) {\n if (isString(tail(acc)) && isString(x)) return acc.slice(0, -1).concat(tail(acc) + x);\n return pushR(acc, x);\n}\n\nvar noopConsoleStub = {\n log: noop,\n error: noop,\n table: noop\n};\nfunction ie9Console(console) {\n var bound = function (fn) {\n return Function.prototype.bind.call(fn, console);\n };\n return {\n log: bound(console.log),\n error: bound(console.log),\n table: bound(console.log)\n };\n}\nfunction fallbackConsole(console) {\n var log = console.log.bind(console);\n var error = console.error ? console.error.bind(console) : log;\n var table = console.table ? console.table.bind(console) : log;\n return {\n log: log,\n error: error,\n table: table\n };\n}\nfunction getSafeConsole() {\n var isIE9 = typeof document !== 'undefined' && document.documentMode && document.documentMode === 9;\n if (isIE9) {\n return window && window.console ? ie9Console(window.console) : noopConsoleStub;\n } else if (!console.table || !console.error) {\n return fallbackConsole(console);\n } else {\n return console;\n }\n}\nvar safeConsole = getSafeConsole();\n\nfunction uiViewString(uiview) {\n if (!uiview) return 'ui-view (defunct)';\n var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)';\n return \"[ui-view#\" + uiview.id + \" \" + uiview.$type + \":\" + uiview.fqn + \" (\" + uiview.name + \"@\" + state + \")]\";\n}\nvar viewConfigString = function (viewConfig) {\n var view = viewConfig.viewDecl;\n var state = view.$context.name || '(root)';\n return \"[View#\" + viewConfig.$id + \" from '\" + state + \"' state]: target ui-view: '\" + view.$uiViewName + \"@\" + view.$uiViewContextAnchor + \"'\";\n};\nfunction normalizedCat(input) {\n return isNumber(input) ? Category[input] : Category[Category[input]];\n}\nvar Category;\n(function (Category) {\n Category[Category[\"RESOLVE\"] = 0] = \"RESOLVE\";\n Category[Category[\"TRANSITION\"] = 1] = \"TRANSITION\";\n Category[Category[\"HOOK\"] = 2] = \"HOOK\";\n Category[Category[\"UIVIEW\"] = 3] = \"UIVIEW\";\n Category[Category[\"VIEWCONFIG\"] = 4] = \"VIEWCONFIG\";\n})(Category || (Category = {}));\nvar _tid = parse('$id');\nvar _rid = parse('router.$id');\nvar transLbl = function (trans) {\n return \"Transition #\" + _tid(trans) + \"-\" + _rid(trans);\n};\nvar Trace =\nfunction () {\n function Trace() {\n this._enabled = {};\n this.approximateDigests = 0;\n }\n Trace.prototype._set = function (enabled, categories) {\n var _this = this;\n if (!categories.length) {\n categories = Object.keys(Category).map(function (k) {\n return parseInt(k, 10);\n }).filter(function (k) {\n return !isNaN(k);\n }).map(function (key) {\n return Category[key];\n });\n }\n categories.map(normalizedCat).forEach(function (category) {\n return _this._enabled[category] = enabled;\n });\n };\n Trace.prototype.enable = function () {\n var categories = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n categories[_i] = arguments[_i];\n }\n this._set(true, categories);\n };\n Trace.prototype.disable = function () {\n var categories = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n categories[_i] = arguments[_i];\n }\n this._set(false, categories);\n };\n Trace.prototype.enabled = function (category) {\n return !!this._enabled[normalizedCat(category)];\n };\n Trace.prototype.traceTransitionStart = function (trans) {\n if (!this.enabled(Category.TRANSITION)) return;\n safeConsole.log(transLbl(trans) + \": Started -> \" + stringify(trans));\n };\n Trace.prototype.traceTransitionIgnored = function (trans) {\n if (!this.enabled(Category.TRANSITION)) return;\n safeConsole.log(transLbl(trans) + \": Ignored <> \" + stringify(trans));\n };\n Trace.prototype.traceHookInvocation = function (step, trans, options) {\n if (!this.enabled(Category.HOOK)) return;\n var event = parse('traceData.hookType')(options) || 'internal',\n context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown',\n name = functionToString(step.registeredHook.callback);\n safeConsole.log(transLbl(trans) + \": Hook -> \" + event + \" context: \" + context + \", \" + maxLength(200, name));\n };\n Trace.prototype.traceHookResult = function (hookResult, trans, transitionOptions) {\n if (!this.enabled(Category.HOOK)) return;\n safeConsole.log(transLbl(trans) + \": <- Hook returned: \" + maxLength(200, stringify(hookResult)));\n };\n Trace.prototype.traceResolvePath = function (path, when, trans) {\n if (!this.enabled(Category.RESOLVE)) return;\n safeConsole.log(transLbl(trans) + \": Resolving \" + path + \" (\" + when + \")\");\n };\n Trace.prototype.traceResolvableResolved = function (resolvable, trans) {\n if (!this.enabled(Category.RESOLVE)) return;\n safeConsole.log(transLbl(trans) + \": <- Resolved \" + resolvable + \" to: \" + maxLength(200, stringify(resolvable.data)));\n };\n Trace.prototype.traceError = function (reason, trans) {\n if (!this.enabled(Category.TRANSITION)) return;\n safeConsole.log(transLbl(trans) + \": <- Rejected \" + stringify(trans) + \", reason: \" + reason);\n };\n Trace.prototype.traceSuccess = function (finalState, trans) {\n if (!this.enabled(Category.TRANSITION)) return;\n safeConsole.log(transLbl(trans) + \": <- Success \" + stringify(trans) + \", final state: \" + finalState.name);\n };\n Trace.prototype.traceUIViewEvent = function (event, viewData, extra) {\n if (extra === void 0) {\n extra = '';\n }\n if (!this.enabled(Category.UIVIEW)) return;\n safeConsole.log(\"ui-view: \" + padString(30, event) + \" \" + uiViewString(viewData) + extra);\n };\n Trace.prototype.traceUIViewConfigUpdated = function (viewData, context) {\n if (!this.enabled(Category.UIVIEW)) return;\n this.traceUIViewEvent('Updating', viewData, \" with ViewConfig from context='\" + context + \"'\");\n };\n Trace.prototype.traceUIViewFill = function (viewData, html) {\n if (!this.enabled(Category.UIVIEW)) return;\n this.traceUIViewEvent('Fill', viewData, \" with: \" + maxLength(200, html));\n };\n Trace.prototype.traceViewSync = function (pairs) {\n if (!this.enabled(Category.VIEWCONFIG)) return;\n var uivheader = 'uiview component fqn';\n var cfgheader = 'view config state (view name)';\n var mapping = pairs.map(function (_a) {\n var _b;\n var uiView = _a.uiView,\n viewConfig = _a.viewConfig;\n var uiv = uiView && uiView.fqn;\n var cfg = viewConfig && viewConfig.viewDecl.$context.name + \": (\" + viewConfig.viewDecl.$name + \")\";\n return _b = {}, _b[uivheader] = uiv, _b[cfgheader] = cfg, _b;\n }).sort(function (a, b) {\n return (a[uivheader] || '').localeCompare(b[uivheader] || '');\n });\n safeConsole.table(mapping);\n };\n Trace.prototype.traceViewServiceEvent = function (event, viewConfig) {\n if (!this.enabled(Category.VIEWCONFIG)) return;\n safeConsole.log(\"VIEWCONFIG: \" + event + \" \" + viewConfigString(viewConfig));\n };\n Trace.prototype.traceViewServiceUIViewEvent = function (event, viewData) {\n if (!this.enabled(Category.VIEWCONFIG)) return;\n safeConsole.log(\"VIEWCONFIG: \" + event + \" \" + uiViewString(viewData));\n };\n return Trace;\n}();\nvar trace = new Trace();\n\nvar ParamType =\nfunction () {\n function ParamType(def) {\n this.pattern = /.*/;\n this.inherit = true;\n extend(this, def);\n }\n ParamType.prototype.is = function (val, key) {\n return true;\n };\n ParamType.prototype.encode = function (val, key) {\n return val;\n };\n ParamType.prototype.decode = function (val, key) {\n return val;\n };\n ParamType.prototype.equals = function (a, b) {\n return a == b;\n };\n ParamType.prototype.$subPattern = function () {\n var sub = this.pattern.toString();\n return sub.substr(1, sub.length - 2);\n };\n ParamType.prototype.toString = function () {\n return \"{ParamType:\" + this.name + \"}\";\n };\n ParamType.prototype.$normalize = function (val) {\n return this.is(val) ? val : this.decode(val);\n };\n ParamType.prototype.$asArray = function (mode, isSearch) {\n if (!mode) return this;\n if (mode === 'auto' && !isSearch) throw new Error(\"'auto' array mode is for query parameters only\");\n return new ArrayType(this, mode);\n };\n return ParamType;\n}();\nfunction ArrayType(type, mode) {\n var _this = this;\n function arrayWrap(val) {\n return isArray(val) ? val : isDefined(val) ? [val] : [];\n }\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === 'auto' ? val[0] : val;\n default:\n return val;\n }\n }\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return allTruthyMode === true ? filter(result, function (x) {\n return !x;\n }).length === 0 : arrayUnwrap(result);\n };\n }\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1),\n right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n raw: type.raw,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode\n });\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar isShorthand = function (cfg) {\n return ['value', 'type', 'squash', 'array', 'dynamic'].filter(hasOwn.bind(cfg || {})).length === 0;\n};\nvar DefType;\n(function (DefType) {\n DefType[DefType[\"PATH\"] = 0] = \"PATH\";\n DefType[DefType[\"SEARCH\"] = 1] = \"SEARCH\";\n DefType[DefType[\"CONFIG\"] = 2] = \"CONFIG\";\n})(DefType || (DefType = {}));\nfunction getParamDeclaration(paramName, location, state) {\n var noReloadOnSearch = state.reloadOnSearch === false && location === DefType.SEARCH || undefined;\n var dynamic = find([state.dynamic, noReloadOnSearch], isDefined);\n var defaultConfig = isDefined(dynamic) ? {\n dynamic: dynamic\n } : {};\n var paramConfig = unwrapShorthand(state && state.params && state.params[paramName]);\n return extend(defaultConfig, paramConfig);\n}\nfunction unwrapShorthand(cfg) {\n cfg = isShorthand(cfg) ? {\n value: cfg\n } : cfg;\n getStaticDefaultValue['__cacheable'] = true;\n function getStaticDefaultValue() {\n return cfg.value;\n }\n var $$fn = isInjectable(cfg.value) ? cfg.value : getStaticDefaultValue;\n return extend(cfg, {\n $$fn: $$fn\n });\n}\nfunction getType(cfg, urlType, location, id, paramTypes) {\n if (cfg.type && urlType && urlType.name !== 'string') throw new Error(\"Param '\" + id + \"' has two type configurations.\");\n if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type)) return paramTypes.type(cfg.type);\n if (urlType) return urlType;\n if (!cfg.type) {\n var type = location === DefType.CONFIG ? 'any' : location === DefType.PATH ? 'path' : location === DefType.SEARCH ? 'query' : 'string';\n return paramTypes.type(type);\n }\n return cfg.type instanceof ParamType ? cfg.type : paramTypes.type(cfg.type);\n}\nfunction getSquashPolicy(config, isOptional, defaultPolicy) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n}\nfunction getReplace(config, arrayMode, isOptional, squash) {\n var defaultPolicy = [{\n from: '',\n to: isOptional || arrayMode ? undefined : ''\n }, {\n from: null,\n to: isOptional || arrayMode ? undefined : ''\n }];\n var replace = isArray(config.replace) ? config.replace : [];\n if (isString(squash)) replace.push({\n from: squash,\n to: undefined\n });\n var configuredKeys = map(replace, prop('from'));\n return filter(defaultPolicy, function (item) {\n return configuredKeys.indexOf(item.from) === -1;\n }).concat(replace);\n}\nvar Param =\nfunction () {\n function Param(id, type, location, urlConfig, state) {\n var config = getParamDeclaration(id, location, state);\n type = getType(config, type, location, id, urlConfig.paramTypes);\n var arrayMode = getArrayMode();\n type = arrayMode ? type.$asArray(arrayMode, location === DefType.SEARCH) : type;\n var isOptional = config.value !== undefined || location === DefType.SEARCH;\n var dynamic = isDefined(config.dynamic) ? !!config.dynamic : !!type.dynamic;\n var raw = isDefined(config.raw) ? !!config.raw : !!type.raw;\n var squash = getSquashPolicy(config, isOptional, urlConfig.defaultSquashPolicy());\n var replace = getReplace(config, arrayMode, isOptional, squash);\n var inherit = isDefined(config.inherit) ? !!config.inherit : !!type.inherit;\n function getArrayMode() {\n var arrayDefaults = {\n array: location === DefType.SEARCH ? 'auto' : false\n };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? {\n array: true\n } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }\n extend(this, {\n id: id,\n type: type,\n location: location,\n isOptional: isOptional,\n dynamic: dynamic,\n raw: raw,\n squash: squash,\n replace: replace,\n inherit: inherit,\n array: arrayMode,\n config: config\n });\n }\n Param.values = function (params, values) {\n if (values === void 0) {\n values = {};\n }\n var paramValues = {};\n for (var _i = 0, params_1 = params; _i < params_1.length; _i++) {\n var param = params_1[_i];\n paramValues[param.id] = param.value(values[param.id]);\n }\n return paramValues;\n };\n Param.changed = function (params, values1, values2) {\n if (values1 === void 0) {\n values1 = {};\n }\n if (values2 === void 0) {\n values2 = {};\n }\n return params.filter(function (param) {\n return !param.type.equals(values1[param.id], values2[param.id]);\n });\n };\n Param.equals = function (params, values1, values2) {\n if (values1 === void 0) {\n values1 = {};\n }\n if (values2 === void 0) {\n values2 = {};\n }\n return Param.changed(params, values1, values2).length === 0;\n };\n Param.validates = function (params, values) {\n if (values === void 0) {\n values = {};\n }\n return params.map(function (param) {\n return param.validates(values[param.id]);\n }).reduce(allTrueR, true);\n };\n Param.prototype.isDefaultValue = function (value) {\n return this.isOptional && this.type.equals(this.value(), value);\n };\n Param.prototype.value = function (value) {\n var _this = this;\n var getDefaultValue = function () {\n if (_this._defaultValueCache) return _this._defaultValueCache.defaultValue;\n if (!services.$injector) throw new Error('Injectable functions cannot be called at configuration time');\n var defaultValue = services.$injector.invoke(_this.config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue)) throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + _this.id + \"' is not an instance of ParamType (\" + _this.type.name + \")\");\n if (_this.config.$$fn['__cacheable']) {\n _this._defaultValueCache = {\n defaultValue: defaultValue\n };\n }\n return defaultValue;\n };\n var replaceSpecialValues = function (val) {\n for (var _i = 0, _a = _this.replace; _i < _a.length; _i++) {\n var tuple = _a[_i];\n if (tuple.from === val) return tuple.to;\n }\n return val;\n };\n value = replaceSpecialValues(value);\n return isUndefined(value) ? getDefaultValue() : this.type.$normalize(value);\n };\n Param.prototype.isSearch = function () {\n return this.location === DefType.SEARCH;\n };\n Param.prototype.validates = function (value) {\n if ((isUndefined(value) || value === null) && this.isOptional) return true;\n var normalized = this.type.$normalize(value);\n if (!this.type.is(normalized)) return false;\n var encoded = this.type.encode(normalized);\n return !(isString(encoded) && !this.type.pattern.exec(encoded));\n };\n Param.prototype.toString = function () {\n return \"{Param:\" + this.id + \" \" + this.type + \" squash: '\" + this.squash + \"' optional: \" + this.isOptional + \"}\";\n };\n return Param;\n}();\n\nvar ParamTypes =\nfunction () {\n function ParamTypes() {\n this.enqueue = true;\n this.typeQueue = [];\n this.defaultTypes = pick(ParamTypes.prototype, ['hash', 'string', 'query', 'path', 'int', 'bool', 'date', 'json', 'any']);\n var makeType = function (definition, name) {\n return new ParamType(extend({\n name: name\n }, definition));\n };\n this.types = inherit(map(this.defaultTypes, makeType), {});\n }\n ParamTypes.prototype.dispose = function () {\n this.types = {};\n };\n ParamTypes.prototype.type = function (name, definition, definitionFn) {\n if (!isDefined(definition)) return this.types[name];\n if (this.types.hasOwnProperty(name)) throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n this.types[name] = new ParamType(extend({\n name: name\n }, definition));\n if (definitionFn) {\n this.typeQueue.push({\n name: name,\n def: definitionFn\n });\n if (!this.enqueue) this._flushTypeQueue();\n }\n return this;\n };\n ParamTypes.prototype._flushTypeQueue = function () {\n while (this.typeQueue.length) {\n var type = this.typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n extend(this.types[type.name], services.$injector.invoke(type.def));\n }\n };\n return ParamTypes;\n}();\nfunction initDefaultTypes() {\n var makeDefaultType = function (def) {\n var valToString = function (val) {\n return val != null ? val.toString() : val;\n };\n var defaultTypeBase = {\n encode: valToString,\n decode: valToString,\n is: is(String),\n pattern: /.*/,\n equals: function (a, b) {\n return a == b;\n }\n };\n return extend({}, defaultTypeBase, def);\n };\n extend(ParamTypes.prototype, {\n string: makeDefaultType({}),\n path: makeDefaultType({\n pattern: /[^/]*/\n }),\n query: makeDefaultType({}),\n hash: makeDefaultType({\n inherit: false\n }),\n int: makeDefaultType({\n decode: function (val) {\n return parseInt(val, 10);\n },\n is: function (val) {\n return !isNullOrUndefined(val) && this.decode(val.toString()) === val;\n },\n pattern: /-?\\d+/\n }),\n bool: makeDefaultType({\n encode: function (val) {\n return val && 1 || 0;\n },\n decode: function (val) {\n return parseInt(val, 10) !== 0;\n },\n is: is(Boolean),\n pattern: /0|1/\n }),\n date: makeDefaultType({\n encode: function (val) {\n return !this.is(val) ? undefined : [val.getFullYear(), ('0' + (val.getMonth() + 1)).slice(-2), ('0' + val.getDate()).slice(-2)].join('-');\n },\n decode: function (val) {\n if (this.is(val)) return val;\n var match = this.capture.exec(val);\n return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n },\n is: function (val) {\n return val instanceof Date && !isNaN(val.valueOf());\n },\n equals: function (l, r) {\n return ['getFullYear', 'getMonth', 'getDate'].reduce(function (acc, fn) {\n return acc && l[fn]() === r[fn]();\n }, true);\n },\n pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/\n }),\n json: makeDefaultType({\n encode: toJson,\n decode: fromJson,\n is: is(Object),\n equals: equals,\n pattern: /[^/]*/\n }),\n any: makeDefaultType({\n encode: identity,\n decode: identity,\n is: function () {\n return true;\n },\n equals: equals\n })\n });\n}\ninitDefaultTypes();\n\nvar StateParams =\nfunction () {\n function StateParams(params) {\n if (params === void 0) {\n params = {};\n }\n extend(this, params);\n }\n StateParams.prototype.$inherit = function (newParams, $current, $to) {\n var parentParams;\n var parents = ancestors($current, $to),\n inherited = {},\n inheritList = [];\n for (var i in parents) {\n if (!parents[i] || !parents[i].params) continue;\n parentParams = Object.keys(parents[i].params);\n if (!parentParams.length) continue;\n for (var j in parentParams) {\n if (inheritList.indexOf(parentParams[j]) >= 0) continue;\n inheritList.push(parentParams[j]);\n inherited[parentParams[j]] = this[parentParams[j]];\n }\n }\n return extend({}, inherited, newParams);\n };\n return StateParams;\n}();\n\nvar PathNode =\nfunction () {\n function PathNode(stateOrNode) {\n if (stateOrNode instanceof PathNode) {\n var node = stateOrNode;\n this.state = node.state;\n this.paramSchema = node.paramSchema.slice();\n this.paramValues = extend({}, node.paramValues);\n this.resolvables = node.resolvables.slice();\n this.views = node.views && node.views.slice();\n } else {\n var state = stateOrNode;\n this.state = state;\n this.paramSchema = state.parameters({\n inherit: false\n });\n this.paramValues = {};\n this.resolvables = state.resolvables.map(function (res) {\n return res.clone();\n });\n }\n }\n PathNode.prototype.clone = function () {\n return new PathNode(this);\n };\n PathNode.prototype.applyRawParams = function (params) {\n var getParamVal = function (paramDef) {\n return [paramDef.id, paramDef.value(params[paramDef.id])];\n };\n this.paramValues = this.paramSchema.reduce(function (memo, pDef) {\n return applyPairs(memo, getParamVal(pDef));\n }, {});\n return this;\n };\n PathNode.prototype.parameter = function (name) {\n return find(this.paramSchema, propEq('id', name));\n };\n PathNode.prototype.equals = function (node, paramsFn) {\n var diff = this.diff(node, paramsFn);\n return diff && diff.length === 0;\n };\n PathNode.prototype.diff = function (node, paramsFn) {\n if (this.state !== node.state) return false;\n var params = paramsFn ? paramsFn(this) : this.paramSchema;\n return Param.changed(params, this.paramValues, node.paramValues);\n };\n PathNode.clone = function (node) {\n return node.clone();\n };\n return PathNode;\n}();\n\nvar TargetState =\nfunction () {\n function TargetState(_stateRegistry, _identifier, _params, _options) {\n this._stateRegistry = _stateRegistry;\n this._identifier = _identifier;\n this._identifier = _identifier;\n this._params = extend({}, _params || {});\n this._options = extend({}, _options || {});\n this._definition = _stateRegistry.matcher.find(_identifier, this._options.relative);\n }\n TargetState.prototype.name = function () {\n return this._definition && this._definition.name || this._identifier;\n };\n TargetState.prototype.identifier = function () {\n return this._identifier;\n };\n TargetState.prototype.params = function () {\n return this._params;\n };\n TargetState.prototype.$state = function () {\n return this._definition;\n };\n TargetState.prototype.state = function () {\n return this._definition && this._definition.self;\n };\n TargetState.prototype.options = function () {\n return this._options;\n };\n TargetState.prototype.exists = function () {\n return !!(this._definition && this._definition.self);\n };\n TargetState.prototype.valid = function () {\n return !this.error();\n };\n TargetState.prototype.error = function () {\n var base = this.options().relative;\n if (!this._definition && !!base) {\n var stateName = base.name ? base.name : base;\n return \"Could not resolve '\" + this.name() + \"' from state '\" + stateName + \"'\";\n }\n if (!this._definition) return \"No such state '\" + this.name() + \"'\";\n if (!this._definition.self) return \"State '\" + this.name() + \"' has an invalid definition\";\n };\n TargetState.prototype.toString = function () {\n return \"'\" + this.name() + \"'\" + stringify(this.params());\n };\n TargetState.prototype.withState = function (state) {\n return new TargetState(this._stateRegistry, state, this._params, this._options);\n };\n TargetState.prototype.withParams = function (params, replace) {\n if (replace === void 0) {\n replace = false;\n }\n var newParams = replace ? params : extend({}, this._params, params);\n return new TargetState(this._stateRegistry, this._identifier, newParams, this._options);\n };\n TargetState.prototype.withOptions = function (options, replace) {\n if (replace === void 0) {\n replace = false;\n }\n var newOpts = replace ? options : extend({}, this._options, options);\n return new TargetState(this._stateRegistry, this._identifier, this._params, newOpts);\n };\n TargetState.isDef = function (obj) {\n return obj && obj.state && (isString(obj.state) || isObject(obj.state) && isString(obj.state.name));\n };\n return TargetState;\n}();\n\nvar PathUtils =\nfunction () {\n function PathUtils() {}\n PathUtils.makeTargetState = function (registry, path) {\n var state = tail(path).state;\n return new TargetState(registry, state, path.map(prop('paramValues')).reduce(mergeR, {}), {});\n };\n PathUtils.buildPath = function (targetState) {\n var toParams = targetState.params();\n return targetState.$state().path.map(function (state) {\n return new PathNode(state).applyRawParams(toParams);\n });\n };\n PathUtils.buildToPath = function (fromPath, targetState) {\n var toPath = PathUtils.buildPath(targetState);\n if (targetState.options().inherit) {\n return PathUtils.inheritParams(fromPath, toPath, Object.keys(targetState.params()));\n }\n return toPath;\n };\n PathUtils.applyViewConfigs = function ($view, path, states) {\n path.filter(function (node) {\n return inArray(states, node.state);\n }).forEach(function (node) {\n var viewDecls = values(node.state.views || {});\n var subPath = PathUtils.subPath(path, function (n) {\n return n === node;\n });\n var viewConfigs = viewDecls.map(function (view) {\n return $view.createViewConfig(subPath, view);\n });\n node.views = viewConfigs.reduce(unnestR, []);\n });\n };\n PathUtils.inheritParams = function (fromPath, toPath, toKeys) {\n if (toKeys === void 0) {\n toKeys = [];\n }\n function nodeParamVals(path, state) {\n var node = find(path, propEq('state', state));\n return extend({}, node && node.paramValues);\n }\n var noInherit = fromPath.map(function (node) {\n return node.paramSchema;\n }).reduce(unnestR, []).filter(function (param) {\n return !param.inherit;\n }).map(prop('id'));\n function makeInheritedParamsNode(toNode) {\n var toParamVals = extend({}, toNode && toNode.paramValues);\n var incomingParamVals = pick(toParamVals, toKeys);\n toParamVals = omit(toParamVals, toKeys);\n var fromParamVals = omit(nodeParamVals(fromPath, toNode.state) || {}, noInherit);\n var ownParamVals = extend(toParamVals, fromParamVals, incomingParamVals);\n return new PathNode(toNode.state).applyRawParams(ownParamVals);\n }\n return toPath.map(makeInheritedParamsNode);\n };\n PathUtils.treeChanges = function (fromPath, toPath, reloadState) {\n var max = Math.min(fromPath.length, toPath.length);\n var keep = 0;\n var nodesMatch = function (node1, node2) {\n return node1.equals(node2, PathUtils.nonDynamicParams);\n };\n while (keep < max && fromPath[keep].state !== reloadState && nodesMatch(fromPath[keep], toPath[keep])) {\n keep++;\n }\n function applyToParams(retainedNode, idx) {\n var cloned = retainedNode.clone();\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }\n var from, retained, exiting, entering, to;\n from = fromPath;\n retained = from.slice(0, keep);\n exiting = from.slice(keep);\n var retainedWithToParams = retained.map(applyToParams);\n entering = toPath.slice(keep);\n to = retainedWithToParams.concat(entering);\n return {\n from: from,\n to: to,\n retained: retained,\n retainedWithToParams: retainedWithToParams,\n exiting: exiting,\n entering: entering\n };\n };\n PathUtils.matching = function (pathA, pathB, paramsFn) {\n var done = false;\n var tuples = arrayTuples(pathA, pathB);\n return tuples.reduce(function (matching, _a) {\n var nodeA = _a[0],\n nodeB = _a[1];\n done = done || !nodeA.equals(nodeB, paramsFn);\n return done ? matching : matching.concat(nodeA);\n }, []);\n };\n PathUtils.equals = function (pathA, pathB, paramsFn) {\n return pathA.length === pathB.length && PathUtils.matching(pathA, pathB, paramsFn).length === pathA.length;\n };\n PathUtils.subPath = function (path, predicate) {\n var node = find(path, predicate);\n var elementIdx = path.indexOf(node);\n return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1);\n };\n PathUtils.nonDynamicParams = function (node) {\n return node.state.parameters({\n inherit: false\n }).filter(function (param) {\n return !param.dynamic;\n });\n };\n PathUtils.paramValues = function (path) {\n return path.reduce(function (acc, node) {\n return extend(acc, node.paramValues);\n }, {});\n };\n return PathUtils;\n}();\n\nvar resolvePolicies = {\n when: {\n LAZY: 'LAZY',\n EAGER: 'EAGER'\n },\n async: {\n WAIT: 'WAIT',\n NOWAIT: 'NOWAIT'\n }\n};\n\nvar defaultResolvePolicy = {\n when: 'LAZY',\n async: 'WAIT'\n};\nvar Resolvable =\nfunction () {\n function Resolvable(arg1, resolveFn, deps, policy, data) {\n this.resolved = false;\n this.promise = undefined;\n if (arg1 instanceof Resolvable) {\n extend(this, arg1);\n } else if (isFunction(resolveFn)) {\n if (isNullOrUndefined(arg1)) throw new Error('new Resolvable(): token argument is required');\n if (!isFunction(resolveFn)) throw new Error('new Resolvable(): resolveFn argument must be a function');\n this.token = arg1;\n this.policy = policy;\n this.resolveFn = resolveFn;\n this.deps = deps || [];\n this.data = data;\n this.resolved = data !== undefined;\n this.promise = this.resolved ? services.$q.when(this.data) : undefined;\n } else if (isObject(arg1) && arg1.token && (arg1.hasOwnProperty('resolveFn') || arg1.hasOwnProperty('data'))) {\n var literal = arg1;\n return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data);\n }\n }\n Resolvable.prototype.getPolicy = function (state) {\n var thisPolicy = this.policy || {};\n var statePolicy = state && state.resolvePolicy || {};\n return {\n when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when,\n async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async\n };\n };\n Resolvable.prototype.resolve = function (resolveContext, trans) {\n var _this = this;\n var $q = services.$q;\n var getResolvableDependencies = function () {\n return $q.all(resolveContext.getDependencies(_this).map(function (resolvable) {\n return resolvable.get(resolveContext, trans);\n }));\n };\n var invokeResolveFn = function (resolvedDeps) {\n return _this.resolveFn.apply(null, resolvedDeps);\n };\n var node = resolveContext.findNode(this);\n var state = node && node.state;\n var asyncPolicy = this.getPolicy(state).async;\n var customAsyncPolicy = isFunction(asyncPolicy) ? asyncPolicy : identity;\n var applyResolvedValue = function (resolvedValue) {\n _this.data = resolvedValue;\n _this.resolved = true;\n _this.resolveFn = null;\n trace.traceResolvableResolved(_this, trans);\n return _this.data;\n };\n return this.promise = $q.when().then(getResolvableDependencies).then(invokeResolveFn).then(customAsyncPolicy).then(applyResolvedValue);\n };\n Resolvable.prototype.get = function (resolveContext, trans) {\n return this.promise || this.resolve(resolveContext, trans);\n };\n Resolvable.prototype.toString = function () {\n return \"Resolvable(token: \" + stringify(this.token) + \", requires: [\" + this.deps.map(stringify) + \"])\";\n };\n Resolvable.prototype.clone = function () {\n return new Resolvable(this);\n };\n Resolvable.fromData = function (token, data) {\n return new Resolvable(token, function () {\n return data;\n }, null, null, data);\n };\n return Resolvable;\n}();\n\nvar whens = resolvePolicies.when;\nvar ALL_WHENS = [whens.EAGER, whens.LAZY];\nvar EAGER_WHENS = [whens.EAGER];\nvar NATIVE_INJECTOR_TOKEN = 'Native Injector';\nvar ResolveContext =\nfunction () {\n function ResolveContext(_path) {\n this._path = _path;\n }\n ResolveContext.prototype.getTokens = function () {\n return this._path.reduce(function (acc, node) {\n return acc.concat(node.resolvables.map(function (r) {\n return r.token;\n }));\n }, []).reduce(uniqR, []);\n };\n ResolveContext.prototype.getResolvable = function (token) {\n var matching = this._path.map(function (node) {\n return node.resolvables;\n }).reduce(unnestR, []).filter(function (r) {\n return r.token === token;\n });\n return tail(matching);\n };\n ResolveContext.prototype.getPolicy = function (resolvable) {\n var node = this.findNode(resolvable);\n return resolvable.getPolicy(node.state);\n };\n ResolveContext.prototype.subContext = function (state) {\n return new ResolveContext(PathUtils.subPath(this._path, function (node) {\n return node.state === state;\n }));\n };\n ResolveContext.prototype.addResolvables = function (newResolvables, state) {\n var node = find(this._path, propEq('state', state));\n var keys = newResolvables.map(function (r) {\n return r.token;\n });\n node.resolvables = node.resolvables.filter(function (r) {\n return keys.indexOf(r.token) === -1;\n }).concat(newResolvables);\n };\n ResolveContext.prototype.resolvePath = function (when, trans) {\n var _this = this;\n if (when === void 0) {\n when = 'LAZY';\n }\n var whenOption = inArray(ALL_WHENS, when) ? when : 'LAZY';\n var matchedWhens = whenOption === resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS;\n trace.traceResolvePath(this._path, when, trans);\n var matchesPolicy = function (acceptedVals, whenOrAsync) {\n return function (resolvable) {\n return inArray(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]);\n };\n };\n var promises = this._path.reduce(function (acc, node) {\n var nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when'));\n var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async'));\n var wait = nodeResolvables.filter(not(matchesPolicy(['NOWAIT'], 'async')));\n var subContext = _this.subContext(node.state);\n var getResult = function (r) {\n return r.get(subContext, trans)\n .then(function (value) {\n return {\n token: r.token,\n value: value\n };\n });\n };\n nowait.forEach(getResult);\n return acc.concat(wait.map(getResult));\n }, []);\n return services.$q.all(promises);\n };\n ResolveContext.prototype.injector = function () {\n return this._injector || (this._injector = new UIInjectorImpl(this));\n };\n ResolveContext.prototype.findNode = function (resolvable) {\n return find(this._path, function (node) {\n return inArray(node.resolvables, resolvable);\n });\n };\n ResolveContext.prototype.getDependencies = function (resolvable) {\n var _this = this;\n var node = this.findNode(resolvable);\n var subPath = PathUtils.subPath(this._path, function (x) {\n return x === node;\n }) || this._path;\n var availableResolvables = subPath.reduce(function (acc, _node) {\n return acc.concat(_node.resolvables);\n }, [])\n .filter(function (res) {\n return res !== resolvable;\n });\n var getDependency = function (token) {\n var matching = availableResolvables.filter(function (r) {\n return r.token === token;\n });\n if (matching.length) return tail(matching);\n var fromInjector = _this.injector().getNative(token);\n if (isUndefined(fromInjector)) {\n throw new Error('Could not find Dependency Injection token: ' + stringify(token));\n }\n return new Resolvable(token, function () {\n return fromInjector;\n }, [], fromInjector);\n };\n return resolvable.deps.map(getDependency);\n };\n return ResolveContext;\n}();\nvar UIInjectorImpl =\nfunction () {\n function UIInjectorImpl(context) {\n this.context = context;\n this.native = this.get(NATIVE_INJECTOR_TOKEN) || services.$injector;\n }\n UIInjectorImpl.prototype.get = function (token) {\n var resolvable = this.context.getResolvable(token);\n if (resolvable) {\n if (this.context.getPolicy(resolvable).async === 'NOWAIT') {\n return resolvable.get(this.context);\n }\n if (!resolvable.resolved) {\n throw new Error('Resolvable async .get() not complete:' + stringify(resolvable.token));\n }\n return resolvable.data;\n }\n return this.getNative(token);\n };\n UIInjectorImpl.prototype.getAsync = function (token) {\n var resolvable = this.context.getResolvable(token);\n if (resolvable) return resolvable.get(this.context);\n return services.$q.when(this.native.get(token));\n };\n UIInjectorImpl.prototype.getNative = function (token) {\n return this.native && this.native.get(token);\n };\n return UIInjectorImpl;\n}();\n\nvar parseUrl = function (url) {\n if (!isString(url)) return false;\n var root = url.charAt(0) === '^';\n return {\n val: root ? url.substring(1) : url,\n root: root\n };\n};\nfunction nameBuilder(state) {\n return state.name;\n}\nfunction selfBuilder(state) {\n state.self.$$state = function () {\n return state;\n };\n return state.self;\n}\nfunction dataBuilder(state) {\n if (state.parent && state.parent.data) {\n state.data = state.self.data = inherit(state.parent.data, state.data);\n }\n return state.data;\n}\nvar getUrlBuilder = function ($urlMatcherFactoryProvider, root) {\n return function urlBuilder(stateObject) {\n var stateDec = stateObject.self;\n if (stateDec && stateDec.url && stateDec.name && stateDec.name.match(/\\.\\*\\*$/)) {\n var newStateDec = {};\n copy(stateDec, newStateDec);\n newStateDec.url += '{remainder:any}';\n stateDec = newStateDec;\n }\n var parent = stateObject.parent;\n var parsed = parseUrl(stateDec.url);\n var url = !parsed ? stateDec.url : $urlMatcherFactoryProvider.compile(parsed.val, {\n state: stateDec\n });\n if (!url) return null;\n if (!$urlMatcherFactoryProvider.isMatcher(url)) throw new Error(\"Invalid url '\" + url + \"' in state '\" + stateObject + \"'\");\n return parsed && parsed.root ? url : (parent && parent.navigable || root()).url.append(url);\n };\n};\nvar getNavigableBuilder = function (isRoot) {\n return function navigableBuilder(state) {\n return !isRoot(state) && state.url ? state : state.parent ? state.parent.navigable : null;\n };\n};\nvar getParamsBuilder = function (paramFactory) {\n return function paramsBuilder(state) {\n var makeConfigParam = function (config, id) {\n return paramFactory.fromConfig(id, null, state.self);\n };\n var urlParams = state.url && state.url.parameters({\n inherit: false\n }) || [];\n var nonUrlParams = values(mapObj(omit(state.params || {}, urlParams.map(prop('id'))), makeConfigParam));\n return urlParams.concat(nonUrlParams).map(function (p) {\n return [p.id, p];\n }).reduce(applyPairs, {});\n };\n};\nfunction pathBuilder(state) {\n return state.parent ? state.parent.path.concat(state) :\n [state];\n}\nfunction includesBuilder(state) {\n var includes = state.parent ? extend({}, state.parent.includes) : {};\n includes[state.name] = true;\n return includes;\n}\nfunction resolvablesBuilder(state) {\n var objects2Tuples = function (resolveObj, resolvePolicies) {\n return Object.keys(resolveObj || {}).map(function (token) {\n return {\n token: token,\n val: resolveObj[token],\n deps: undefined,\n policy: resolvePolicies[token]\n };\n });\n };\n var annotate = function (fn) {\n var $injector = services.$injector;\n return fn['$inject'] || $injector && $injector.annotate(fn, $injector.strictDi) || 'deferred';\n };\n var isResolveLiteral = function (obj) {\n return !!(obj.token && obj.resolveFn);\n };\n var isLikeNg2Provider = function (obj) {\n return !!((obj.provide || obj.token) && (obj.useValue || obj.useFactory || obj.useExisting || obj.useClass));\n };\n var isTupleFromObj = function (obj) {\n return !!(obj && obj.val && (isString(obj.val) || isArray(obj.val) || isFunction(obj.val)));\n };\n var getToken = function (p) {\n return p.provide || p.token;\n };\n var literal2Resolvable = pattern([[prop('resolveFn'), function (p) {\n return new Resolvable(getToken(p), p.resolveFn, p.deps, p.policy);\n }], [prop('useFactory'), function (p) {\n return new Resolvable(getToken(p), p.useFactory, p.deps || p.dependencies, p.policy);\n }], [prop('useClass'), function (p) {\n return new Resolvable(getToken(p), function () {\n return new p.useClass();\n }, [], p.policy);\n }], [prop('useValue'), function (p) {\n return new Resolvable(getToken(p), function () {\n return p.useValue;\n }, [], p.policy, p.useValue);\n }], [prop('useExisting'), function (p) {\n return new Resolvable(getToken(p), identity, [p.useExisting], p.policy);\n }]]);\n var tuple2Resolvable = pattern([[pipe(prop('val'), isString), function (tuple) {\n return new Resolvable(tuple.token, identity, [tuple.val], tuple.policy);\n }], [pipe(prop('val'), isArray), function (tuple) {\n return new Resolvable(tuple.token, tail(tuple.val), tuple.val.slice(0, -1), tuple.policy);\n }], [pipe(prop('val'), isFunction), function (tuple) {\n return new Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy);\n }]]);\n var item2Resolvable = pattern([[is(Resolvable), function (r) {\n return r;\n }], [isResolveLiteral, literal2Resolvable], [isLikeNg2Provider, literal2Resolvable], [isTupleFromObj, tuple2Resolvable], [val(true), function (obj) {\n throw new Error('Invalid resolve value: ' + stringify(obj));\n }]]);\n var decl = state.resolve;\n var items = isArray(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {});\n return items.map(item2Resolvable);\n}\nvar StateBuilder =\nfunction () {\n function StateBuilder(matcher, urlMatcherFactory) {\n this.matcher = matcher;\n var self = this;\n var root = function () {\n return matcher.find('');\n };\n var isRoot = function (state) {\n return state.name === '';\n };\n function parentBuilder(state) {\n if (isRoot(state)) return null;\n return matcher.find(self.parentName(state)) || root();\n }\n this.builders = {\n name: [nameBuilder],\n self: [selfBuilder],\n parent: [parentBuilder],\n data: [dataBuilder],\n url: [getUrlBuilder(urlMatcherFactory, root)],\n navigable: [getNavigableBuilder(isRoot)],\n params: [getParamsBuilder(urlMatcherFactory.paramFactory)],\n views: [],\n path: [pathBuilder],\n includes: [includesBuilder],\n resolvables: [resolvablesBuilder]\n };\n }\n StateBuilder.prototype.builder = function (name, fn) {\n var builders = this.builders;\n var array = builders[name] || [];\n if (isString(name) && !isDefined(fn)) return array.length > 1 ? array : array[0];\n if (!isString(name) || !isFunction(fn)) return;\n builders[name] = array;\n builders[name].push(fn);\n return function () {\n return builders[name].splice(builders[name].indexOf(fn, 1)) && null;\n };\n };\n StateBuilder.prototype.build = function (state) {\n var _a = this,\n matcher = _a.matcher,\n builders = _a.builders;\n var parent = this.parentName(state);\n if (parent && !matcher.find(parent, undefined, false)) {\n return null;\n }\n for (var key in builders) {\n if (!builders.hasOwnProperty(key)) continue;\n var chain = builders[key].reduce(function (parentFn, step) {\n return function (_state) {\n return step(_state, parentFn);\n };\n }, noop);\n state[key] = chain(state);\n }\n return state;\n };\n StateBuilder.prototype.parentName = function (state) {\n var name = state.name || '';\n var segments = name.split('.');\n var lastSegment = segments.pop();\n if (lastSegment === '**') segments.pop();\n if (segments.length) {\n if (state.parent) {\n throw new Error(\"States that specify the 'parent:' property should not have a '.' in their name (\" + name + \")\");\n }\n return segments.join('.');\n }\n if (!state.parent) return '';\n return isString(state.parent) ? state.parent : state.parent.name;\n };\n StateBuilder.prototype.name = function (state) {\n var name = state.name;\n if (name.indexOf('.') !== -1 || !state.parent) return name;\n var parentName = isString(state.parent) ? state.parent : state.parent.name;\n return parentName ? parentName + '.' + name : name;\n };\n return StateBuilder;\n}();\n\nvar StateObject =\nfunction () {\n function StateObject(config) {\n return StateObject.create(config || {});\n }\n StateObject.create = function (stateDecl) {\n stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl;\n var state = inherit(inherit(stateDecl, StateObject.prototype));\n stateDecl.$$state = function () {\n return state;\n };\n state.self = stateDecl;\n state.__stateObjectCache = {\n nameGlob: Glob.fromString(state.name)\n };\n return state;\n };\n StateObject.prototype.is = function (ref) {\n return this === ref || this.self === ref || this.fqn() === ref;\n };\n StateObject.prototype.fqn = function () {\n if (!this.parent || !(this.parent instanceof this.constructor)) return this.name;\n var name = this.parent.fqn();\n return name ? name + '.' + this.name : this.name;\n };\n StateObject.prototype.root = function () {\n return this.parent && this.parent.root() || this;\n };\n StateObject.prototype.parameters = function (opts) {\n opts = defaults(opts, {\n inherit: true,\n matchingKeys: null\n });\n var inherited = opts.inherit && this.parent && this.parent.parameters() || [];\n return inherited.concat(values(this.params)).filter(function (param) {\n return !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id);\n });\n };\n StateObject.prototype.parameter = function (id, opts) {\n if (opts === void 0) {\n opts = {};\n }\n return this.url && this.url.parameter(id, opts) || find(values(this.params), propEq('id', id)) || opts.inherit && this.parent && this.parent.parameter(id);\n };\n StateObject.prototype.toString = function () {\n return this.fqn();\n };\n StateObject.isStateClass = function (stateDecl) {\n return isFunction(stateDecl) && stateDecl['__uiRouterState'] === true;\n };\n StateObject.isStateDeclaration = function (obj) {\n return isFunction(obj['$$state']);\n };\n StateObject.isState = function (obj) {\n return isObject(obj['__stateObjectCache']);\n };\n return StateObject;\n}();\n\nvar StateMatcher =\nfunction () {\n function StateMatcher(_states) {\n this._states = _states;\n }\n StateMatcher.prototype.isRelative = function (stateName) {\n stateName = stateName || '';\n return stateName.indexOf('.') === 0 || stateName.indexOf('^') === 0;\n };\n StateMatcher.prototype.find = function (stateOrName, base, matchGlob) {\n if (matchGlob === void 0) {\n matchGlob = true;\n }\n if (!stateOrName && stateOrName !== '') return undefined;\n var isStr = isString(stateOrName);\n var name = isStr ? stateOrName : stateOrName.name;\n if (this.isRelative(name)) name = this.resolvePath(name, base);\n var state = this._states[name];\n if (state && (isStr || !isStr && (state === stateOrName || state.self === stateOrName))) {\n return state;\n } else if (isStr && matchGlob) {\n var _states = values(this._states);\n var matches = _states.filter(function (_state) {\n return _state.__stateObjectCache.nameGlob && _state.__stateObjectCache.nameGlob.matches(name);\n });\n if (matches.length > 1) {\n safeConsole.error(\"stateMatcher.find: Found multiple matches for \" + name + \" using glob: \", matches.map(function (match) {\n return match.name;\n }));\n }\n return matches[0];\n }\n return undefined;\n };\n StateMatcher.prototype.resolvePath = function (name, base) {\n if (!base) throw new Error(\"No reference point given for path '\" + name + \"'\");\n var baseState = this.find(base);\n var splitName = name.split('.');\n var pathLength = splitName.length;\n var i = 0,\n current = baseState;\n for (; i < pathLength; i++) {\n if (splitName[i] === '' && i === 0) {\n current = baseState;\n continue;\n }\n if (splitName[i] === '^') {\n if (!current.parent) throw new Error(\"Path '\" + name + \"' not valid for state '\" + baseState.name + \"'\");\n current = current.parent;\n continue;\n }\n break;\n }\n var relName = splitName.slice(i).join('.');\n return current.name + (current.name && relName ? '.' : '') + relName;\n };\n return StateMatcher;\n}();\n\nvar StateQueueManager =\nfunction () {\n function StateQueueManager(router, states, builder, listeners) {\n this.router = router;\n this.states = states;\n this.builder = builder;\n this.listeners = listeners;\n this.queue = [];\n }\n StateQueueManager.prototype.dispose = function () {\n this.queue = [];\n };\n StateQueueManager.prototype.register = function (stateDecl) {\n var queue = this.queue;\n var state = StateObject.create(stateDecl);\n var name = state.name;\n if (!isString(name)) throw new Error('State must have a valid name');\n if (this.states.hasOwnProperty(name) || inArray(queue.map(prop('name')), name)) throw new Error(\"State '\" + name + \"' is already defined\");\n queue.push(state);\n this.flush();\n return state;\n };\n StateQueueManager.prototype.flush = function () {\n var _this = this;\n var _a = this,\n queue = _a.queue,\n states = _a.states,\n builder = _a.builder;\n var registered = [],\n orphans = [],\n previousQueueLength = {};\n var getState = function (name) {\n return _this.states.hasOwnProperty(name) && _this.states[name];\n };\n var notifyListeners = function () {\n if (registered.length) {\n _this.listeners.forEach(function (listener) {\n return listener('registered', registered.map(function (s) {\n return s.self;\n }));\n });\n }\n };\n while (queue.length > 0) {\n var state = queue.shift();\n var name_1 = state.name;\n var result = builder.build(state);\n var orphanIdx = orphans.indexOf(state);\n if (result) {\n var existingState = getState(name_1);\n if (existingState && existingState.name === name_1) {\n throw new Error(\"State '\" + name_1 + \"' is already defined\");\n }\n var existingFutureState = getState(name_1 + '.**');\n if (existingFutureState) {\n this.router.stateRegistry.deregister(existingFutureState);\n }\n states[name_1] = state;\n this.attachRoute(state);\n if (orphanIdx >= 0) orphans.splice(orphanIdx, 1);\n registered.push(state);\n continue;\n }\n var prev = previousQueueLength[name_1];\n previousQueueLength[name_1] = queue.length;\n if (orphanIdx >= 0 && prev === queue.length) {\n queue.push(state);\n notifyListeners();\n return states;\n } else if (orphanIdx < 0) {\n orphans.push(state);\n }\n queue.push(state);\n }\n notifyListeners();\n return states;\n };\n StateQueueManager.prototype.attachRoute = function (state) {\n if (state.abstract || !state.url) return;\n var rulesApi = this.router.urlService.rules;\n rulesApi.rule(rulesApi.urlRuleFactory.create(state));\n };\n return StateQueueManager;\n}();\n\nvar StateRegistry =\nfunction () {\n function StateRegistry(router) {\n this.router = router;\n this.states = {};\n this.listeners = [];\n this.matcher = new StateMatcher(this.states);\n this.builder = new StateBuilder(this.matcher, router.urlMatcherFactory);\n this.stateQueue = new StateQueueManager(router, this.states, this.builder, this.listeners);\n this._registerRoot();\n }\n StateRegistry.prototype._registerRoot = function () {\n var rootStateDef = {\n name: '',\n url: '^',\n views: null,\n params: {\n '#': {\n value: null,\n type: 'hash',\n dynamic: true\n }\n },\n abstract: true\n };\n var _root = this._root = this.stateQueue.register(rootStateDef);\n _root.navigable = null;\n };\n StateRegistry.prototype.dispose = function () {\n var _this = this;\n this.stateQueue.dispose();\n this.listeners = [];\n this.get().forEach(function (state) {\n return _this.get(state) && _this.deregister(state);\n });\n };\n StateRegistry.prototype.onStatesChanged = function (listener) {\n this.listeners.push(listener);\n return function deregisterListener() {\n removeFrom(this.listeners)(listener);\n }.bind(this);\n };\n StateRegistry.prototype.root = function () {\n return this._root;\n };\n StateRegistry.prototype.register = function (stateDefinition) {\n return this.stateQueue.register(stateDefinition);\n };\n StateRegistry.prototype._deregisterTree = function (state) {\n var _this = this;\n var all = this.get().map(function (s) {\n return s.$$state();\n });\n var getChildren = function (states) {\n var _children = all.filter(function (s) {\n return states.indexOf(s.parent) !== -1;\n });\n return _children.length === 0 ? _children : _children.concat(getChildren(_children));\n };\n var children = getChildren([state]);\n var deregistered = [state].concat(children).reverse();\n deregistered.forEach(function (_state) {\n var rulesApi = _this.router.urlService.rules;\n rulesApi.rules().filter(propEq('state', _state)).forEach(function (rule) {\n return rulesApi.removeRule(rule);\n });\n delete _this.states[_state.name];\n });\n return deregistered;\n };\n StateRegistry.prototype.deregister = function (stateOrName) {\n var _state = this.get(stateOrName);\n if (!_state) throw new Error(\"Can't deregister state; not found: \" + stateOrName);\n var deregisteredStates = this._deregisterTree(_state.$$state());\n this.listeners.forEach(function (listener) {\n return listener('deregistered', deregisteredStates.map(function (s) {\n return s.self;\n }));\n });\n return deregisteredStates;\n };\n StateRegistry.prototype.get = function (stateOrName, base) {\n var _this = this;\n if (arguments.length === 0) return Object.keys(this.states).map(function (name) {\n return _this.states[name].self;\n });\n var found = this.matcher.find(stateOrName, base);\n return found && found.self || null;\n };\n StateRegistry.prototype.decorator = function (name, func) {\n return this.builder.builder(name, func);\n };\n return StateRegistry;\n}();\n\nvar TransitionHookPhase;\n(function (TransitionHookPhase) {\n TransitionHookPhase[TransitionHookPhase[\"CREATE\"] = 0] = \"CREATE\";\n TransitionHookPhase[TransitionHookPhase[\"BEFORE\"] = 1] = \"BEFORE\";\n TransitionHookPhase[TransitionHookPhase[\"RUN\"] = 2] = \"RUN\";\n TransitionHookPhase[TransitionHookPhase[\"SUCCESS\"] = 3] = \"SUCCESS\";\n TransitionHookPhase[TransitionHookPhase[\"ERROR\"] = 4] = \"ERROR\";\n})(TransitionHookPhase || (TransitionHookPhase = {}));\nvar TransitionHookScope;\n(function (TransitionHookScope) {\n TransitionHookScope[TransitionHookScope[\"TRANSITION\"] = 0] = \"TRANSITION\";\n TransitionHookScope[TransitionHookScope[\"STATE\"] = 1] = \"STATE\";\n})(TransitionHookScope || (TransitionHookScope = {}));\n\nvar defaultOptions = {\n current: noop,\n transition: null,\n traceData: {},\n bind: null\n};\nvar TransitionHook =\nfunction () {\n function TransitionHook(transition, stateContext, registeredHook, options) {\n var _this = this;\n this.transition = transition;\n this.stateContext = stateContext;\n this.registeredHook = registeredHook;\n this.options = options;\n this.isSuperseded = function () {\n return _this.type.hookPhase === TransitionHookPhase.RUN && !_this.options.transition.isActive();\n };\n this.options = defaults(options, defaultOptions);\n this.type = registeredHook.eventType;\n }\n TransitionHook.chain = function (hooks, waitFor) {\n var createHookChainR = function (prev, nextHook) {\n return prev.then(function () {\n return nextHook.invokeHook();\n });\n };\n return hooks.reduce(createHookChainR, waitFor || services.$q.when());\n };\n TransitionHook.invokeHooks = function (hooks, doneCallback) {\n for (var idx = 0; idx < hooks.length; idx++) {\n var hookResult = hooks[idx].invokeHook();\n if (isPromise(hookResult)) {\n var remainingHooks = hooks.slice(idx + 1);\n return TransitionHook.chain(remainingHooks, hookResult).then(doneCallback);\n }\n }\n return doneCallback();\n };\n TransitionHook.runAllHooks = function (hooks) {\n hooks.forEach(function (hook) {\n return hook.invokeHook();\n });\n };\n TransitionHook.prototype.logError = function (err) {\n this.transition.router.stateService.defaultErrorHandler()(err);\n };\n TransitionHook.prototype.invokeHook = function () {\n var _this = this;\n var hook = this.registeredHook;\n if (hook._deregistered) return;\n var notCurrent = this.getNotCurrentRejection();\n if (notCurrent) return notCurrent;\n var options = this.options;\n trace.traceHookInvocation(this, this.transition, options);\n var invokeCallback = function () {\n return hook.callback.call(options.bind, _this.transition, _this.stateContext);\n };\n var normalizeErr = function (err) {\n return Rejection.normalize(err).toPromise();\n };\n var handleError = function (err) {\n return hook.eventType.getErrorHandler(_this)(err);\n };\n var handleResult = function (result) {\n return hook.eventType.getResultHandler(_this)(result);\n };\n try {\n var result = invokeCallback();\n if (!this.type.synchronous && isPromise(result)) {\n return result.catch(normalizeErr).then(handleResult, handleError);\n } else {\n return handleResult(result);\n }\n } catch (err) {\n return handleError(Rejection.normalize(err));\n } finally {\n if (hook.invokeLimit && ++hook.invokeCount >= hook.invokeLimit) {\n hook.deregister();\n }\n }\n };\n TransitionHook.prototype.handleHookResult = function (result) {\n var _this = this;\n var notCurrent = this.getNotCurrentRejection();\n if (notCurrent) return notCurrent;\n if (isPromise(result)) {\n return result.then(function (val) {\n return _this.handleHookResult(val);\n });\n }\n trace.traceHookResult(result, this.transition, this.options);\n if (result === false) {\n return Rejection.aborted('Hook aborted transition').toPromise();\n }\n var isTargetState = is(TargetState);\n if (isTargetState(result)) {\n return Rejection.redirected(result).toPromise();\n }\n };\n TransitionHook.prototype.getNotCurrentRejection = function () {\n var router = this.transition.router;\n if (router._disposed) {\n return Rejection.aborted(\"UIRouter instance #\" + router.$id + \" has been stopped (disposed)\").toPromise();\n }\n if (this.transition._aborted) {\n return Rejection.aborted().toPromise();\n }\n if (this.isSuperseded()) {\n return Rejection.superseded(this.options.current()).toPromise();\n }\n };\n TransitionHook.prototype.toString = function () {\n var _a = this,\n options = _a.options,\n registeredHook = _a.registeredHook;\n var event = parse('traceData.hookType')(options) || 'internal',\n context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown',\n name = fnToString(registeredHook.callback);\n return event + \" context: \" + context + \", \" + maxLength(200, name);\n };\n TransitionHook.HANDLE_RESULT = function (hook) {\n return function (result) {\n return hook.handleHookResult(result);\n };\n };\n TransitionHook.LOG_REJECTED_RESULT = function (hook) {\n return function (result) {\n isPromise(result) && result.catch(function (err) {\n return hook.logError(Rejection.normalize(err));\n });\n return undefined;\n };\n };\n TransitionHook.LOG_ERROR = function (hook) {\n return function (error) {\n return hook.logError(error);\n };\n };\n TransitionHook.REJECT_ERROR = function (hook) {\n return function (error) {\n return silentRejection(error);\n };\n };\n TransitionHook.THROW_ERROR = function (hook) {\n return function (error) {\n throw error;\n };\n };\n return TransitionHook;\n}();\n\nfunction matchState(state, criterion, transition) {\n var toMatch = isString(criterion) ? [criterion] : criterion;\n function matchGlobs(_state) {\n var globStrings = toMatch;\n for (var i = 0; i < globStrings.length; i++) {\n var glob = new Glob(globStrings[i]);\n if (glob && glob.matches(_state.name) || !glob && globStrings[i] === _state.name) {\n return true;\n }\n }\n return false;\n }\n var matchFn = isFunction(toMatch) ? toMatch : matchGlobs;\n return !!matchFn(state, transition);\n}\nvar RegisteredHook =\nfunction () {\n function RegisteredHook(tranSvc, eventType, callback, matchCriteria, removeHookFromRegistry, options) {\n if (options === void 0) {\n options = {};\n }\n this.tranSvc = tranSvc;\n this.eventType = eventType;\n this.callback = callback;\n this.matchCriteria = matchCriteria;\n this.removeHookFromRegistry = removeHookFromRegistry;\n this.invokeCount = 0;\n this._deregistered = false;\n this.priority = options.priority || 0;\n this.bind = options.bind || null;\n this.invokeLimit = options.invokeLimit;\n }\n RegisteredHook.prototype._matchingNodes = function (nodes, criterion, transition) {\n if (criterion === true) return nodes;\n var matching = nodes.filter(function (node) {\n return matchState(node.state, criterion, transition);\n });\n return matching.length ? matching : null;\n };\n RegisteredHook.prototype._getDefaultMatchCriteria = function () {\n return mapObj(this.tranSvc._pluginapi._getPathTypes(), function () {\n return true;\n });\n };\n RegisteredHook.prototype._getMatchingNodes = function (treeChanges, transition) {\n var _this = this;\n var criteria = extend(this._getDefaultMatchCriteria(), this.matchCriteria);\n var paths = values(this.tranSvc._pluginapi._getPathTypes());\n return paths.reduce(function (mn, pathtype) {\n var isStateHook = pathtype.scope === TransitionHookScope.STATE;\n var path = treeChanges[pathtype.name] || [];\n var nodes = isStateHook ? path : [tail(path)];\n mn[pathtype.name] = _this._matchingNodes(nodes, criteria[pathtype.name], transition);\n return mn;\n }, {});\n };\n RegisteredHook.prototype.matches = function (treeChanges, transition) {\n var matches = this._getMatchingNodes(treeChanges, transition);\n var allMatched = values(matches).every(identity);\n return allMatched ? matches : null;\n };\n RegisteredHook.prototype.deregister = function () {\n this.removeHookFromRegistry(this);\n this._deregistered = true;\n };\n return RegisteredHook;\n}();\nfunction makeEvent(registry, transitionService, eventType) {\n var _registeredHooks = registry._registeredHooks = registry._registeredHooks || {};\n var hooks = _registeredHooks[eventType.name] = [];\n var removeHookFn = removeFrom(hooks);\n registry[eventType.name] = hookRegistrationFn;\n function hookRegistrationFn(matchObject, callback, options) {\n if (options === void 0) {\n options = {};\n }\n var registeredHook = new RegisteredHook(transitionService, eventType, callback, matchObject, removeHookFn, options);\n hooks.push(registeredHook);\n return registeredHook.deregister.bind(registeredHook);\n }\n return hookRegistrationFn;\n}\n\nvar HookBuilder =\nfunction () {\n function HookBuilder(transition) {\n this.transition = transition;\n }\n HookBuilder.prototype.buildHooksForPhase = function (phase) {\n var _this = this;\n var $transitions = this.transition.router.transitionService;\n return $transitions._pluginapi._getEvents(phase).map(function (type) {\n return _this.buildHooks(type);\n }).reduce(unnestR, []).filter(identity);\n };\n HookBuilder.prototype.buildHooks = function (hookType) {\n var transition = this.transition;\n var treeChanges = transition.treeChanges();\n var matchingHooks = this.getMatchingHooks(hookType, treeChanges, transition);\n if (!matchingHooks) return [];\n var baseHookOptions = {\n transition: transition,\n current: transition.options().current\n };\n var makeTransitionHooks = function (hook) {\n var matches = hook.matches(treeChanges, transition);\n var matchingNodes = matches[hookType.criteriaMatchPath.name];\n return matchingNodes.map(function (node) {\n var _options = extend({\n bind: hook.bind,\n traceData: {\n hookType: hookType.name,\n context: node\n }\n }, baseHookOptions);\n var state = hookType.criteriaMatchPath.scope === TransitionHookScope.STATE ? node.state.self : null;\n var transitionHook = new TransitionHook(transition, state, hook, _options);\n return {\n hook: hook,\n node: node,\n transitionHook: transitionHook\n };\n });\n };\n return matchingHooks.map(makeTransitionHooks).reduce(unnestR, []).sort(tupleSort(hookType.reverseSort)).map(function (tuple) {\n return tuple.transitionHook;\n });\n };\n HookBuilder.prototype.getMatchingHooks = function (hookType, treeChanges, transition) {\n var isCreate = hookType.hookPhase === TransitionHookPhase.CREATE;\n var $transitions = this.transition.router.transitionService;\n var registries = isCreate ? [$transitions] : [this.transition, $transitions];\n return registries.map(function (reg) {\n return reg.getHooks(hookType.name);\n })\n .filter(assertPredicate(isArray, \"broken event named: \" + hookType.name))\n .reduce(unnestR, [])\n .filter(function (hook) {\n return hook.matches(treeChanges, transition);\n });\n };\n return HookBuilder;\n}();\nfunction tupleSort(reverseDepthSort) {\n if (reverseDepthSort === void 0) {\n reverseDepthSort = false;\n }\n return function nodeDepthThenPriority(l, r) {\n var factor = reverseDepthSort ? -1 : 1;\n var depthDelta = (l.node.state.path.length - r.node.state.path.length) * factor;\n return depthDelta !== 0 ? depthDelta : r.hook.priority - l.hook.priority;\n };\n}\n\nvar stateSelf = prop('self');\nvar Transition =\nfunction () {\n function Transition(fromPath, targetState, router) {\n var _this = this;\n this._deferred = services.$q.defer();\n this.promise = this._deferred.promise;\n this._registeredHooks = {};\n this._hookBuilder = new HookBuilder(this);\n this.isActive = function () {\n return _this.router.globals.transition === _this;\n };\n this.router = router;\n this._targetState = targetState;\n if (!targetState.valid()) {\n throw new Error(targetState.error());\n }\n this._options = extend({\n current: val(this)\n }, targetState.options());\n this.$id = router.transitionService._transitionCount++;\n var toPath = PathUtils.buildToPath(fromPath, targetState);\n this._treeChanges = PathUtils.treeChanges(fromPath, toPath, this._options.reloadState);\n this.createTransitionHookRegFns();\n var onCreateHooks = this._hookBuilder.buildHooksForPhase(TransitionHookPhase.CREATE);\n TransitionHook.invokeHooks(onCreateHooks, function () {\n return null;\n });\n this.applyViewConfigs(router);\n }\n Transition.prototype.onBefore = function (criteria, callback, options) {\n return;\n };\n Transition.prototype.onStart = function (criteria, callback, options) {\n return;\n };\n Transition.prototype.onExit = function (criteria, callback, options) {\n return;\n };\n Transition.prototype.onRetain = function (criteria, callback, options) {\n return;\n };\n Transition.prototype.onEnter = function (criteria, callback, options) {\n return;\n };\n Transition.prototype.onFinish = function (criteria, callback, options) {\n return;\n };\n Transition.prototype.onSuccess = function (criteria, callback, options) {\n return;\n };\n Transition.prototype.onError = function (criteria, callback, options) {\n return;\n };\n Transition.prototype.createTransitionHookRegFns = function () {\n var _this = this;\n this.router.transitionService._pluginapi._getEvents().filter(function (type) {\n return type.hookPhase !== TransitionHookPhase.CREATE;\n }).forEach(function (type) {\n return makeEvent(_this, _this.router.transitionService, type);\n });\n };\n Transition.prototype.getHooks = function (hookName) {\n return this._registeredHooks[hookName];\n };\n Transition.prototype.applyViewConfigs = function (router) {\n var enteringStates = this._treeChanges.entering.map(function (node) {\n return node.state;\n });\n PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates);\n };\n Transition.prototype.$from = function () {\n return tail(this._treeChanges.from).state;\n };\n Transition.prototype.$to = function () {\n return tail(this._treeChanges.to).state;\n };\n Transition.prototype.from = function () {\n return this.$from().self;\n };\n Transition.prototype.to = function () {\n return this.$to().self;\n };\n Transition.prototype.targetState = function () {\n return this._targetState;\n };\n Transition.prototype.is = function (compare) {\n if (compare instanceof Transition) {\n return this.is({\n to: compare.$to().name,\n from: compare.$from().name\n });\n }\n return !(compare.to && !matchState(this.$to(), compare.to, this) || compare.from && !matchState(this.$from(), compare.from, this));\n };\n Transition.prototype.params = function (pathname) {\n if (pathname === void 0) {\n pathname = 'to';\n }\n return Object.freeze(this._treeChanges[pathname].map(prop('paramValues')).reduce(mergeR, {}));\n };\n Transition.prototype.paramsChanged = function () {\n var fromParams = this.params('from');\n var toParams = this.params('to');\n var allParamDescriptors = [].concat(this._treeChanges.to).concat(this._treeChanges.from).map(function (pathNode) {\n return pathNode.paramSchema;\n }).reduce(flattenR, []).reduce(uniqR, []);\n var changedParamDescriptors = Param.changed(allParamDescriptors, fromParams, toParams);\n return changedParamDescriptors.reduce(function (changedValues, descriptor) {\n changedValues[descriptor.id] = toParams[descriptor.id];\n return changedValues;\n }, {});\n };\n Transition.prototype.injector = function (state, pathName) {\n if (pathName === void 0) {\n pathName = 'to';\n }\n var path = this._treeChanges[pathName];\n if (state) path = PathUtils.subPath(path, function (node) {\n return node.state === state || node.state.name === state;\n });\n return new ResolveContext(path).injector();\n };\n Transition.prototype.getResolveTokens = function (pathname) {\n if (pathname === void 0) {\n pathname = 'to';\n }\n return new ResolveContext(this._treeChanges[pathname]).getTokens();\n };\n Transition.prototype.addResolvable = function (resolvable, state) {\n if (state === void 0) {\n state = '';\n }\n resolvable = is(Resolvable)(resolvable) ? resolvable : new Resolvable(resolvable);\n var stateName = typeof state === 'string' ? state : state.name;\n var topath = this._treeChanges.to;\n var targetNode = find(topath, function (node) {\n return node.state.name === stateName;\n });\n var resolveContext = new ResolveContext(topath);\n resolveContext.addResolvables([resolvable], targetNode.state);\n };\n Transition.prototype.redirectedFrom = function () {\n return this._options.redirectedFrom || null;\n };\n Transition.prototype.originalTransition = function () {\n var rf = this.redirectedFrom();\n return rf && rf.originalTransition() || this;\n };\n Transition.prototype.options = function () {\n return this._options;\n };\n Transition.prototype.entering = function () {\n return map(this._treeChanges.entering, prop('state')).map(stateSelf);\n };\n Transition.prototype.exiting = function () {\n return map(this._treeChanges.exiting, prop('state')).map(stateSelf).reverse();\n };\n Transition.prototype.retained = function () {\n return map(this._treeChanges.retained, prop('state')).map(stateSelf);\n };\n Transition.prototype.views = function (pathname, state) {\n if (pathname === void 0) {\n pathname = 'entering';\n }\n var path = this._treeChanges[pathname];\n path = !state ? path : path.filter(propEq('state', state));\n return path.map(prop('views')).filter(identity).reduce(unnestR, []);\n };\n Transition.prototype.treeChanges = function (pathname) {\n return pathname ? this._treeChanges[pathname] : this._treeChanges;\n };\n Transition.prototype.redirect = function (targetState) {\n var redirects = 1,\n trans = this;\n while ((trans = trans.redirectedFrom()) != null) {\n if (++redirects > 20) throw new Error(\"Too many consecutive Transition redirects (20+)\");\n }\n var redirectOpts = {\n redirectedFrom: this,\n source: 'redirect'\n };\n if (this.options().source === 'url' && targetState.options().location !== false) {\n redirectOpts.location = 'replace';\n }\n var newOptions = extend({}, this.options(), targetState.options(), redirectOpts);\n targetState = targetState.withOptions(newOptions, true);\n var newTransition = this.router.transitionService.create(this._treeChanges.from, targetState);\n var originalEnteringNodes = this._treeChanges.entering;\n var redirectEnteringNodes = newTransition._treeChanges.entering;\n var nodeIsReloading = function (reloadState) {\n return function (node) {\n return reloadState && node.state.includes[reloadState.name];\n };\n };\n var matchingEnteringNodes = PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, PathUtils.nonDynamicParams).filter(not(nodeIsReloading(targetState.options().reloadState)));\n matchingEnteringNodes.forEach(function (node, idx) {\n node.resolvables = originalEnteringNodes[idx].resolvables;\n });\n return newTransition;\n };\n Transition.prototype._changedParams = function () {\n var tc = this._treeChanges;\n if (this._options.reload) return undefined;\n if (tc.exiting.length || tc.entering.length) return undefined;\n if (tc.to.length !== tc.from.length) return undefined;\n var pathsDiffer = arrayTuples(tc.to, tc.from).map(function (tuple) {\n return tuple[0].state !== tuple[1].state;\n }).reduce(anyTrueR, false);\n if (pathsDiffer) return undefined;\n var nodeSchemas = tc.to.map(function (node) {\n return node.paramSchema;\n });\n var _a = [tc.to, tc.from].map(function (path) {\n return path.map(function (x) {\n return x.paramValues;\n });\n }),\n toValues = _a[0],\n fromValues = _a[1];\n var tuples = arrayTuples(nodeSchemas, toValues, fromValues);\n return tuples.map(function (_a) {\n var schema = _a[0],\n toVals = _a[1],\n fromVals = _a[2];\n return Param.changed(schema, toVals, fromVals);\n }).reduce(unnestR, []);\n };\n Transition.prototype.dynamic = function () {\n var changes = this._changedParams();\n return !changes ? false : changes.map(function (x) {\n return x.dynamic;\n }).reduce(anyTrueR, false);\n };\n Transition.prototype.ignored = function () {\n return !!this._ignoredReason();\n };\n Transition.prototype._ignoredReason = function () {\n var pending = this.router.globals.transition;\n var reloadState = this._options.reloadState;\n var same = function (pathA, pathB) {\n if (pathA.length !== pathB.length) return false;\n var matching = PathUtils.matching(pathA, pathB);\n return pathA.length === matching.filter(function (node) {\n return !reloadState || !node.state.includes[reloadState.name];\n }).length;\n };\n var newTC = this.treeChanges();\n var pendTC = pending && pending.treeChanges();\n if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting)) return 'SameAsPending';\n if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to)) return 'SameAsCurrent';\n };\n Transition.prototype.run = function () {\n var _this = this;\n var runAllHooks = TransitionHook.runAllHooks;\n var getHooksFor = function (phase) {\n return _this._hookBuilder.buildHooksForPhase(phase);\n };\n var transitionSuccess = function () {\n trace.traceSuccess(_this.$to(), _this);\n _this.success = true;\n _this._deferred.resolve(_this.to());\n runAllHooks(getHooksFor(TransitionHookPhase.SUCCESS));\n };\n var transitionError = function (reason) {\n trace.traceError(reason, _this);\n _this.success = false;\n _this._deferred.reject(reason);\n _this._error = reason;\n runAllHooks(getHooksFor(TransitionHookPhase.ERROR));\n };\n var runTransition = function () {\n var allRunHooks = getHooksFor(TransitionHookPhase.RUN);\n var done = function () {\n return services.$q.when(undefined);\n };\n return TransitionHook.invokeHooks(allRunHooks, done);\n };\n var startTransition = function () {\n var globals = _this.router.globals;\n globals.lastStartedTransitionId = _this.$id;\n globals.transition = _this;\n globals.transitionHistory.enqueue(_this);\n trace.traceTransitionStart(_this);\n return services.$q.when(undefined);\n };\n var allBeforeHooks = getHooksFor(TransitionHookPhase.BEFORE);\n TransitionHook.invokeHooks(allBeforeHooks, startTransition).then(runTransition).then(transitionSuccess, transitionError);\n return this.promise;\n };\n Transition.prototype.valid = function () {\n return !this.error() || this.success !== undefined;\n };\n Transition.prototype.abort = function () {\n if (isUndefined(this.success)) {\n this._aborted = true;\n }\n };\n Transition.prototype.error = function () {\n var state = this.$to();\n if (state.self.abstract) {\n return Rejection.invalid(\"Cannot transition to abstract state '\" + state.name + \"'\");\n }\n var paramDefs = state.parameters();\n var values = this.params();\n var invalidParams = paramDefs.filter(function (param) {\n return !param.validates(values[param.id]);\n });\n if (invalidParams.length) {\n var invalidValues = invalidParams.map(function (param) {\n return \"[\" + param.id + \":\" + stringify(values[param.id]) + \"]\";\n }).join(', ');\n var detail = \"The following parameter values are not valid for state '\" + state.name + \"': \" + invalidValues;\n return Rejection.invalid(detail);\n }\n if (this.success === false) return this._error;\n };\n Transition.prototype.toString = function () {\n var fromStateOrName = this.from();\n var toStateOrName = this.to();\n var avoidEmptyHash = function (params) {\n return params['#'] !== null && params['#'] !== undefined ? params : omit(params, ['#']);\n };\n var id = this.$id,\n from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName,\n fromParams = stringify(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))),\n toValid = this.valid() ? '' : '(X) ',\n to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName,\n toParams = stringify(avoidEmptyHash(this.params()));\n return \"Transition#\" + id + \"( '\" + from + \"'\" + fromParams + \" -> \" + toValid + \"'\" + to + \"'\" + toParams + \" )\";\n };\n Transition.diToken = Transition;\n return Transition;\n}();\n\nfunction quoteRegExp(str, param) {\n var surroundPattern = ['', ''],\n result = str.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, '\\\\$&');\n if (!param) return result;\n switch (param.squash) {\n case false:\n surroundPattern = ['(', ')' + (param.isOptional ? '?' : '')];\n break;\n case true:\n result = result.replace(/\\/$/, '');\n surroundPattern = ['(?:/(', ')|/)?'];\n break;\n default:\n surroundPattern = [\"(\" + param.squash + \"|\", ')?'];\n break;\n }\n return result + surroundPattern[0] + param.type.pattern.source + surroundPattern[1];\n}\nvar memoizeTo = function (obj, _prop, fn) {\n return obj[_prop] = obj[_prop] || fn();\n};\nvar splitOnSlash = splitOnDelim('/');\nvar defaultConfig = {\n state: {\n params: {}\n },\n strict: true,\n caseInsensitive: true\n};\nvar UrlMatcher =\nfunction () {\n function UrlMatcher(pattern, paramTypes, paramFactory, config) {\n var _this = this;\n this._cache = {\n path: [this]\n };\n this._children = [];\n this._params = [];\n this._segments = [];\n this._compiled = [];\n this.config = config = defaults(config, defaultConfig);\n this.pattern = pattern;\n var placeholder = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\n var searchPlaceholder = /([:]?)([\\w\\[\\].-]+)|\\{([\\w\\[\\].-]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\n var patterns = [];\n var last = 0;\n var matchArray;\n var checkParamErrors = function (id) {\n if (!UrlMatcher.nameValidator.test(id)) throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n if (find(_this._params, propEq('id', id))) throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n };\n var matchDetails = function (m, isSearch) {\n var id = m[2] || m[3];\n var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '[\\\\s\\\\S]*' : null);\n var makeRegexpType = function (str) {\n return inherit(paramTypes.type(isSearch ? 'query' : 'path'), {\n pattern: new RegExp(str, _this.config.caseInsensitive ? 'i' : undefined)\n });\n };\n return {\n id: id,\n regexp: regexp,\n segment: pattern.substring(last, m.index),\n type: !regexp ? null : paramTypes.type(regexp) || makeRegexpType(regexp)\n };\n };\n var details;\n var segment;\n while (matchArray = placeholder.exec(pattern)) {\n details = matchDetails(matchArray, false);\n if (details.segment.indexOf('?') >= 0) break;\n checkParamErrors(details.id);\n this._params.push(paramFactory.fromPath(details.id, details.type, config.state));\n this._segments.push(details.segment);\n patterns.push([details.segment, tail(this._params)]);\n last = placeholder.lastIndex;\n }\n segment = pattern.substring(last);\n var i = segment.indexOf('?');\n if (i >= 0) {\n var search = segment.substring(i);\n segment = segment.substring(0, i);\n if (search.length > 0) {\n last = 0;\n while (matchArray = searchPlaceholder.exec(search)) {\n details = matchDetails(matchArray, true);\n checkParamErrors(details.id);\n this._params.push(paramFactory.fromSearch(details.id, details.type, config.state));\n last = placeholder.lastIndex;\n }\n }\n }\n this._segments.push(segment);\n this._compiled = patterns.map(function (_pattern) {\n return quoteRegExp.apply(null, _pattern);\n }).concat(quoteRegExp(segment));\n }\n UrlMatcher.encodeDashes = function (str) {\n return encodeURIComponent(str).replace(/-/g, function (c) {\n return \"%5C%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n };\n UrlMatcher.pathSegmentsAndParams = function (matcher) {\n var staticSegments = matcher._segments;\n var pathParams = matcher._params.filter(function (p) {\n return p.location === DefType.PATH;\n });\n return arrayTuples(staticSegments, pathParams.concat(undefined)).reduce(unnestR, []).filter(function (x) {\n return x !== '' && isDefined(x);\n });\n };\n UrlMatcher.queryParams = function (matcher) {\n return matcher._params.filter(function (p) {\n return p.location === DefType.SEARCH;\n });\n };\n UrlMatcher.compare = function (a, b) {\n var segments = function (matcher) {\n return matcher._cache.segments = matcher._cache.segments || matcher._cache.path.map(UrlMatcher.pathSegmentsAndParams).reduce(unnestR, []).reduce(joinNeighborsR, []).map(function (x) {\n return isString(x) ? splitOnSlash(x) : x;\n }).reduce(unnestR, []);\n };\n var weights = function (matcher) {\n return matcher._cache.weights = matcher._cache.weights || segments(matcher).map(function (segment) {\n if (segment === '/') return 1;\n if (isString(segment)) return 2;\n if (segment instanceof Param) return 3;\n });\n };\n var padArrays = function (l, r, padVal) {\n var len = Math.max(l.length, r.length);\n while (l.length < len) l.push(padVal);\n while (r.length < len) r.push(padVal);\n };\n var weightsA = weights(a),\n weightsB = weights(b);\n padArrays(weightsA, weightsB, 0);\n var _pairs = arrayTuples(weightsA, weightsB);\n var cmp, i;\n for (i = 0; i < _pairs.length; i++) {\n cmp = _pairs[i][0] - _pairs[i][1];\n if (cmp !== 0) return cmp;\n }\n return 0;\n };\n UrlMatcher.prototype.append = function (url) {\n this._children.push(url);\n url._cache = {\n path: this._cache.path.concat(url),\n parent: this,\n pattern: null\n };\n return url;\n };\n UrlMatcher.prototype.isRoot = function () {\n return this._cache.path[0] === this;\n };\n UrlMatcher.prototype.toString = function () {\n return this.pattern;\n };\n UrlMatcher.prototype.exec = function (path, search, hash, options) {\n var _this = this;\n if (search === void 0) {\n search = {};\n }\n var match = memoizeTo(this._cache, 'pattern', function () {\n return new RegExp(['^', unnest(_this._cache.path.map(prop('_compiled'))).join(''), _this.config.strict === false ? '/?' : '', '$'].join(''), _this.config.caseInsensitive ? 'i' : undefined);\n }).exec(path);\n if (!match) return null;\n var allParams = this.parameters(),\n pathParams = allParams.filter(function (param) {\n return !param.isSearch();\n }),\n searchParams = allParams.filter(function (param) {\n return param.isSearch();\n }),\n nPathSegments = this._cache.path.map(function (urlm) {\n return urlm._segments.length - 1;\n }).reduce(function (a, x) {\n return a + x;\n }),\n values = {};\n if (nPathSegments !== match.length - 1) throw new Error(\"Unbalanced capture group in route '\" + this.pattern + \"'\");\n function decodePathArray(paramVal) {\n var reverseString = function (str) {\n return str.split('').reverse().join('');\n };\n var unquoteDashes = function (str) {\n return str.replace(/\\\\-/g, '-');\n };\n var split = reverseString(paramVal).split(/-(?!\\\\)/);\n var allReversed = map(split, reverseString);\n return map(allReversed, unquoteDashes).reverse();\n }\n for (var i = 0; i < nPathSegments; i++) {\n var param = pathParams[i];\n var value = match[i + 1];\n for (var j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === value) value = param.replace[j].to;\n }\n if (value && param.array === true) value = decodePathArray(value);\n if (isDefined(value)) value = param.type.decode(value);\n values[param.id] = param.value(value);\n }\n searchParams.forEach(function (param) {\n var value = search[param.id];\n for (var j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === value) value = param.replace[j].to;\n }\n if (isDefined(value)) value = param.type.decode(value);\n values[param.id] = param.value(value);\n });\n if (hash) values['#'] = hash;\n return values;\n };\n UrlMatcher.prototype.parameters = function (opts) {\n if (opts === void 0) {\n opts = {};\n }\n if (opts.inherit === false) return this._params;\n return unnest(this._cache.path.map(function (matcher) {\n return matcher._params;\n }));\n };\n UrlMatcher.prototype.parameter = function (id, opts) {\n var _this = this;\n if (opts === void 0) {\n opts = {};\n }\n var findParam = function () {\n for (var _i = 0, _a = _this._params; _i < _a.length; _i++) {\n var param = _a[_i];\n if (param.id === id) return param;\n }\n };\n var parent = this._cache.parent;\n return findParam() || opts.inherit !== false && parent && parent.parameter(id, opts) || null;\n };\n UrlMatcher.prototype.validates = function (params) {\n var validParamVal = function (param, val) {\n return !param || param.validates(val);\n };\n params = params || {};\n var paramSchema = this.parameters().filter(function (paramDef) {\n return params.hasOwnProperty(paramDef.id);\n });\n return paramSchema.map(function (paramDef) {\n return validParamVal(paramDef, params[paramDef.id]);\n }).reduce(allTrueR, true);\n };\n UrlMatcher.prototype.format = function (values) {\n if (values === void 0) {\n values = {};\n }\n var urlMatchers = this._cache.path;\n var pathSegmentsAndParams = urlMatchers.map(UrlMatcher.pathSegmentsAndParams).reduce(unnestR, []).map(function (x) {\n return isString(x) ? x : getDetails(x);\n });\n var queryParams = urlMatchers.map(UrlMatcher.queryParams).reduce(unnestR, []).map(getDetails);\n var isInvalid = function (param) {\n return param.isValid === false;\n };\n if (pathSegmentsAndParams.concat(queryParams).filter(isInvalid).length) {\n return null;\n }\n function getDetails(param) {\n var value = param.value(values[param.id]);\n var isValid = param.validates(value);\n var isDefaultValue = param.isDefaultValue(value);\n var squash = isDefaultValue ? param.squash : false;\n var encoded = param.type.encode(value);\n return {\n param: param,\n value: value,\n isValid: isValid,\n isDefaultValue: isDefaultValue,\n squash: squash,\n encoded: encoded\n };\n }\n var pathString = pathSegmentsAndParams.reduce(function (acc, x) {\n if (isString(x)) return acc + x;\n var squash = x.squash,\n encoded = x.encoded,\n param = x.param;\n if (squash === true) return acc.match(/\\/$/) ? acc.slice(0, -1) : acc;\n if (isString(squash)) return acc + squash;\n if (squash !== false) return acc;\n if (encoded == null) return acc;\n if (isArray(encoded)) return acc + map(encoded, UrlMatcher.encodeDashes).join('-');\n if (param.raw) return acc + encoded;\n return acc + encodeURIComponent(encoded);\n }, '');\n var queryString = queryParams.map(function (paramDetails) {\n var param = paramDetails.param,\n squash = paramDetails.squash,\n encoded = paramDetails.encoded,\n isDefaultValue = paramDetails.isDefaultValue;\n if (encoded == null || isDefaultValue && squash !== false) return;\n if (!isArray(encoded)) encoded = [encoded];\n if (encoded.length === 0) return;\n if (!param.raw) encoded = map(encoded, encodeURIComponent);\n return encoded.map(function (val) {\n return param.id + \"=\" + val;\n });\n }).filter(identity).reduce(unnestR, []).join('&');\n return pathString + (queryString ? \"?\" + queryString : '') + (values['#'] ? '#' + values['#'] : '');\n };\n UrlMatcher.nameValidator = /^\\w+([-.]+\\w+)*(?:\\[\\])?$/;\n return UrlMatcher;\n}();\n\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar ParamFactory =\nfunction () {\n function ParamFactory(router) {\n this.router = router;\n }\n ParamFactory.prototype.fromConfig = function (id, type, state) {\n return new Param(id, type, DefType.CONFIG, this.router.urlService.config, state);\n };\n ParamFactory.prototype.fromPath = function (id, type, state) {\n return new Param(id, type, DefType.PATH, this.router.urlService.config, state);\n };\n ParamFactory.prototype.fromSearch = function (id, type, state) {\n return new Param(id, type, DefType.SEARCH, this.router.urlService.config, state);\n };\n return ParamFactory;\n}();\nvar UrlMatcherFactory =\nfunction () {\n function UrlMatcherFactory(\n router) {\n var _this = this;\n this.router = router;\n this.paramFactory = new ParamFactory(this.router);\n this.caseInsensitive = function (value) {\n return _this.router.urlService.config.caseInsensitive(value);\n };\n this.defaultSquashPolicy = function (value) {\n return _this.router.urlService.config.defaultSquashPolicy(value);\n };\n this.strictMode = function (value) {\n return _this.router.urlService.config.strictMode(value);\n };\n this.type = function (name, definition, definitionFn) {\n return _this.router.urlService.config.type(name, definition, definitionFn) || _this;\n };\n extend(this, {\n UrlMatcher: UrlMatcher,\n Param: Param\n });\n }\n UrlMatcherFactory.prototype.compile = function (pattern, config) {\n var urlConfig = this.router.urlService.config;\n var params = config && !config.state && config.params;\n config = params ? __assign({\n state: {\n params: params\n }\n }, config) : config;\n var globalConfig = {\n strict: urlConfig._isStrictMode,\n caseInsensitive: urlConfig._isCaseInsensitive\n };\n return new UrlMatcher(pattern, urlConfig.paramTypes, this.paramFactory, extend(globalConfig, config));\n };\n UrlMatcherFactory.prototype.isMatcher = function (object) {\n if (!isObject(object)) return false;\n var result = true;\n forEach(UrlMatcher.prototype, function (val, name) {\n if (isFunction(val)) result = result && isDefined(object[name]) && isFunction(object[name]);\n });\n return result;\n };\n UrlMatcherFactory.prototype.$get = function () {\n var urlConfig = this.router.urlService.config;\n urlConfig.paramTypes.enqueue = false;\n urlConfig.paramTypes._flushTypeQueue();\n return this;\n };\n return UrlMatcherFactory;\n}();\n\nvar UrlRuleFactory =\nfunction () {\n function UrlRuleFactory(router) {\n this.router = router;\n }\n UrlRuleFactory.prototype.compile = function (str) {\n return this.router.urlMatcherFactory.compile(str);\n };\n UrlRuleFactory.prototype.create = function (what, handler) {\n var _this = this;\n var isState = StateObject.isState,\n isStateDeclaration = StateObject.isStateDeclaration;\n var makeRule = pattern([[isString, function (_what) {\n return makeRule(_this.compile(_what));\n }], [is(UrlMatcher), function (_what) {\n return _this.fromUrlMatcher(_what, handler);\n }], [or(isState, isStateDeclaration), function (_what) {\n return _this.fromState(_what, _this.router);\n }], [is(RegExp), function (_what) {\n return _this.fromRegExp(_what, handler);\n }], [isFunction, function (_what) {\n return new BaseUrlRule(_what, handler);\n }]]);\n var rule = makeRule(what);\n if (!rule) throw new Error(\"invalid 'what' in when()\");\n return rule;\n };\n UrlRuleFactory.prototype.fromUrlMatcher = function (urlMatcher, handler) {\n var _handler = handler;\n if (isString(handler)) handler = this.router.urlMatcherFactory.compile(handler);\n if (is(UrlMatcher)(handler)) _handler = function (match) {\n return handler.format(match);\n };\n function matchUrlParamters(url) {\n var params = urlMatcher.exec(url.path, url.search, url.hash);\n return urlMatcher.validates(params) && params;\n }\n function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) {\n return param.isOptional;\n });\n if (!optional.length) return 0.000001;\n var matched = optional.filter(function (param) {\n return params[param.id];\n });\n return matched.length / optional.length;\n }\n var details = {\n urlMatcher: urlMatcher,\n matchPriority: matchPriority,\n type: 'URLMATCHER'\n };\n return extend(new BaseUrlRule(matchUrlParamters, _handler), details);\n };\n UrlRuleFactory.prototype.fromState = function (stateOrDecl, router) {\n var state = StateObject.isStateDeclaration(stateOrDecl) ? stateOrDecl.$$state() : stateOrDecl;\n var handler = function (match) {\n var $state = router.stateService;\n var globals = router.globals;\n if ($state.href(state, match) !== $state.href(globals.current, globals.params)) {\n $state.transitionTo(state, match, {\n inherit: true,\n source: 'url'\n });\n }\n };\n var details = {\n state: state,\n type: 'STATE'\n };\n return extend(this.fromUrlMatcher(state.url, handler), details);\n };\n UrlRuleFactory.prototype.fromRegExp = function (regexp, handler) {\n if (regexp.global || regexp.sticky) throw new Error('Rule RegExp must not be global or sticky');\n var redirectUrlTo = function (match) {\n return handler.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n };\n var _handler = isString(handler) ? redirectUrlTo : handler;\n var matchParamsFromRegexp = function (url) {\n return regexp.exec(url.path);\n };\n var details = {\n regexp: regexp,\n type: 'REGEXP'\n };\n return extend(new BaseUrlRule(matchParamsFromRegexp, _handler), details);\n };\n UrlRuleFactory.isUrlRule = function (obj) {\n return obj && ['type', 'match', 'handler'].every(function (key) {\n return isDefined(obj[key]);\n });\n };\n return UrlRuleFactory;\n}();\nvar BaseUrlRule =\nfunction () {\n function BaseUrlRule(match, handler) {\n var _this = this;\n this.match = match;\n this.type = 'RAW';\n this.matchPriority = function (match) {\n return 0 - _this.$id;\n };\n this.handler = handler || identity;\n }\n return BaseUrlRule;\n}();\n\nfunction appendBasePath(url, isHtml5, absolute, baseHref) {\n if (baseHref === '/') return url;\n if (isHtml5) return stripLastPathElement(baseHref) + url;\n if (absolute) return baseHref.slice(1) + url;\n return url;\n}\nvar UrlRouter =\nfunction () {\n function UrlRouter(\n router) {\n var _this = this;\n this.router = router;\n this.sync = function (evt) {\n return _this.router.urlService.sync(evt);\n };\n this.listen = function (enabled) {\n return _this.router.urlService.listen(enabled);\n };\n this.deferIntercept = function (defer) {\n return _this.router.urlService.deferIntercept(defer);\n };\n this.match = function (urlParts) {\n return _this.router.urlService.match(urlParts);\n };\n this.initial = function (handler) {\n return _this.router.urlService.rules.initial(handler);\n };\n this.otherwise = function (handler) {\n return _this.router.urlService.rules.otherwise(handler);\n };\n this.removeRule = function (rule) {\n return _this.router.urlService.rules.removeRule(rule);\n };\n this.rule = function (rule) {\n return _this.router.urlService.rules.rule(rule);\n };\n this.rules = function () {\n return _this.router.urlService.rules.rules();\n };\n this.sort = function (compareFn) {\n return _this.router.urlService.rules.sort(compareFn);\n };\n this.when = function (matcher, handler, options) {\n return _this.router.urlService.rules.when(matcher, handler, options);\n };\n this.urlRuleFactory = new UrlRuleFactory(router);\n }\n UrlRouter.prototype.update = function (read) {\n var $url = this.router.locationService;\n if (read) {\n this.location = $url.url();\n return;\n }\n if ($url.url() === this.location) return;\n $url.url(this.location, true);\n };\n UrlRouter.prototype.push = function (urlMatcher, params, options) {\n var replace = options && !!options.replace;\n this.router.urlService.url(urlMatcher.format(params || {}), replace);\n };\n UrlRouter.prototype.href = function (urlMatcher, params, options) {\n var url = urlMatcher.format(params);\n if (url == null) return null;\n options = options || {\n absolute: false\n };\n var cfg = this.router.urlService.config;\n var isHtml5 = cfg.html5Mode();\n if (!isHtml5 && url !== null) {\n url = '#' + cfg.hashPrefix() + url;\n }\n url = appendBasePath(url, isHtml5, options.absolute, cfg.baseHref());\n if (!options.absolute || !url) {\n return url;\n }\n var slash = !isHtml5 && url ? '/' : '';\n var cfgPort = cfg.port();\n var port = cfgPort === 80 || cfgPort === 443 ? '' : ':' + cfgPort;\n return [cfg.protocol(), '://', cfg.host(), port, slash, url].join('');\n };\n Object.defineProperty(UrlRouter.prototype, \"interceptDeferred\", {\n get: function () {\n return this.router.urlService.interceptDeferred;\n },\n enumerable: true,\n configurable: true\n });\n return UrlRouter;\n}();\n\nvar ViewService =\nfunction () {\n function ViewService(\n router) {\n var _this = this;\n this.router = router;\n this._uiViews = [];\n this._viewConfigs = [];\n this._viewConfigFactories = {};\n this._listeners = [];\n this._pluginapi = {\n _rootViewContext: this._rootViewContext.bind(this),\n _viewConfigFactory: this._viewConfigFactory.bind(this),\n _registeredUIView: function (id) {\n return find(_this._uiViews, function (view) {\n return _this.router.$id + \".\" + view.id === id;\n });\n },\n _registeredUIViews: function () {\n return _this._uiViews;\n },\n _activeViewConfigs: function () {\n return _this._viewConfigs;\n },\n _onSync: function (listener) {\n _this._listeners.push(listener);\n return function () {\n return removeFrom(_this._listeners, listener);\n };\n }\n };\n }\n ViewService.normalizeUIViewTarget = function (context, rawViewName) {\n if (rawViewName === void 0) {\n rawViewName = '';\n }\n var viewAtContext = rawViewName.split('@');\n var uiViewName = viewAtContext[0] || '$default';\n var uiViewContextAnchor = isString(viewAtContext[1]) ? viewAtContext[1] : '^';\n var relativeViewNameSugar = /^(\\^(?:\\.\\^)*)\\.(.*$)/.exec(uiViewName);\n if (relativeViewNameSugar) {\n uiViewContextAnchor = relativeViewNameSugar[1];\n uiViewName = relativeViewNameSugar[2];\n }\n if (uiViewName.charAt(0) === '!') {\n uiViewName = uiViewName.substr(1);\n uiViewContextAnchor = '';\n }\n var relativeMatch = /^(\\^(?:\\.\\^)*)$/;\n if (relativeMatch.exec(uiViewContextAnchor)) {\n var anchorState = uiViewContextAnchor.split('.').reduce(function (anchor, x) {\n return anchor.parent;\n }, context);\n uiViewContextAnchor = anchorState.name;\n } else if (uiViewContextAnchor === '.') {\n uiViewContextAnchor = context.name;\n }\n return {\n uiViewName: uiViewName,\n uiViewContextAnchor: uiViewContextAnchor\n };\n };\n ViewService.prototype._rootViewContext = function (context) {\n return this._rootContext = context || this._rootContext;\n };\n ViewService.prototype._viewConfigFactory = function (viewType, factory) {\n this._viewConfigFactories[viewType] = factory;\n };\n ViewService.prototype.createViewConfig = function (path, decl) {\n var cfgFactory = this._viewConfigFactories[decl.$type];\n if (!cfgFactory) throw new Error('ViewService: No view config factory registered for type ' + decl.$type);\n var cfgs = cfgFactory(path, decl);\n return isArray(cfgs) ? cfgs : [cfgs];\n };\n ViewService.prototype.deactivateViewConfig = function (viewConfig) {\n trace.traceViewServiceEvent('<- Removing', viewConfig);\n removeFrom(this._viewConfigs, viewConfig);\n };\n ViewService.prototype.activateViewConfig = function (viewConfig) {\n trace.traceViewServiceEvent('-> Registering', viewConfig);\n this._viewConfigs.push(viewConfig);\n };\n ViewService.prototype.sync = function () {\n var _this = this;\n var uiViewsByFqn = this._uiViews.map(function (uiv) {\n return [uiv.fqn, uiv];\n }).reduce(applyPairs, {});\n function uiViewDepth(uiView) {\n var stateDepth = function (context) {\n return context && context.parent ? stateDepth(context.parent) + 1 : 1;\n };\n return uiView.fqn.split('.').length * 10000 + stateDepth(uiView.creationContext);\n }\n function viewConfigDepth(config) {\n var context = config.viewDecl.$context,\n count = 0;\n while (++count && context.parent) context = context.parent;\n return count;\n }\n var depthCompare = curry(function (depthFn, posNeg, left, right) {\n return posNeg * (depthFn(left) - depthFn(right));\n });\n var matchingConfigPair = function (uiView) {\n var matchingConfigs = _this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView));\n if (matchingConfigs.length > 1) {\n matchingConfigs.sort(depthCompare(viewConfigDepth, -1));\n }\n return {\n uiView: uiView,\n viewConfig: matchingConfigs[0]\n };\n };\n var configureUIView = function (tuple) {\n if (_this._uiViews.indexOf(tuple.uiView) !== -1) tuple.uiView.configUpdated(tuple.viewConfig);\n };\n var uiViewTuples = this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair);\n var matchedViewConfigs = uiViewTuples.map(function (tuple) {\n return tuple.viewConfig;\n });\n var unmatchedConfigTuples = this._viewConfigs.filter(function (config) {\n return !inArray(matchedViewConfigs, config);\n }).map(function (viewConfig) {\n return {\n uiView: undefined,\n viewConfig: viewConfig\n };\n });\n uiViewTuples.forEach(configureUIView);\n var allTuples = uiViewTuples.concat(unmatchedConfigTuples);\n this._listeners.forEach(function (cb) {\n return cb(allTuples);\n });\n trace.traceViewSync(allTuples);\n };\n ViewService.prototype.registerUIView = function (uiView) {\n trace.traceViewServiceUIViewEvent('-> Registering', uiView);\n var uiViews = this._uiViews;\n var fqnAndTypeMatches = function (uiv) {\n return uiv.fqn === uiView.fqn && uiv.$type === uiView.$type;\n };\n if (uiViews.filter(fqnAndTypeMatches).length) trace.traceViewServiceUIViewEvent('!!!! duplicate uiView named:', uiView);\n uiViews.push(uiView);\n this.sync();\n return function () {\n var idx = uiViews.indexOf(uiView);\n if (idx === -1) {\n trace.traceViewServiceUIViewEvent('Tried removing non-registered uiView', uiView);\n return;\n }\n trace.traceViewServiceUIViewEvent('<- Deregistering', uiView);\n removeFrom(uiViews)(uiView);\n };\n };\n ViewService.prototype.available = function () {\n return this._uiViews.map(prop('fqn'));\n };\n ViewService.prototype.active = function () {\n return this._uiViews.filter(prop('$config')).map(prop('name'));\n };\n ViewService.matches = function (uiViewsByFqn, uiView) {\n return function (viewConfig) {\n if (uiView.$type !== viewConfig.viewDecl.$type) return false;\n var vc = viewConfig.viewDecl;\n var vcSegments = vc.$uiViewName.split('.');\n var uivSegments = uiView.fqn.split('.');\n if (!equals(vcSegments, uivSegments.slice(0 - vcSegments.length))) return false;\n var negOffset = 1 - vcSegments.length || undefined;\n var fqnToFirstSegment = uivSegments.slice(0, negOffset).join('.');\n var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext;\n return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name);\n };\n };\n return ViewService;\n}();\n\nvar UIRouterGlobals =\nfunction () {\n function UIRouterGlobals() {\n this.params = new StateParams();\n this.lastStartedTransitionId = -1;\n this.transitionHistory = new Queue([], 1);\n this.successfulTransitions = new Queue([], 1);\n }\n UIRouterGlobals.prototype.dispose = function () {\n this.transitionHistory.clear();\n this.successfulTransitions.clear();\n this.transition = null;\n };\n return UIRouterGlobals;\n}();\n\nvar prioritySort = function (a, b) {\n return (b.priority || 0) - (a.priority || 0);\n};\nvar typeSort = function (a, b) {\n var weights = {\n STATE: 4,\n URLMATCHER: 4,\n REGEXP: 3,\n RAW: 2,\n OTHER: 1\n };\n return (weights[a.type] || 0) - (weights[b.type] || 0);\n};\nvar urlMatcherSort = function (a, b) {\n return !a.urlMatcher || !b.urlMatcher ? 0 : UrlMatcher.compare(a.urlMatcher, b.urlMatcher);\n};\nvar idSort = function (a, b) {\n var useMatchPriority = {\n STATE: true,\n URLMATCHER: true\n };\n var equal = useMatchPriority[a.type] && useMatchPriority[b.type];\n return equal ? 0 : (a.$id || 0) - (b.$id || 0);\n};\nvar defaultRuleSortFn;\ndefaultRuleSortFn = function (a, b) {\n var cmp = prioritySort(a, b);\n if (cmp !== 0) return cmp;\n cmp = typeSort(a, b);\n if (cmp !== 0) return cmp;\n cmp = urlMatcherSort(a, b);\n if (cmp !== 0) return cmp;\n return idSort(a, b);\n};\nfunction getHandlerFn(handler) {\n if (!isFunction(handler) && !isString(handler) && !is(TargetState)(handler) && !TargetState.isDef(handler)) {\n throw new Error(\"'handler' must be a string, function, TargetState, or have a state: 'newtarget' property\");\n }\n return isFunction(handler) ? handler : val(handler);\n}\nvar UrlRules =\nfunction () {\n function UrlRules(\n router) {\n this.router = router;\n this._sortFn = defaultRuleSortFn;\n this._rules = [];\n this._id = 0;\n this.urlRuleFactory = new UrlRuleFactory(router);\n }\n UrlRules.prototype.dispose = function (router) {\n this._rules = [];\n delete this._otherwiseFn;\n };\n UrlRules.prototype.initial = function (handler) {\n var handlerFn = getHandlerFn(handler);\n var matchFn = function (urlParts, router) {\n return router.globals.transitionHistory.size() === 0 && !!/^\\/?$/.exec(urlParts.path);\n };\n this.rule(this.urlRuleFactory.create(matchFn, handlerFn));\n };\n UrlRules.prototype.otherwise = function (handler) {\n var handlerFn = getHandlerFn(handler);\n this._otherwiseFn = this.urlRuleFactory.create(val(true), handlerFn);\n this._sorted = false;\n };\n UrlRules.prototype.removeRule = function (rule) {\n removeFrom(this._rules, rule);\n };\n UrlRules.prototype.rule = function (rule) {\n var _this = this;\n if (!UrlRuleFactory.isUrlRule(rule)) throw new Error('invalid rule');\n rule.$id = this._id++;\n rule.priority = rule.priority || 0;\n this._rules.push(rule);\n this._sorted = false;\n return function () {\n return _this.removeRule(rule);\n };\n };\n UrlRules.prototype.rules = function () {\n this.ensureSorted();\n return this._rules.concat(this._otherwiseFn ? [this._otherwiseFn] : []);\n };\n UrlRules.prototype.sort = function (compareFn) {\n var sorted = this.stableSort(this._rules, this._sortFn = compareFn || this._sortFn);\n var group = 0;\n for (var i = 0; i < sorted.length; i++) {\n sorted[i]._group = group;\n if (i < sorted.length - 1 && this._sortFn(sorted[i], sorted[i + 1]) !== 0) {\n group++;\n }\n }\n this._rules = sorted;\n this._sorted = true;\n };\n UrlRules.prototype.ensureSorted = function () {\n this._sorted || this.sort();\n };\n UrlRules.prototype.stableSort = function (arr, compareFn) {\n var arrOfWrapper = arr.map(function (elem, idx) {\n return {\n elem: elem,\n idx: idx\n };\n });\n arrOfWrapper.sort(function (wrapperA, wrapperB) {\n var cmpDiff = compareFn(wrapperA.elem, wrapperB.elem);\n return cmpDiff === 0 ? wrapperA.idx - wrapperB.idx : cmpDiff;\n });\n return arrOfWrapper.map(function (wrapper) {\n return wrapper.elem;\n });\n };\n UrlRules.prototype.when = function (matcher, handler, options) {\n var rule = this.urlRuleFactory.create(matcher, handler);\n if (isDefined(options && options.priority)) rule.priority = options.priority;\n this.rule(rule);\n return rule;\n };\n return UrlRules;\n}();\n\nvar UrlConfig =\nfunction () {\n function UrlConfig(\n router) {\n var _this = this;\n this.router = router;\n this.paramTypes = new ParamTypes();\n this._isCaseInsensitive = false;\n this._isStrictMode = true;\n this._defaultSquashPolicy = false;\n this.dispose = function () {\n return _this.paramTypes.dispose();\n };\n this.baseHref = function () {\n return _this.router.locationConfig.baseHref();\n };\n this.hashPrefix = function (newprefix) {\n return _this.router.locationConfig.hashPrefix(newprefix);\n };\n this.host = function () {\n return _this.router.locationConfig.host();\n };\n this.html5Mode = function () {\n return _this.router.locationConfig.html5Mode();\n };\n this.port = function () {\n return _this.router.locationConfig.port();\n };\n this.protocol = function () {\n return _this.router.locationConfig.protocol();\n };\n }\n UrlConfig.prototype.caseInsensitive = function (value) {\n return this._isCaseInsensitive = isDefined(value) ? value : this._isCaseInsensitive;\n };\n UrlConfig.prototype.defaultSquashPolicy = function (value) {\n if (isDefined(value) && value !== true && value !== false && !isString(value)) throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n return this._defaultSquashPolicy = isDefined(value) ? value : this._defaultSquashPolicy;\n };\n UrlConfig.prototype.strictMode = function (value) {\n return this._isStrictMode = isDefined(value) ? value : this._isStrictMode;\n };\n UrlConfig.prototype.type = function (name, definition, definitionFn) {\n var type = this.paramTypes.type(name, definition, definitionFn);\n return !isDefined(definition) ? type : this;\n };\n return UrlConfig;\n}();\n\nvar UrlService =\nfunction () {\n function UrlService(\n router) {\n var _this = this;\n this.router = router;\n this.interceptDeferred = false;\n this.rules = new UrlRules(this.router);\n this.config = new UrlConfig(this.router);\n this.url = function (newurl, replace, state) {\n return _this.router.locationService.url(newurl, replace, state);\n };\n this.path = function () {\n return _this.router.locationService.path();\n };\n this.search = function () {\n return _this.router.locationService.search();\n };\n this.hash = function () {\n return _this.router.locationService.hash();\n };\n this.onChange = function (callback) {\n return _this.router.locationService.onChange(callback);\n };\n }\n UrlService.prototype.dispose = function () {\n this.listen(false);\n this.rules.dispose();\n };\n UrlService.prototype.parts = function () {\n return {\n path: this.path(),\n search: this.search(),\n hash: this.hash()\n };\n };\n UrlService.prototype.sync = function (evt) {\n if (evt && evt.defaultPrevented) return;\n var _a = this.router,\n urlService = _a.urlService,\n stateService = _a.stateService;\n var url = {\n path: urlService.path(),\n search: urlService.search(),\n hash: urlService.hash()\n };\n var best = this.match(url);\n var applyResult = pattern([[isString, function (newurl) {\n return urlService.url(newurl, true);\n }], [TargetState.isDef, function (def) {\n return stateService.go(def.state, def.params, def.options);\n }], [is(TargetState), function (target) {\n return stateService.go(target.state(), target.params(), target.options());\n }]]);\n applyResult(best && best.rule.handler(best.match, url, this.router));\n };\n UrlService.prototype.listen = function (enabled) {\n var _this = this;\n if (enabled === false) {\n this._stopListeningFn && this._stopListeningFn();\n delete this._stopListeningFn;\n } else {\n return this._stopListeningFn = this._stopListeningFn || this.router.urlService.onChange(function (evt) {\n return _this.sync(evt);\n });\n }\n };\n UrlService.prototype.deferIntercept = function (defer) {\n if (defer === undefined) defer = true;\n this.interceptDeferred = defer;\n };\n UrlService.prototype.match = function (url) {\n var _this = this;\n url = extend({\n path: '',\n search: {},\n hash: ''\n }, url);\n var rules = this.rules.rules();\n var checkRule = function (rule) {\n var match = rule.match(url, _this.router);\n return match && {\n match: match,\n rule: rule,\n weight: rule.matchPriority(match)\n };\n };\n var best;\n for (var i = 0; i < rules.length; i++) {\n if (best && best.rule._group !== rules[i]._group) break;\n var current = checkRule(rules[i]);\n best = !best || current && current.weight > best.weight ? current : best;\n }\n return best;\n };\n return UrlService;\n}();\n\nvar _routerInstance = 0;\nvar locSvcFns = ['url', 'path', 'search', 'hash', 'onChange'];\nvar locCfgFns = ['port', 'protocol', 'host', 'baseHref', 'html5Mode', 'hashPrefix'];\nvar locationServiceStub = makeStub('LocationServices', locSvcFns);\nvar locationConfigStub = makeStub('LocationConfig', locCfgFns);\nvar UIRouter =\nfunction () {\n function UIRouter(locationService, locationConfig) {\n if (locationService === void 0) {\n locationService = locationServiceStub;\n }\n if (locationConfig === void 0) {\n locationConfig = locationConfigStub;\n }\n this.locationService = locationService;\n this.locationConfig = locationConfig;\n this.$id = _routerInstance++;\n this._disposed = false;\n this._disposables = [];\n this.trace = trace;\n this.viewService = new ViewService(this);\n this.globals = new UIRouterGlobals();\n this.transitionService = new TransitionService(this);\n this.urlMatcherFactory = new UrlMatcherFactory(this);\n this.urlRouter = new UrlRouter(this);\n this.urlService = new UrlService(this);\n this.stateRegistry = new StateRegistry(this);\n this.stateService = new StateService(this);\n this._plugins = {};\n this.viewService._pluginapi._rootViewContext(this.stateRegistry.root());\n this.globals.$current = this.stateRegistry.root();\n this.globals.current = this.globals.$current.self;\n this.disposable(this.globals);\n this.disposable(this.stateService);\n this.disposable(this.stateRegistry);\n this.disposable(this.transitionService);\n this.disposable(this.urlService);\n this.disposable(locationService);\n this.disposable(locationConfig);\n }\n UIRouter.prototype.disposable = function (disposable) {\n this._disposables.push(disposable);\n };\n UIRouter.prototype.dispose = function (disposable) {\n var _this = this;\n if (disposable && isFunction(disposable.dispose)) {\n disposable.dispose(this);\n return undefined;\n }\n this._disposed = true;\n this._disposables.slice().forEach(function (d) {\n try {\n typeof d.dispose === 'function' && d.dispose(_this);\n removeFrom(_this._disposables, d);\n } catch (ignored) {}\n });\n };\n UIRouter.prototype.plugin = function (plugin, options) {\n if (options === void 0) {\n options = {};\n }\n var pluginInstance = new plugin(this, options);\n if (!pluginInstance.name) throw new Error('Required property `name` missing on plugin: ' + pluginInstance);\n this._disposables.push(pluginInstance);\n return this._plugins[pluginInstance.name] = pluginInstance;\n };\n UIRouter.prototype.getPlugin = function (pluginName) {\n return pluginName ? this._plugins[pluginName] : values(this._plugins);\n };\n return UIRouter;\n}();\n\nfunction addCoreResolvables(trans) {\n trans.addResolvable(Resolvable.fromData(UIRouter, trans.router), '');\n trans.addResolvable(Resolvable.fromData(Transition, trans), '');\n trans.addResolvable(Resolvable.fromData('$transition$', trans), '');\n trans.addResolvable(Resolvable.fromData('$stateParams', trans.params()), '');\n trans.entering().forEach(function (state) {\n trans.addResolvable(Resolvable.fromData('$state$', state), state);\n });\n}\nvar registerAddCoreResolvables = function (transitionService) {\n return transitionService.onCreate({}, addCoreResolvables);\n};\nvar TRANSITION_TOKENS = ['$transition$', Transition];\nvar isTransition = inArray(TRANSITION_TOKENS);\nvar treeChangesCleanup = function (trans) {\n var nodes = values(trans.treeChanges()).reduce(unnestR, []).reduce(uniqR, []);\n var replaceTransitionWithNull = function (r) {\n return isTransition(r.token) ? Resolvable.fromData(r.token, null) : r;\n };\n nodes.forEach(function (node) {\n node.resolvables = node.resolvables.map(replaceTransitionWithNull);\n });\n};\n\nvar redirectToHook = function (trans) {\n var redirect = trans.to().redirectTo;\n if (!redirect) return;\n var $state = trans.router.stateService;\n function handleResult(result) {\n if (!result) return;\n if (result instanceof TargetState) return result;\n if (isString(result)) return $state.target(result, trans.params(), trans.options());\n if (result['state'] || result['params']) return $state.target(result['state'] || trans.to(), result['params'] || trans.params(), trans.options());\n }\n if (isFunction(redirect)) {\n return services.$q.when(redirect(trans)).then(handleResult);\n }\n return handleResult(redirect);\n};\nvar registerRedirectToHook = function (transitionService) {\n return transitionService.onStart({\n to: function (state) {\n return !!state.redirectTo;\n }\n }, redirectToHook);\n};\n\nfunction makeEnterExitRetainHook(hookName) {\n return function (transition, state) {\n var _state = state.$$state();\n var hookFn = _state[hookName];\n return hookFn(transition, state);\n };\n}\nvar onExitHook = makeEnterExitRetainHook('onExit');\nvar registerOnExitHook = function (transitionService) {\n return transitionService.onExit({\n exiting: function (state) {\n return !!state.onExit;\n }\n }, onExitHook);\n};\nvar onRetainHook = makeEnterExitRetainHook('onRetain');\nvar registerOnRetainHook = function (transitionService) {\n return transitionService.onRetain({\n retained: function (state) {\n return !!state.onRetain;\n }\n }, onRetainHook);\n};\nvar onEnterHook = makeEnterExitRetainHook('onEnter');\nvar registerOnEnterHook = function (transitionService) {\n return transitionService.onEnter({\n entering: function (state) {\n return !!state.onEnter;\n }\n }, onEnterHook);\n};\n\nvar RESOLVE_HOOK_PRIORITY = 1000;\nvar eagerResolvePath = function (trans) {\n return new ResolveContext(trans.treeChanges().to).resolvePath('EAGER', trans).then(noop);\n};\nvar registerEagerResolvePath = function (transitionService) {\n return transitionService.onStart({}, eagerResolvePath, {\n priority: RESOLVE_HOOK_PRIORITY\n });\n};\nvar lazyResolveState = function (trans, state) {\n return new ResolveContext(trans.treeChanges().to).subContext(state.$$state()).resolvePath('LAZY', trans).then(noop);\n};\nvar registerLazyResolveState = function (transitionService) {\n return transitionService.onEnter({\n entering: val(true)\n }, lazyResolveState, {\n priority: RESOLVE_HOOK_PRIORITY\n });\n};\nvar resolveRemaining = function (trans) {\n return new ResolveContext(trans.treeChanges().to).resolvePath('LAZY', trans).then(noop);\n};\nvar registerResolveRemaining = function (transitionService) {\n return transitionService.onFinish({}, resolveRemaining, {\n priority: RESOLVE_HOOK_PRIORITY\n });\n};\n\nvar loadEnteringViews = function (transition) {\n var $q = services.$q;\n var enteringViews = transition.views('entering');\n if (!enteringViews.length) return;\n return $q.all(enteringViews.map(function (view) {\n return $q.when(view.load());\n })).then(noop);\n};\nvar registerLoadEnteringViews = function (transitionService) {\n return transitionService.onFinish({}, loadEnteringViews);\n};\nvar activateViews = function (transition) {\n var enteringViews = transition.views('entering');\n var exitingViews = transition.views('exiting');\n if (!enteringViews.length && !exitingViews.length) return;\n var $view = transition.router.viewService;\n exitingViews.forEach(function (vc) {\n return $view.deactivateViewConfig(vc);\n });\n enteringViews.forEach(function (vc) {\n return $view.activateViewConfig(vc);\n });\n $view.sync();\n};\nvar registerActivateViews = function (transitionService) {\n return transitionService.onSuccess({}, activateViews);\n};\n\nvar updateGlobalState = function (trans) {\n var globals = trans.router.globals;\n var transitionSuccessful = function () {\n globals.successfulTransitions.enqueue(trans);\n globals.$current = trans.$to();\n globals.current = globals.$current.self;\n copy(trans.params(), globals.params);\n };\n var clearCurrentTransition = function () {\n if (globals.transition === trans) globals.transition = null;\n };\n trans.onSuccess({}, transitionSuccessful, {\n priority: 10000\n });\n trans.promise.then(clearCurrentTransition, clearCurrentTransition);\n};\nvar registerUpdateGlobalState = function (transitionService) {\n return transitionService.onCreate({}, updateGlobalState);\n};\n\nvar updateUrl = function (transition) {\n var options = transition.options();\n var $state = transition.router.stateService;\n var $urlRouter = transition.router.urlRouter;\n if (options.source !== 'url' && options.location && $state.$current.navigable) {\n var urlOptions = {\n replace: options.location === 'replace'\n };\n $urlRouter.push($state.$current.navigable.url, $state.params, urlOptions);\n }\n $urlRouter.update(true);\n};\nvar registerUpdateUrl = function (transitionService) {\n return transitionService.onSuccess({}, updateUrl, {\n priority: 9999\n });\n};\n\nvar lazyLoadHook = function (transition) {\n var router = transition.router;\n function retryTransition() {\n if (transition.originalTransition().options().source !== 'url') {\n var orig = transition.targetState();\n return router.stateService.target(orig.identifier(), orig.params(), orig.options());\n }\n var $url = router.urlService;\n var result = $url.match($url.parts());\n var rule = result && result.rule;\n if (rule && rule.type === 'STATE') {\n var state = rule.state;\n var params = result.match;\n return router.stateService.target(state, params, transition.options());\n }\n router.urlService.sync();\n }\n var promises = transition.entering().filter(function (state) {\n return !!state.$$state().lazyLoad;\n }).map(function (state) {\n return lazyLoadState(transition, state);\n });\n return services.$q.all(promises).then(retryTransition);\n};\nvar registerLazyLoadHook = function (transitionService) {\n return transitionService.onBefore({\n entering: function (state) {\n return !!state.lazyLoad;\n }\n }, lazyLoadHook);\n};\nfunction lazyLoadState(transition, state) {\n var lazyLoadFn = state.$$state().lazyLoad;\n var promise = lazyLoadFn['_promise'];\n if (!promise) {\n var success = function (result) {\n delete state.lazyLoad;\n delete state.$$state().lazyLoad;\n delete lazyLoadFn['_promise'];\n return result;\n };\n var error = function (err) {\n delete lazyLoadFn['_promise'];\n return services.$q.reject(err);\n };\n promise = lazyLoadFn['_promise'] = services.$q.when(lazyLoadFn(transition, state)).then(updateStateRegistry).then(success, error);\n }\n function updateStateRegistry(result) {\n if (result && Array.isArray(result.states)) {\n result.states.forEach(function (_state) {\n return transition.router.stateRegistry.register(_state);\n });\n }\n return result;\n }\n return promise;\n}\n\nvar TransitionEventType =\nfunction () {\n function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {\n if (reverseSort === void 0) {\n reverseSort = false;\n }\n if (getResultHandler === void 0) {\n getResultHandler = TransitionHook.HANDLE_RESULT;\n }\n if (getErrorHandler === void 0) {\n getErrorHandler = TransitionHook.REJECT_ERROR;\n }\n if (synchronous === void 0) {\n synchronous = false;\n }\n this.name = name;\n this.hookPhase = hookPhase;\n this.hookOrder = hookOrder;\n this.criteriaMatchPath = criteriaMatchPath;\n this.reverseSort = reverseSort;\n this.getResultHandler = getResultHandler;\n this.getErrorHandler = getErrorHandler;\n this.synchronous = synchronous;\n }\n return TransitionEventType;\n}();\n\nfunction ignoredHook(trans) {\n var ignoredReason = trans._ignoredReason();\n if (!ignoredReason) return;\n trace.traceTransitionIgnored(trans);\n var pending = trans.router.globals.transition;\n if (ignoredReason === 'SameAsCurrent' && pending) {\n pending.abort();\n }\n return Rejection.ignored().toPromise();\n}\nvar registerIgnoredTransitionHook = function (transitionService) {\n return transitionService.onBefore({}, ignoredHook, {\n priority: -9999\n });\n};\n\nfunction invalidTransitionHook(trans) {\n if (!trans.valid()) {\n throw new Error(trans.error().toString());\n }\n}\nvar registerInvalidTransitionHook = function (transitionService) {\n return transitionService.onBefore({}, invalidTransitionHook, {\n priority: -10000\n });\n};\n\nvar defaultTransOpts = {\n location: true,\n relative: null,\n inherit: false,\n notify: true,\n reload: false,\n supercede: true,\n custom: {},\n current: function () {\n return null;\n },\n source: 'unknown'\n};\nvar TransitionService =\nfunction () {\n function TransitionService(_router) {\n this._transitionCount = 0;\n this._eventTypes = [];\n this._registeredHooks = {};\n this._criteriaPaths = {};\n this._router = _router;\n this.$view = _router.viewService;\n this._deregisterHookFns = {};\n this._pluginapi = createProxyFunctions(val(this), {}, val(this), ['_definePathType', '_defineEvent', '_getPathTypes', '_getEvents', 'getHooks']);\n this._defineCorePaths();\n this._defineCoreEvents();\n this._registerCoreTransitionHooks();\n _router.globals.successfulTransitions.onEvict(treeChangesCleanup);\n }\n TransitionService.prototype.onCreate = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.onBefore = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.onStart = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.onExit = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.onRetain = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.onEnter = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.onFinish = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.onSuccess = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.onError = function (criteria, callback, options) {\n return;\n };\n TransitionService.prototype.dispose = function (router) {\n values(this._registeredHooks).forEach(function (hooksArray) {\n return hooksArray.forEach(function (hook) {\n hook._deregistered = true;\n removeFrom(hooksArray, hook);\n });\n });\n };\n TransitionService.prototype.create = function (fromPath, targetState) {\n return new Transition(fromPath, targetState, this._router);\n };\n TransitionService.prototype._defineCoreEvents = function () {\n var Phase = TransitionHookPhase;\n var TH = TransitionHook;\n var paths = this._criteriaPaths;\n var NORMAL_SORT = false,\n REVERSE_SORT = true;\n var SYNCHRONOUS = true;\n this._defineEvent('onCreate', Phase.CREATE, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.THROW_ERROR, SYNCHRONOUS);\n this._defineEvent('onBefore', Phase.BEFORE, 0, paths.to);\n this._defineEvent('onStart', Phase.RUN, 0, paths.to);\n this._defineEvent('onExit', Phase.RUN, 100, paths.exiting, REVERSE_SORT);\n this._defineEvent('onRetain', Phase.RUN, 200, paths.retained);\n this._defineEvent('onEnter', Phase.RUN, 300, paths.entering);\n this._defineEvent('onFinish', Phase.RUN, 400, paths.to);\n this._defineEvent('onSuccess', Phase.SUCCESS, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);\n this._defineEvent('onError', Phase.ERROR, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);\n };\n TransitionService.prototype._defineCorePaths = function () {\n var STATE = TransitionHookScope.STATE,\n TRANSITION = TransitionHookScope.TRANSITION;\n this._definePathType('to', TRANSITION);\n this._definePathType('from', TRANSITION);\n this._definePathType('exiting', STATE);\n this._definePathType('retained', STATE);\n this._definePathType('entering', STATE);\n };\n TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {\n if (reverseSort === void 0) {\n reverseSort = false;\n }\n if (getResultHandler === void 0) {\n getResultHandler = TransitionHook.HANDLE_RESULT;\n }\n if (getErrorHandler === void 0) {\n getErrorHandler = TransitionHook.REJECT_ERROR;\n }\n if (synchronous === void 0) {\n synchronous = false;\n }\n var eventType = new TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous);\n this._eventTypes.push(eventType);\n makeEvent(this, this, eventType);\n };\n TransitionService.prototype._getEvents = function (phase) {\n var transitionHookTypes = isDefined(phase) ? this._eventTypes.filter(function (type) {\n return type.hookPhase === phase;\n }) : this._eventTypes.slice();\n return transitionHookTypes.sort(function (l, r) {\n var cmpByPhase = l.hookPhase - r.hookPhase;\n return cmpByPhase === 0 ? l.hookOrder - r.hookOrder : cmpByPhase;\n });\n };\n TransitionService.prototype._definePathType = function (name, hookScope) {\n this._criteriaPaths[name] = {\n name: name,\n scope: hookScope\n };\n };\n TransitionService.prototype._getPathTypes = function () {\n return this._criteriaPaths;\n };\n TransitionService.prototype.getHooks = function (hookName) {\n return this._registeredHooks[hookName];\n };\n TransitionService.prototype._registerCoreTransitionHooks = function () {\n var fns = this._deregisterHookFns;\n fns.addCoreResolves = registerAddCoreResolvables(this);\n fns.ignored = registerIgnoredTransitionHook(this);\n fns.invalid = registerInvalidTransitionHook(this);\n fns.redirectTo = registerRedirectToHook(this);\n fns.onExit = registerOnExitHook(this);\n fns.onRetain = registerOnRetainHook(this);\n fns.onEnter = registerOnEnterHook(this);\n fns.eagerResolve = registerEagerResolvePath(this);\n fns.lazyResolve = registerLazyResolveState(this);\n fns.resolveAll = registerResolveRemaining(this);\n fns.loadViews = registerLoadEnteringViews(this);\n fns.activateViews = registerActivateViews(this);\n fns.updateGlobals = registerUpdateGlobalState(this);\n fns.updateUrl = registerUpdateUrl(this);\n fns.lazyLoad = registerLazyLoadHook(this);\n };\n return TransitionService;\n}();\n\nvar StateService =\nfunction () {\n function StateService(\n router) {\n this.router = router;\n this.invalidCallbacks = [];\n this._defaultErrorHandler = function $defaultErrorHandler($error$) {\n if ($error$ instanceof Error && $error$.stack) {\n console.error($error$);\n console.error($error$.stack);\n } else if ($error$ instanceof Rejection) {\n console.error($error$.toString());\n if ($error$.detail && $error$.detail.stack) console.error($error$.detail.stack);\n } else {\n console.error($error$);\n }\n };\n var getters = ['current', '$current', 'params', 'transition'];\n var boundFns = Object.keys(StateService.prototype).filter(not(inArray(getters)));\n createProxyFunctions(val(StateService.prototype), this, val(this), boundFns);\n }\n Object.defineProperty(StateService.prototype, \"transition\", {\n get: function () {\n return this.router.globals.transition;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"params\", {\n get: function () {\n return this.router.globals.params;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"current\", {\n get: function () {\n return this.router.globals.current;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"$current\", {\n get: function () {\n return this.router.globals.$current;\n },\n enumerable: true,\n configurable: true\n });\n StateService.prototype.dispose = function () {\n this.defaultErrorHandler(noop);\n this.invalidCallbacks = [];\n };\n StateService.prototype._handleInvalidTargetState = function (fromPath, toState) {\n var _this = this;\n var fromState = PathUtils.makeTargetState(this.router.stateRegistry, fromPath);\n var globals = this.router.globals;\n var latestThing = function () {\n return globals.transitionHistory.peekTail();\n };\n var latest = latestThing();\n var callbackQueue = new Queue(this.invalidCallbacks.slice());\n var injector = new ResolveContext(fromPath).injector();\n var checkForRedirect = function (result) {\n if (!(result instanceof TargetState)) {\n return;\n }\n var target = result;\n target = _this.target(target.identifier(), target.params(), target.options());\n if (!target.valid()) {\n return Rejection.invalid(target.error()).toPromise();\n }\n if (latestThing() !== latest) {\n return Rejection.superseded().toPromise();\n }\n return _this.transitionTo(target.identifier(), target.params(), target.options());\n };\n function invokeNextCallback() {\n var nextCallback = callbackQueue.dequeue();\n if (nextCallback === undefined) return Rejection.invalid(toState.error()).toPromise();\n var callbackResult = services.$q.when(nextCallback(toState, fromState, injector));\n return callbackResult.then(checkForRedirect).then(function (result) {\n return result || invokeNextCallback();\n });\n }\n return invokeNextCallback();\n };\n StateService.prototype.onInvalid = function (callback) {\n this.invalidCallbacks.push(callback);\n return function deregisterListener() {\n removeFrom(this.invalidCallbacks)(callback);\n }.bind(this);\n };\n StateService.prototype.reload = function (reloadState) {\n return this.transitionTo(this.current, this.params, {\n reload: isDefined(reloadState) ? reloadState : true,\n inherit: false,\n notify: false\n });\n };\n StateService.prototype.go = function (to, params, options) {\n var defautGoOpts = {\n relative: this.$current,\n inherit: true\n };\n var transOpts = defaults(options, defautGoOpts, defaultTransOpts);\n return this.transitionTo(to, params, transOpts);\n };\n StateService.prototype.target = function (identifier, params, options) {\n if (options === void 0) {\n options = {};\n }\n if (isObject(options.reload) && !options.reload.name) throw new Error('Invalid reload state object');\n var reg = this.router.stateRegistry;\n options.reloadState = options.reload === true ? reg.root() : reg.matcher.find(options.reload, options.relative);\n if (options.reload && !options.reloadState) throw new Error(\"No such reload state '\" + (isString(options.reload) ? options.reload : options.reload.name) + \"'\");\n return new TargetState(this.router.stateRegistry, identifier, params, options);\n };\n StateService.prototype.getCurrentPath = function () {\n var _this = this;\n var globals = this.router.globals;\n var latestSuccess = globals.successfulTransitions.peekTail();\n var rootPath = function () {\n return [new PathNode(_this.router.stateRegistry.root())];\n };\n return latestSuccess ? latestSuccess.treeChanges().to : rootPath();\n };\n StateService.prototype.transitionTo = function (to, toParams, options) {\n var _this = this;\n if (toParams === void 0) {\n toParams = {};\n }\n if (options === void 0) {\n options = {};\n }\n var router = this.router;\n var globals = router.globals;\n options = defaults(options, defaultTransOpts);\n var getCurrent = function () {\n return globals.transition;\n };\n options = extend(options, {\n current: getCurrent\n });\n var ref = this.target(to, toParams, options);\n var currentPath = this.getCurrentPath();\n if (!ref.exists()) return this._handleInvalidTargetState(currentPath, ref);\n if (!ref.valid()) return silentRejection(ref.error());\n if (options.supercede === false && getCurrent()) {\n return Rejection.ignored('Another transition is in progress and supercede has been set to false in TransitionOptions for the transition. So the transition was ignored in favour of the existing one in progress.').toPromise();\n }\n var rejectedTransitionHandler = function (trans) {\n return function (error) {\n if (error instanceof Rejection) {\n var isLatest = router.globals.lastStartedTransitionId <= trans.$id;\n if (error.type === RejectType.IGNORED) {\n isLatest && router.urlRouter.update();\n return services.$q.when(globals.current);\n }\n var detail = error.detail;\n if (error.type === RejectType.SUPERSEDED && error.redirected && detail instanceof TargetState) {\n var redirect = trans.redirect(detail);\n return redirect.run().catch(rejectedTransitionHandler(redirect));\n }\n if (error.type === RejectType.ABORTED) {\n isLatest && router.urlRouter.update();\n return services.$q.reject(error);\n }\n }\n var errorHandler = _this.defaultErrorHandler();\n errorHandler(error);\n return services.$q.reject(error);\n };\n };\n var transition = this.router.transitionService.create(currentPath, ref);\n var transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition));\n silenceUncaughtInPromise(transitionToPromise);\n return extend(transitionToPromise, {\n transition: transition\n });\n };\n StateService.prototype.is = function (stateOrName, params, options) {\n options = defaults(options, {\n relative: this.$current\n });\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\n if (!isDefined(state)) return undefined;\n if (this.$current !== state) return false;\n if (!params) return true;\n var schema = state.parameters({\n inherit: true,\n matchingKeys: params\n });\n return Param.equals(schema, Param.values(schema, params), this.params);\n };\n StateService.prototype.includes = function (stateOrName, params, options) {\n options = defaults(options, {\n relative: this.$current\n });\n var glob = isString(stateOrName) && Glob.fromString(stateOrName);\n if (glob) {\n if (!glob.matches(this.$current.name)) return false;\n stateOrName = this.$current.name;\n }\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative),\n include = this.$current.includes;\n if (!isDefined(state)) return undefined;\n if (!isDefined(include[state.name])) return false;\n if (!params) return true;\n var schema = state.parameters({\n inherit: true,\n matchingKeys: params\n });\n return Param.equals(schema, Param.values(schema, params), this.params);\n };\n StateService.prototype.href = function (stateOrName, params, options) {\n var defaultHrefOpts = {\n lossy: true,\n inherit: true,\n absolute: false,\n relative: this.$current\n };\n options = defaults(options, defaultHrefOpts);\n params = params || {};\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\n if (!isDefined(state)) return null;\n if (options.inherit) params = this.params.$inherit(params, this.$current, state);\n var nav = state && options.lossy ? state.navigable : state;\n if (!nav || nav.url === undefined || nav.url === null) {\n return null;\n }\n return this.router.urlRouter.href(nav.url, params, {\n absolute: options.absolute\n });\n };\n StateService.prototype.defaultErrorHandler = function (handler) {\n return this._defaultErrorHandler = handler || this._defaultErrorHandler;\n };\n StateService.prototype.get = function (stateOrName, base) {\n var reg = this.router.stateRegistry;\n if (arguments.length === 0) return reg.get();\n return reg.get(stateOrName, base || this.$current);\n };\n StateService.prototype.lazyLoad = function (stateOrName, transition) {\n var state = this.get(stateOrName);\n if (!state || !state.lazyLoad) throw new Error('Can not lazy load ' + stateOrName);\n var currentPath = this.getCurrentPath();\n var target = PathUtils.makeTargetState(this.router.stateRegistry, currentPath);\n transition = transition || this.router.transitionService.create(currentPath, target);\n return lazyLoadState(transition, state);\n };\n return StateService;\n}();\n\nvar keyValsToObjectR = function (accum, _a) {\n var key = _a[0],\n val = _a[1];\n if (!accum.hasOwnProperty(key)) {\n accum[key] = val;\n } else if (isArray(accum[key])) {\n accum[key].push(val);\n } else {\n accum[key] = [accum[key], val];\n }\n return accum;\n};\nvar getParams = function (queryString) {\n return queryString.split('&').filter(identity).map(splitEqual).reduce(keyValsToObjectR, {});\n};\nfunction parseUrl$1(url) {\n var orEmptyString = function (x) {\n return x || '';\n };\n var _a = splitHash(url).map(orEmptyString),\n beforehash = _a[0],\n hash = _a[1];\n var _b = splitQuery(beforehash).map(orEmptyString),\n path = _b[0],\n search = _b[1];\n return {\n path: path,\n search: search,\n hash: hash,\n url: url\n };\n}\nvar buildUrl = function (loc) {\n var path = loc.path();\n var searchObject = loc.search();\n var hash = loc.hash();\n var search = Object.keys(searchObject).map(function (key) {\n var param = searchObject[key];\n var vals = isArray(param) ? param : [param];\n return vals.map(function (val) {\n return key + '=' + val;\n });\n }).reduce(unnestR, []).join('&');\n return path + (search ? '?' + search : '') + (hash ? '#' + hash : '');\n};\n\nvar BaseLocationServices =\nfunction () {\n function BaseLocationServices(router, fireAfterUpdate) {\n var _this = this;\n this.fireAfterUpdate = fireAfterUpdate;\n this._listeners = [];\n this._listener = function (evt) {\n return _this._listeners.forEach(function (cb) {\n return cb(evt);\n });\n };\n this.hash = function () {\n return parseUrl$1(_this._get()).hash;\n };\n this.path = function () {\n return parseUrl$1(_this._get()).path;\n };\n this.search = function () {\n return getParams(parseUrl$1(_this._get()).search);\n };\n this._location = root.location;\n this._history = root.history;\n }\n BaseLocationServices.prototype.url = function (url, replace) {\n if (replace === void 0) {\n replace = true;\n }\n if (isDefined(url) && url !== this._get()) {\n this._set(null, null, url, replace);\n if (this.fireAfterUpdate) {\n this._listeners.forEach(function (cb) {\n return cb({\n url: url\n });\n });\n }\n }\n return buildUrl(this);\n };\n BaseLocationServices.prototype.onChange = function (cb) {\n var _this = this;\n this._listeners.push(cb);\n return function () {\n return removeFrom(_this._listeners, cb);\n };\n };\n BaseLocationServices.prototype.dispose = function (router) {\n deregAll(this._listeners);\n };\n return BaseLocationServices;\n}();\n\nvar __extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar HashLocationService =\nfunction (_super) {\n __extends(HashLocationService, _super);\n function HashLocationService(router) {\n var _this = _super.call(this, router, false) || this;\n root.addEventListener('hashchange', _this._listener, false);\n return _this;\n }\n HashLocationService.prototype._get = function () {\n return trimHashVal(this._location.hash);\n };\n HashLocationService.prototype._set = function (state, title, url, replace) {\n this._location.hash = url;\n };\n HashLocationService.prototype.dispose = function (router) {\n _super.prototype.dispose.call(this, router);\n root.removeEventListener('hashchange', this._listener);\n };\n return HashLocationService;\n}(BaseLocationServices);\n\nvar __extends$1 = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar MemoryLocationService =\nfunction (_super) {\n __extends$1(MemoryLocationService, _super);\n function MemoryLocationService(router) {\n return _super.call(this, router, true) || this;\n }\n MemoryLocationService.prototype._get = function () {\n return this._url;\n };\n MemoryLocationService.prototype._set = function (state, title, url, replace) {\n this._url = url;\n };\n return MemoryLocationService;\n}(BaseLocationServices);\n\nvar __extends$2 = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar PushStateLocationService =\nfunction (_super) {\n __extends$2(PushStateLocationService, _super);\n function PushStateLocationService(router) {\n var _this = _super.call(this, router, true) || this;\n _this._config = router.urlService.config;\n root.addEventListener('popstate', _this._listener, false);\n return _this;\n }\n PushStateLocationService.prototype._getBasePrefix = function () {\n return stripLastPathElement(this._config.baseHref());\n };\n PushStateLocationService.prototype._get = function () {\n var _a = this._location,\n pathname = _a.pathname,\n hash = _a.hash,\n search = _a.search;\n search = splitQuery(search)[1];\n hash = splitHash(hash)[1];\n var basePrefix = this._getBasePrefix();\n var exactBaseHrefMatch = pathname === this._config.baseHref();\n var startsWithBase = pathname.substr(0, basePrefix.length) === basePrefix;\n pathname = exactBaseHrefMatch ? '/' : startsWithBase ? pathname.substring(basePrefix.length) : pathname;\n return pathname + (search ? '?' + search : '') + (hash ? '#' + hash : '');\n };\n PushStateLocationService.prototype._set = function (state, title, url, replace) {\n var basePrefix = this._getBasePrefix();\n var slash = url && url[0] !== '/' ? '/' : '';\n var fullUrl = url === '' || url === '/' ? this._config.baseHref() : basePrefix + slash + url;\n if (replace) {\n this._history.replaceState(state, title, fullUrl);\n } else {\n this._history.pushState(state, title, fullUrl);\n }\n };\n PushStateLocationService.prototype.dispose = function (router) {\n _super.prototype.dispose.call(this, router);\n root.removeEventListener('popstate', this._listener);\n };\n return PushStateLocationService;\n}(BaseLocationServices);\n\nvar BrowserLocationConfig =\nfunction () {\n function BrowserLocationConfig(router, _isHtml5) {\n if (_isHtml5 === void 0) {\n _isHtml5 = false;\n }\n this._isHtml5 = _isHtml5;\n this._baseHref = undefined;\n this._hashPrefix = '';\n }\n BrowserLocationConfig.prototype.port = function () {\n if (location.port) {\n return Number(location.port);\n }\n return this.protocol() === 'https' ? 443 : 80;\n };\n BrowserLocationConfig.prototype.protocol = function () {\n return location.protocol.replace(/:/g, '');\n };\n BrowserLocationConfig.prototype.host = function () {\n return location.hostname;\n };\n BrowserLocationConfig.prototype.html5Mode = function () {\n return this._isHtml5;\n };\n BrowserLocationConfig.prototype.hashPrefix = function (newprefix) {\n return isDefined(newprefix) ? this._hashPrefix = newprefix : this._hashPrefix;\n };\n BrowserLocationConfig.prototype.baseHref = function (href) {\n if (isDefined(href)) this._baseHref = href;\n if (isUndefined(this._baseHref)) this._baseHref = this.getBaseHref();\n return this._baseHref;\n };\n BrowserLocationConfig.prototype.getBaseHref = function () {\n var baseTag = document.getElementsByTagName('base')[0];\n if (baseTag && baseTag.href) {\n return baseTag.href.replace(/^([^/:]*:)?\\/\\/[^/]*/, '');\n }\n return this._isHtml5 ? '/' : location.pathname || '/';\n };\n BrowserLocationConfig.prototype.dispose = function () {};\n return BrowserLocationConfig;\n}();\n\nfunction getNg1ViewConfigFactory() {\n var templateFactory = null;\n return function (path, view) {\n templateFactory = templateFactory || services.$injector.get('$templateFactory');\n return [new Ng1ViewConfig(path, view, templateFactory)];\n };\n}\nvar hasAnyKey = function (keys, obj) {\n return keys.reduce(function (acc, key) {\n return acc || isDefined(obj[key]);\n }, false);\n};\nfunction ng1ViewsBuilder(state) {\n if (!state.parent) return {};\n var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'],\n ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'],\n compKeys = ['component', 'bindings', 'componentProvider'],\n nonCompKeys = tplKeys.concat(ctrlKeys),\n allViewKeys = compKeys.concat(nonCompKeys);\n if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) {\n throw new Error(\"State '\" + state.name + \"' has a 'views' object. \" + \"It cannot also have \\\"view properties\\\" at the state level. \" + \"Move the following properties into a view (in the 'views' object): \" + (\" \" + allViewKeys.filter(function (key) {\n return isDefined(state[key]);\n }).join(', ')));\n }\n var views = {},\n viewsObject = state.views || {\n $default: pick(state, allViewKeys)\n };\n forEach(viewsObject, function (config, name) {\n name = name || '$default';\n if (isString(config)) config = {\n component: config\n };\n config = extend({}, config);\n if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {\n throw new Error(\"Cannot combine: \" + compKeys.join('|') + \" with: \" + nonCompKeys.join('|') + \" in stateview: '\" + name + \"@\" + state.name + \"'\");\n }\n config.resolveAs = config.resolveAs || '$resolve';\n config.$type = 'ng1';\n config.$context = state;\n config.$name = name;\n var normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);\n config.$uiViewName = normalized.uiViewName;\n config.$uiViewContextAnchor = normalized.uiViewContextAnchor;\n views[name] = config;\n });\n return views;\n}\nvar id$1 = 0;\nvar Ng1ViewConfig =\nfunction () {\n function Ng1ViewConfig(path, viewDecl, factory) {\n var _this = this;\n this.path = path;\n this.viewDecl = viewDecl;\n this.factory = factory;\n this.$id = id$1++;\n this.loaded = false;\n this.getTemplate = function (uiView, context) {\n return _this.component ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings) : _this.template;\n };\n }\n Ng1ViewConfig.prototype.load = function () {\n var _this = this;\n var $q = services.$q;\n var context = new ResolveContext(this.path);\n var params = this.path.reduce(function (acc, node) {\n return extend(acc, node.paramValues);\n }, {});\n var promises = {\n template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),\n controller: $q.when(this.getController(context))\n };\n return $q.all(promises).then(function (results) {\n trace.traceViewServiceEvent('Loaded', _this);\n _this.controller = results.controller;\n extend(_this, results.template);\n return _this;\n });\n };\n Ng1ViewConfig.prototype.getController = function (context) {\n var provider = this.viewDecl.controllerProvider;\n if (!isInjectable(provider)) return this.viewDecl.controller;\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n return Ng1ViewConfig;\n}();\n\nvar TemplateFactory =\nfunction () {\n function TemplateFactory() {\n var _this = this;\n this._useHttp = ng.version.minor < 3;\n this.$get = ['$http', '$templateCache', '$injector', function ($http, $templateCache, $injector) {\n _this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');\n _this.$http = $http;\n _this.$templateCache = $templateCache;\n return _this;\n }];\n }\n TemplateFactory.prototype.useHttpService = function (value) {\n this._useHttp = value;\n };\n TemplateFactory.prototype.fromConfig = function (config, params, context) {\n var defaultTemplate = '';\n var asTemplate = function (result) {\n return services.$q.when(result).then(function (str) {\n return {\n template: str\n };\n });\n };\n var asComponent = function (result) {\n return services.$q.when(result).then(function (str) {\n return {\n component: str\n };\n });\n };\n return isDefined(config.template) ? asTemplate(this.fromString(config.template, params)) : isDefined(config.templateUrl) ? asTemplate(this.fromUrl(config.templateUrl, params)) : isDefined(config.templateProvider) ? asTemplate(this.fromProvider(config.templateProvider, params, context)) : isDefined(config.component) ? asComponent(config.component) : isDefined(config.componentProvider) ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) : asTemplate(defaultTemplate);\n };\n TemplateFactory.prototype.fromString = function (template, params) {\n return isFunction(template) ? template(params) : template;\n };\n TemplateFactory.prototype.fromUrl = function (url, params) {\n if (isFunction(url)) url = url(params);\n if (url == null) return null;\n if (this._useHttp) {\n return this.$http.get(url, {\n cache: this.$templateCache,\n headers: {\n Accept: 'text/html'\n }\n }).then(function (response) {\n return response.data;\n });\n }\n return this.$templateRequest(url);\n };\n TemplateFactory.prototype.fromProvider = function (provider, params, context) {\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) {\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) {\n bindings = bindings || {};\n var prefix = ng.version.minor >= 3 ? '::' : '';\n var kebob = function (camelCase) {\n var kebobed = kebobString(camelCase);\n return /^(x|data)-/.exec(kebobed) ? \"x-\" + kebobed : kebobed;\n };\n var attributeTpl = function (input) {\n var name = input.name,\n type = input.type;\n var attrName = kebob(name);\n if (uiView.attr(attrName) && !bindings[name]) return attrName + \"='\" + uiView.attr(attrName) + \"'\";\n var resolveName = bindings[name] || name;\n if (type === '@') return attrName + \"='{{\" + prefix + \"$resolve.\" + resolveName + \"}}'\";\n if (type === '&') {\n var res = context.getResolvable(resolveName);\n var fn = res && res.data;\n var args = fn && services.$injector.annotate(fn) || [];\n var arrayIdxStr = isArray(fn) ? \"[\" + (fn.length - 1) + \"]\" : '';\n return attrName + \"='$resolve.\" + resolveName + arrayIdxStr + \"(\" + args.join(',') + \")'\";\n }\n return attrName + \"='\" + prefix + \"$resolve.\" + resolveName + \"'\";\n };\n var attrs = getComponentBindings(component).map(attributeTpl).join(' ');\n var kebobName = kebob(component);\n return \"<\" + kebobName + \" \" + attrs + \">\";\n };\n return TemplateFactory;\n}();\nfunction getComponentBindings(name) {\n var cmpDefs = services.$injector.get(name + 'Directive');\n if (!cmpDefs || !cmpDefs.length) throw new Error(\"Unable to find component named '\" + name + \"'\");\n return cmpDefs.map(getBindings).reduce(unnestR, []);\n}\nvar getBindings = function (def) {\n if (isObject(def.bindToController)) return scopeBindings(def.bindToController);\n return scopeBindings(def.scope);\n};\nvar scopeBindings = function (bindingsObj) {\n return Object.keys(bindingsObj || {})\n .map(function (key) {\n return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])];\n })\n .filter(function (tuple) {\n return isDefined(tuple) && isArray(tuple[1]);\n })\n .map(function (tuple) {\n return {\n name: tuple[1][2] || tuple[0],\n type: tuple[1][1]\n };\n });\n};\n\nvar StateProvider =\nfunction () {\n function StateProvider(stateRegistry, stateService) {\n this.stateRegistry = stateRegistry;\n this.stateService = stateService;\n createProxyFunctions(val(StateProvider.prototype), this, val(this));\n }\n StateProvider.prototype.decorator = function (name, func) {\n return this.stateRegistry.decorator(name, func) || this;\n };\n StateProvider.prototype.state = function (name, definition) {\n if (isObject(name)) {\n definition = name;\n } else {\n definition.name = name;\n }\n this.stateRegistry.register(definition);\n return this;\n };\n StateProvider.prototype.onInvalid = function (callback) {\n return this.stateService.onInvalid(callback);\n };\n return StateProvider;\n}();\n\nvar getStateHookBuilder = function (hookName) {\n return function stateHookBuilder(stateObject, parentFn) {\n var hook = stateObject[hookName];\n var pathname = hookName === 'onExit' ? 'from' : 'to';\n function decoratedNg1Hook(trans, state) {\n var resolveContext = new ResolveContext(trans.treeChanges(pathname));\n var subContext = resolveContext.subContext(state.$$state());\n var locals = extend(getLocals(subContext), {\n $state$: state,\n $transition$: trans\n });\n return services.$injector.invoke(hook, this, locals);\n }\n return hook ? decoratedNg1Hook : undefined;\n };\n};\n\nvar Ng1LocationServices =\nfunction () {\n function Ng1LocationServices($locationProvider) {\n this._urlListeners = [];\n this.$locationProvider = $locationProvider;\n var _lp = val($locationProvider);\n createProxyFunctions(_lp, this, _lp, ['hashPrefix']);\n }\n Ng1LocationServices.monkeyPatchPathParameterType = function (router) {\n var pathType = router.urlMatcherFactory.type('path');\n pathType.encode = function (x) {\n return x != null ? x.toString().replace(/(~|\\/)/g, function (m) {\n return {\n '~': '~~',\n '/': '~2F'\n }[m];\n }) : x;\n };\n pathType.decode = function (x) {\n return x != null ? x.toString().replace(/(~~|~2F)/g, function (m) {\n return {\n '~~': '~',\n '~2F': '/'\n }[m];\n }) : x;\n };\n };\n Ng1LocationServices.prototype.dispose = function () {};\n Ng1LocationServices.prototype.onChange = function (callback) {\n var _this = this;\n this._urlListeners.push(callback);\n return function () {\n return removeFrom(_this._urlListeners)(callback);\n };\n };\n Ng1LocationServices.prototype.html5Mode = function () {\n var html5Mode = this.$locationProvider.html5Mode();\n html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode;\n return html5Mode && this.$sniffer.history;\n };\n Ng1LocationServices.prototype.baseHref = function () {\n return this._baseHref || (this._baseHref = this.$browser.baseHref() || this.$window.location.pathname);\n };\n Ng1LocationServices.prototype.url = function (newUrl, replace, state) {\n if (replace === void 0) {\n replace = false;\n }\n if (isDefined(newUrl)) this.$location.url(newUrl);\n if (replace) this.$location.replace();\n if (state) this.$location.state(state);\n return this.$location.url();\n };\n Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser, $window) {\n var _this = this;\n this.$location = $location;\n this.$sniffer = $sniffer;\n this.$browser = $browser;\n this.$window = $window;\n $rootScope.$on('$locationChangeSuccess', function (evt) {\n return _this._urlListeners.forEach(function (fn) {\n return fn(evt);\n });\n });\n var _loc = val($location);\n createProxyFunctions(_loc, this, _loc, ['replace', 'path', 'search', 'hash']);\n createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);\n };\n return Ng1LocationServices;\n}();\n\nvar UrlRouterProvider =\nfunction () {\n function UrlRouterProvider(\n router) {\n this.router = router;\n }\n UrlRouterProvider.injectableHandler = function (router, handler) {\n return function (match) {\n return services.$injector.invoke(handler, null, {\n $match: match,\n $stateParams: router.globals.params\n });\n };\n };\n UrlRouterProvider.prototype.$get = function () {\n var urlService = this.router.urlService;\n this.router.urlRouter.update(true);\n if (!urlService.interceptDeferred) urlService.listen();\n return this.router.urlRouter;\n };\n UrlRouterProvider.prototype.rule = function (ruleFn) {\n var _this = this;\n if (!isFunction(ruleFn)) throw new Error(\"'rule' must be a function\");\n var match = function () {\n return ruleFn(services.$injector, _this.router.locationService);\n };\n var rule = new BaseUrlRule(match, identity);\n this.router.urlService.rules.rule(rule);\n return this;\n };\n UrlRouterProvider.prototype.otherwise = function (rule) {\n var _this = this;\n var urlRules = this.router.urlService.rules;\n if (isString(rule)) {\n urlRules.otherwise(rule);\n } else if (isFunction(rule)) {\n urlRules.otherwise(function () {\n return rule(services.$injector, _this.router.locationService);\n });\n } else {\n throw new Error(\"'rule' must be a string or function\");\n }\n return this;\n };\n UrlRouterProvider.prototype.when = function (what, handler) {\n if (isArray(handler) || isFunction(handler)) {\n handler = UrlRouterProvider.injectableHandler(this.router, handler);\n }\n this.router.urlService.rules.when(what, handler);\n return this;\n };\n UrlRouterProvider.prototype.deferIntercept = function (defer) {\n this.router.urlService.deferIntercept(defer);\n };\n return UrlRouterProvider;\n}();\n\nng.module('ui.router.angular1', []);\nvar mod_init = ng.module('ui.router.init', ['ng']);\nvar mod_util = ng.module('ui.router.util', ['ui.router.init']);\nvar mod_rtr = ng.module('ui.router.router', ['ui.router.util']);\nvar mod_state = ng.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);\nvar mod_main = ng.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);\nvar mod_cmpt = ng.module('ui.router.compat', ['ui.router']);\nvar router = null;\n$uiRouterProvider.$inject = ['$locationProvider'];\nfunction $uiRouterProvider($locationProvider) {\n router = this.router = new UIRouter();\n router.stateProvider = new StateProvider(router.stateRegistry, router.stateService);\n router.stateRegistry.decorator('views', ng1ViewsBuilder);\n router.stateRegistry.decorator('onExit', getStateHookBuilder('onExit'));\n router.stateRegistry.decorator('onRetain', getStateHookBuilder('onRetain'));\n router.stateRegistry.decorator('onEnter', getStateHookBuilder('onEnter'));\n router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory());\n var ng1LocationService = router.locationService = router.locationConfig = new Ng1LocationServices($locationProvider);\n Ng1LocationServices.monkeyPatchPathParameterType(router);\n router['router'] = router;\n router['$get'] = $get;\n $get.$inject = ['$location', '$browser', '$window', '$sniffer', '$rootScope', '$http', '$templateCache'];\n function $get($location, $browser, $window, $sniffer, $rootScope, $http, $templateCache) {\n ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser, $window);\n delete router['router'];\n delete router['$get'];\n return router;\n }\n return router;\n}\nvar getProviderFor = function (serviceName) {\n return ['$uiRouterProvider', function ($urp) {\n var service = $urp.router[serviceName];\n service['$get'] = function () {\n return service;\n };\n return service;\n }];\n};\nrunBlock.$inject = ['$injector', '$q', '$uiRouter'];\nfunction runBlock($injector, $q, $uiRouter) {\n services.$injector = $injector;\n services.$q = $q;\n if (!$injector.hasOwnProperty('strictDi')) {\n try {\n $injector.invoke(function (checkStrictDi) {});\n } catch (error) {\n $injector.strictDi = !!/strict mode/.exec(error && error.toString());\n }\n }\n $uiRouter.stateRegistry.get().map(function (x) {\n return x.$$state().resolvables;\n }).reduce(unnestR, []).filter(function (x) {\n return x.deps === 'deferred';\n }).forEach(function (resolvable) {\n return resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi);\n });\n}\nvar getUrlRouterProvider = function (uiRouter) {\n return uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter);\n};\nvar getStateProvider = function () {\n return extend(router.stateProvider, {\n $get: function () {\n return router.stateService;\n }\n });\n};\nwatchDigests.$inject = ['$rootScope'];\nfunction watchDigests($rootScope) {\n $rootScope.$watch(function () {\n trace.approximateDigests++;\n });\n}\nmod_init.provider('$uiRouter', $uiRouterProvider);\nmod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);\nmod_util.provider('$urlService', getProviderFor('urlService'));\nmod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () {\n return router.urlMatcherFactory;\n}]);\nmod_util.provider('$templateFactory', function () {\n return new TemplateFactory();\n});\nmod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));\nmod_state.provider('$uiRouterGlobals', getProviderFor('globals'));\nmod_state.provider('$transitions', getProviderFor('transitionService'));\nmod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);\nmod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) {\n return $uiRouter.globals.params;\n}]);\nmod_main.factory('$view', function () {\n return router.viewService;\n});\nmod_main.service('$trace', function () {\n return trace;\n});\nmod_main.run(watchDigests);\nmod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) {}]);\nmod_state.run(['$state', function ($state) {}]);\nmod_rtr.run(['$urlRouter', function ($urlRouter) {}]);\nmod_init.run(runBlock);\nvar getLocals = function (ctx) {\n var tokens = ctx.getTokens().filter(isString);\n var tuples = tokens.map(function (key) {\n var resolvable = ctx.getResolvable(key);\n var waitPolicy = ctx.getPolicy(resolvable).async;\n return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data];\n });\n return tuples.reduce(applyPairs, {});\n};\n\nfunction parseStateRef(ref) {\n var parsed;\n var paramsOnly = ref.match(/^\\s*({[^}]*})\\s*$/);\n if (paramsOnly) ref = '(' + paramsOnly[1] + ')';\n parsed = ref.replace(/\\n/g, ' ').match(/^\\s*([^(]*?)\\s*(\\((.*)\\))?\\s*$/);\n if (!parsed || parsed.length !== 4) throw new Error(\"Invalid state ref '\" + ref + \"'\");\n return {\n state: parsed[1] || null,\n paramExpr: parsed[3] || null\n };\n}\nfunction stateContext(el) {\n var $uiView = el.parent().inheritedData('$uiView');\n var path = parse('$cfg.path')($uiView);\n return path ? tail(path).state.name : undefined;\n}\nfunction processedDef($state, $element, def) {\n var uiState = def.uiState || $state.current.name;\n var uiStateOpts = extend(defaultOpts($element, $state), def.uiStateOpts || {});\n var href = $state.href(uiState, def.uiStateParams, uiStateOpts);\n return {\n uiState: uiState,\n uiStateParams: def.uiStateParams,\n uiStateOpts: uiStateOpts,\n href: href\n };\n}\nfunction getTypeInfo(el) {\n var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';\n var isForm = el[0].nodeName === 'FORM';\n return {\n attr: isForm ? 'action' : isSvg ? 'xlink:href' : 'href',\n isAnchor: el.prop('tagName').toUpperCase() === 'A',\n clickable: !isForm\n };\n}\nfunction clickHook(el, $state, $timeout, type, getDef) {\n return function (e) {\n var button = e.which || e.button,\n target = getDef();\n if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) {\n var transition_1 = $timeout(function () {\n if (!el.attr('disabled')) {\n $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);\n }\n });\n e.preventDefault();\n var ignorePreventDefaultCount_1 = type.isAnchor && !target.href ? 1 : 0;\n e.preventDefault = function () {\n if (ignorePreventDefaultCount_1-- <= 0) $timeout.cancel(transition_1);\n };\n }\n };\n}\nfunction defaultOpts(el, $state) {\n return {\n relative: stateContext(el) || $state.$current,\n inherit: true,\n source: 'sref'\n };\n}\nfunction bindEvents(element, scope, hookFn, uiStateOpts) {\n var events;\n if (uiStateOpts) {\n events = uiStateOpts.events;\n }\n if (!isArray(events)) {\n events = ['click'];\n }\n var on = element.on ? 'on' : 'bind';\n for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {\n var event_1 = events_1[_i];\n element[on](event_1, hookFn);\n }\n scope.$on('$destroy', function () {\n var off = element.off ? 'off' : 'unbind';\n for (var _i = 0, events_2 = events; _i < events_2.length; _i++) {\n var event_2 = events_2[_i];\n element[off](event_2, hookFn);\n }\n });\n}\nvar uiSrefDirective;\nuiSrefDirective = ['$uiRouter', '$timeout', function $StateRefDirective($uiRouter, $timeout) {\n var $state = $uiRouter.stateService;\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope, element, attrs, uiSrefActive) {\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n var unlinkInfoFn = null;\n var hookFn;\n var rawDef = {};\n var getDef = function () {\n return processedDef($state, element, rawDef);\n };\n var ref = parseStateRef(attrs.uiSref);\n rawDef.uiState = ref.state;\n rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};\n function update() {\n var def = getDef();\n if (unlinkInfoFn) unlinkInfoFn();\n if (active) unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null) attrs.$set(type.attr, def.href);\n }\n if (ref.paramExpr) {\n scope.$watch(ref.paramExpr, function (val) {\n rawDef.uiStateParams = extend({}, val);\n update();\n }, true);\n rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr));\n }\n update();\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n }\n };\n}];\nvar uiStateDirective;\nuiStateDirective = ['$uiRouter', '$timeout', function $StateRefDynamicDirective($uiRouter, $timeout) {\n var $state = $uiRouter.stateService;\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope, element, attrs, uiSrefActive) {\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n var unlinkInfoFn = null;\n var hookFn;\n var rawDef = {};\n var getDef = function () {\n return processedDef($state, element, rawDef);\n };\n var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];\n var watchDeregFns = inputAttrs.reduce(function (acc, attr) {\n return acc[attr] = noop, acc;\n }, {});\n function update() {\n var def = getDef();\n if (unlinkInfoFn) unlinkInfoFn();\n if (active) unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null) attrs.$set(type.attr, def.href);\n }\n inputAttrs.forEach(function (field) {\n rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;\n attrs.$observe(field, function (expr) {\n watchDeregFns[field]();\n watchDeregFns[field] = scope.$watch(expr, function (newval) {\n rawDef[field] = newval;\n update();\n }, true);\n });\n });\n update();\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n }\n };\n}];\nvar uiSrefActiveDirective;\nuiSrefActiveDirective = ['$state', '$stateParams', '$interpolate', '$uiRouter', function $StateRefActiveDirective($state, $stateParams, $interpolate, $uiRouter) {\n return {\n restrict: 'A',\n controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {\n var states = [];\n var activeEqClass;\n var uiSrefActive;\n activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope);\n try {\n uiSrefActive = $scope.$eval($attrs.uiSrefActive);\n } catch (e) {\n }\n uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope);\n setStatesFromDefinitionObject(uiSrefActive);\n this.$$addStateInfo = function (newState, newParams) {\n if (isObject(uiSrefActive) && states.length > 0) {\n return;\n }\n var deregister = addState(newState, newParams, uiSrefActive);\n update();\n return deregister;\n };\n function updateAfterTransition(trans) {\n trans.promise.then(update, noop);\n }\n $scope.$on('$destroy', setupEventListeners());\n if ($uiRouter.globals.transition) {\n updateAfterTransition($uiRouter.globals.transition);\n }\n function setupEventListeners() {\n var deregisterStatesChangedListener = $uiRouter.stateRegistry.onStatesChanged(handleStatesChanged);\n var deregisterOnStartListener = $uiRouter.transitionService.onStart({}, updateAfterTransition);\n var deregisterStateChangeSuccessListener = $scope.$on('$stateChangeSuccess', update);\n return function cleanUp() {\n deregisterStatesChangedListener();\n deregisterOnStartListener();\n deregisterStateChangeSuccessListener();\n };\n }\n function handleStatesChanged() {\n setStatesFromDefinitionObject(uiSrefActive);\n }\n function setStatesFromDefinitionObject(statesDefinition) {\n if (isObject(statesDefinition)) {\n states = [];\n forEach(statesDefinition, function (stateOrName, activeClass) {\n var addStateForClass = function (stateOrName, activeClass) {\n var ref = parseStateRef(stateOrName);\n addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);\n };\n if (isString(stateOrName)) {\n addStateForClass(stateOrName, activeClass);\n } else if (isArray(stateOrName)) {\n forEach(stateOrName, function (stateOrName) {\n addStateForClass(stateOrName, activeClass);\n });\n }\n });\n }\n }\n function addState(stateName, stateParams, activeClass) {\n var state = $state.get(stateName, stateContext($element));\n var stateInfo = {\n state: state || {\n name: stateName\n },\n params: stateParams,\n activeClass: activeClass\n };\n states.push(stateInfo);\n return function removeState() {\n removeFrom(states)(stateInfo);\n };\n }\n function update() {\n var splitClasses = function (str) {\n return str.split(/\\s/).filter(identity);\n };\n var getClasses = function (stateList) {\n return stateList.map(function (x) {\n return x.activeClass;\n }).map(splitClasses).reduce(unnestR, []);\n };\n var allClasses = getClasses(states).concat(splitClasses(activeEqClass)).reduce(uniqR, []);\n var fuzzyClasses = getClasses(states.filter(function (x) {\n return $state.includes(x.state.name, x.params);\n }));\n var exactlyMatchesAny = !!states.filter(function (x) {\n return $state.is(x.state.name, x.params);\n }).length;\n var exactClasses = exactlyMatchesAny ? splitClasses(activeEqClass) : [];\n var addClasses = fuzzyClasses.concat(exactClasses).reduce(uniqR, []);\n var removeClasses = allClasses.filter(function (cls) {\n return !inArray(addClasses, cls);\n });\n $scope.$evalAsync(function () {\n addClasses.forEach(function (className) {\n return $element.addClass(className);\n });\n removeClasses.forEach(function (className) {\n return $element.removeClass(className);\n });\n });\n }\n update();\n }]\n };\n}];\nng.module('ui.router.state').directive('uiSref', uiSrefDirective).directive('uiSrefActive', uiSrefActiveDirective).directive('uiSrefActiveEq', uiSrefActiveDirective).directive('uiState', uiStateDirective);\n\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state) {\n var isFilter = function (state, params, options) {\n return $state.is(state, params, options);\n };\n isFilter.$stateful = true;\n return isFilter;\n}\n$IncludedByStateFilter.$inject = ['$state'];\nfunction $IncludedByStateFilter($state) {\n var includesFilter = function (state, params, options) {\n return $state.includes(state, params, options);\n };\n includesFilter.$stateful = true;\n return includesFilter;\n}\nng.module('ui.router.state').filter('isState', $IsStateFilter).filter('includedByState', $IncludedByStateFilter);\n\nvar uiView;\nuiView = ['$view', '$animate', '$uiViewScroll', '$interpolate', '$q', function $ViewDirective($view, $animate, $uiViewScroll, $interpolate, $q) {\n function getRenderer(attrs, scope) {\n return {\n enter: function (element, target, cb) {\n if (ng.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function (element, cb) {\n if (ng.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n function configsEqual(config1, config2) {\n return config1 === config2;\n }\n var rootData = {\n $cfg: {\n viewDecl: {\n $context: $view._pluginapi._rootViewContext()\n }\n },\n $uiView: {}\n };\n var directive = {\n count: 0,\n restrict: 'ECA',\n terminal: true,\n priority: 400,\n transclude: 'element',\n compile: function (tElement, tAttrs, $transclude) {\n return function (scope, $element, attrs) {\n var onloadExp = attrs['onload'] || '',\n autoScrollExp = attrs['autoscroll'],\n renderer = getRenderer(),\n inherited = $element.inheritedData('$uiView') || rootData,\n name = $interpolate(attrs['uiView'] || attrs['name'] || '')(scope) || '$default';\n var previousEl, currentEl, currentScope, viewConfig, unregister;\n var activeUIView = {\n $type: 'ng1',\n id: directive.count++,\n name: name,\n fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + '.' + name : name,\n config: null,\n configUpdated: configUpdatedCallback,\n get creationContext() {\n var fromParentTagConfig = parse('$cfg.viewDecl.$context')(inherited);\n var fromParentTag = parse('$uiView.creationContext')(inherited);\n return fromParentTagConfig || fromParentTag;\n }\n };\n trace.traceUIViewEvent('Linking', activeUIView);\n function configUpdatedCallback(config) {\n if (config && !(config instanceof Ng1ViewConfig)) return;\n if (configsEqual(viewConfig, config)) return;\n trace.traceUIViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context);\n viewConfig = config;\n updateView(config);\n }\n $element.data('$uiView', {\n $uiView: activeUIView\n });\n updateView();\n unregister = $view.registerUIView(activeUIView);\n scope.$on('$destroy', function () {\n trace.traceUIViewEvent('Destroying/Unregistering', activeUIView);\n unregister();\n });\n function cleanupLastView() {\n if (previousEl) {\n trace.traceUIViewEvent('Removing (previous) el', previousEl.data('$uiView'));\n previousEl.remove();\n previousEl = null;\n }\n if (currentScope) {\n trace.traceUIViewEvent('Destroying scope', activeUIView);\n currentScope.$destroy();\n currentScope = null;\n }\n if (currentEl) {\n var _viewData_1 = currentEl.data('$uiViewAnim');\n trace.traceUIViewEvent('Animate out', _viewData_1);\n renderer.leave(currentEl, function () {\n _viewData_1.$$animLeave.resolve();\n previousEl = null;\n });\n previousEl = currentEl;\n currentEl = null;\n }\n }\n function updateView(config) {\n var newScope = scope.$new();\n var animEnter = $q.defer(),\n animLeave = $q.defer();\n var $uiViewData = {\n $cfg: config,\n $uiView: activeUIView\n };\n var $uiViewAnim = {\n $animEnter: animEnter.promise,\n $animLeave: animLeave.promise,\n $$animLeave: animLeave\n };\n newScope.$emit('$viewContentLoading', name);\n var cloned = $transclude(newScope, function (clone) {\n clone.data('$uiViewAnim', $uiViewAnim);\n clone.data('$uiView', $uiViewData);\n renderer.enter(clone, $element, function onUIViewEnter() {\n animEnter.resolve();\n if (currentScope) currentScope.$emit('$viewContentAnimationEnded');\n if (isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {\n $uiViewScroll(clone);\n }\n });\n cleanupLastView();\n });\n currentEl = cloned;\n currentScope = newScope;\n currentScope.$emit('$viewContentLoaded', config || viewConfig);\n currentScope.$eval(onloadExp);\n }\n };\n }\n };\n return directive;\n}];\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$transitions', '$view', '$q', '$timeout'];\nfunction $ViewDirectiveFill($compile, $controller, $transitions, $view, $q, $timeout) {\n var getControllerAs = parse('viewDecl.controllerAs');\n var getResolveAs = parse('viewDecl.resolveAs');\n return {\n restrict: 'ECA',\n priority: -400,\n compile: function (tElement) {\n var initial = tElement.html();\n tElement.empty();\n return function (scope, $element) {\n var data = $element.data('$uiView');\n if (!data) {\n $element.html(initial);\n $compile($element.contents())(scope);\n return;\n }\n var cfg = data.$cfg || {\n viewDecl: {},\n getTemplate: noop\n };\n var resolveCtx = cfg.path && new ResolveContext(cfg.path);\n $element.html(cfg.getTemplate($element, resolveCtx) || initial);\n trace.traceUIViewFill(data.$uiView, $element.html());\n var link = $compile($element.contents());\n var controller = cfg.controller;\n var controllerAs = getControllerAs(cfg);\n var resolveAs = getResolveAs(cfg);\n var locals = resolveCtx && getLocals(resolveCtx);\n scope[resolveAs] = locals;\n if (controller) {\n var controllerInstance = $controller(controller, extend({}, locals, {\n $scope: scope,\n $element: $element\n }));\n if (controllerAs) {\n scope[controllerAs] = controllerInstance;\n scope[controllerAs][resolveAs] = locals;\n }\n $element.data('$ngControllerController', controllerInstance);\n $element.children().data('$ngControllerController', controllerInstance);\n registerControllerCallbacks($q, $transitions, controllerInstance, scope, cfg);\n }\n if (isString(cfg.component)) {\n var kebobName = kebobString(cfg.component);\n var tagRegexp_1 = new RegExp(\"^(x-|data-)?\" + kebobName + \"$\", 'i');\n var getComponentController = function () {\n var directiveEl = [].slice.call($element[0].children).filter(function (el) {\n return el && el.tagName && tagRegexp_1.exec(el.tagName);\n });\n return directiveEl && ng.element(directiveEl).data(\"$\" + cfg.component + \"Controller\");\n };\n var deregisterWatch_1 = scope.$watch(getComponentController, function (ctrlInstance) {\n if (!ctrlInstance) return;\n registerControllerCallbacks($q, $transitions, ctrlInstance, scope, cfg);\n deregisterWatch_1();\n });\n }\n link(scope);\n };\n }\n };\n}\nvar hasComponentImpl = typeof ng.module('ui.router')['component'] === 'function';\nvar _uiCanExitId = 0;\nfunction registerControllerCallbacks($q, $transitions, controllerInstance, $scope, cfg) {\n if (isFunction(controllerInstance.$onInit) && !((cfg.viewDecl.component || cfg.viewDecl.componentProvider) && hasComponentImpl)) {\n controllerInstance.$onInit();\n }\n var viewState = tail(cfg.path).state.self;\n var hookOptions = {\n bind: controllerInstance\n };\n if (isFunction(controllerInstance.uiOnParamsChanged)) {\n var resolveContext = new ResolveContext(cfg.path);\n var viewCreationTrans_1 = resolveContext.getResolvable('$transition$').data;\n var paramsUpdated = function ($transition$) {\n if ($transition$ === viewCreationTrans_1 || $transition$.exiting().indexOf(viewState) !== -1) return;\n var toParams = $transition$.params('to');\n var fromParams = $transition$.params('from');\n var getNodeSchema = function (node) {\n return node.paramSchema;\n };\n var toSchema = $transition$.treeChanges('to').map(getNodeSchema).reduce(unnestR, []);\n var fromSchema = $transition$.treeChanges('from').map(getNodeSchema).reduce(unnestR, []);\n var changedToParams = toSchema.filter(function (param) {\n var idx = fromSchema.indexOf(param);\n return idx === -1 || !fromSchema[idx].type.equals(toParams[param.id], fromParams[param.id]);\n });\n if (changedToParams.length) {\n var changedKeys_1 = changedToParams.map(function (x) {\n return x.id;\n });\n var newValues = filter(toParams, function (val, key) {\n return changedKeys_1.indexOf(key) !== -1;\n });\n controllerInstance.uiOnParamsChanged(newValues, $transition$);\n }\n };\n $scope.$on('$destroy', $transitions.onSuccess({}, paramsUpdated, hookOptions));\n }\n if (isFunction(controllerInstance.uiCanExit)) {\n var id_1 = _uiCanExitId++;\n var cacheProp_1 = '_uiCanExitIds';\n var prevTruthyAnswer_1 = function (trans) {\n return !!trans && (trans[cacheProp_1] && trans[cacheProp_1][id_1] === true || prevTruthyAnswer_1(trans.redirectedFrom()));\n };\n var wrappedHook = function (trans) {\n var promise;\n var ids = trans[cacheProp_1] = trans[cacheProp_1] || {};\n if (!prevTruthyAnswer_1(trans)) {\n promise = $q.when(controllerInstance.uiCanExit(trans));\n promise.then(function (val) {\n return ids[id_1] = val !== false;\n });\n }\n return promise;\n };\n var criteria = {\n exiting: viewState.name\n };\n $scope.$on('$destroy', $transitions.onBefore(criteria, wrappedHook, hookOptions));\n }\n}\nng.module('ui.router.state').directive('uiView', uiView);\nng.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n\nfunction $ViewScrollProvider() {\n var useAnchorScroll = false;\n this.useAnchorScroll = function () {\n useAnchorScroll = true;\n };\n this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {\n if (useAnchorScroll) {\n return $anchorScroll;\n }\n return function ($element) {\n return $timeout(function () {\n $element[0].scrollIntoView();\n }, 0, false);\n };\n }];\n}\nng.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n\nvar uiRouter = 'ui.router';\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar angularTranslate = createCommonjsModule(function (module) {\n/*!\n * angular-translate - v2.18.4 - 2021-01-14\n *\n * Copyright (c) 2021 The angular-translate team, Pascal Precht; Licensed MIT\n */\n(function (root, factory) {\n if ( module.exports) {\n module.exports = factory();\n } else {\n factory();\n }\n})(commonjsGlobal, function () {\n runTranslate.$inject = ['$translate'];\n $translate.$inject = ['$STORAGE_KEY', '$windowProvider', '$translateSanitizationProvider', 'pascalprechtTranslateOverrider'];\n $translateDefaultInterpolation.$inject = ['$interpolate', '$translateSanitization'];\n translateDirective.$inject = ['$translate', '$interpolate', '$compile', '$parse', '$rootScope'];\n translateAttrDirective.$inject = ['$translate', '$rootScope'];\n translateCloakDirective.$inject = ['$translate', '$rootScope'];\n translateFilterFactory.$inject = ['$parse', '$translate'];\n $translationCache.$inject = ['$cacheFactory'];\n angular.module('pascalprecht.translate', ['ng']).run(runTranslate);\n function runTranslate($translate) {\n var key = $translate.storageKey(),\n storage = $translate.storage();\n var fallbackFromIncorrectStorageValue = function () {\n var preferred = $translate.preferredLanguage();\n if (angular.isString(preferred)) {\n $translate.use(preferred);\n } else {\n storage.put(key, $translate.use());\n }\n };\n fallbackFromIncorrectStorageValue.displayName = 'fallbackFromIncorrectStorageValue';\n if (storage) {\n if (!storage.get(key)) {\n fallbackFromIncorrectStorageValue();\n } else {\n $translate.use(storage.get(key))['catch'](fallbackFromIncorrectStorageValue);\n }\n } else if (angular.isString($translate.preferredLanguage())) {\n $translate.use($translate.preferredLanguage());\n }\n }\n runTranslate.displayName = 'runTranslate';\n angular.module('pascalprecht.translate').provider('$translateSanitization', $translateSanitizationProvider);\n function $translateSanitizationProvider() {\n var $sanitize,\n $sce,\n currentStrategy = null,\n hasConfiguredStrategy = false,\n hasShownNoStrategyConfiguredWarning = false,\n strategies;\n strategies = {\n sanitize: function (value, mode\n ) {\n if (mode === 'text') {\n value = htmlSanitizeValue(value);\n }\n return value;\n },\n escape: function (value, mode\n ) {\n if (mode === 'text') {\n value = htmlEscapeValue(value);\n }\n return value;\n },\n sanitizeParameters: function (value, mode\n ) {\n if (mode === 'params') {\n value = mapInterpolationParameters(value, htmlSanitizeValue);\n }\n return value;\n },\n escapeParameters: function (value, mode\n ) {\n if (mode === 'params') {\n value = mapInterpolationParameters(value, htmlEscapeValue);\n }\n return value;\n },\n sce: function (value, mode, context) {\n if (mode === 'text') {\n value = htmlTrustValue(value);\n } else if (mode === 'params') {\n if (context !== 'filter') {\n value = mapInterpolationParameters(value, htmlEscapeValue);\n }\n }\n return value;\n },\n sceParameters: function (value, mode\n ) {\n if (mode === 'params') {\n value = mapInterpolationParameters(value, htmlTrustValue);\n }\n return value;\n }\n };\n strategies.escaped = strategies.escapeParameters;\n this.addStrategy = function (strategyName, strategyFunction) {\n strategies[strategyName] = strategyFunction;\n return this;\n };\n this.removeStrategy = function (strategyName) {\n delete strategies[strategyName];\n return this;\n };\n this.useStrategy = function (strategy) {\n hasConfiguredStrategy = true;\n currentStrategy = strategy;\n return this;\n };\n this.$get = ['$injector', '$log', function ($injector, $log) {\n var cachedStrategyMap = {};\n var applyStrategies = function (value, mode, context, selectedStrategies) {\n angular.forEach(selectedStrategies, function (selectedStrategy) {\n if (angular.isFunction(selectedStrategy)) {\n value = selectedStrategy(value, mode, context);\n } else if (angular.isFunction(strategies[selectedStrategy])) {\n value = strategies[selectedStrategy](value, mode, context);\n } else if (angular.isString(strategies[selectedStrategy])) {\n if (!cachedStrategyMap[strategies[selectedStrategy]]) {\n try {\n cachedStrategyMap[strategies[selectedStrategy]] = $injector.get(strategies[selectedStrategy]);\n } catch (e) {\n cachedStrategyMap[strategies[selectedStrategy]] = function () {};\n throw new Error('pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: \\'' + selectedStrategy + '\\'');\n }\n }\n value = cachedStrategyMap[strategies[selectedStrategy]](value, mode, context);\n } else {\n throw new Error('pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: \\'' + selectedStrategy + '\\'');\n }\n });\n return value;\n };\n var showNoStrategyConfiguredWarning = function () {\n if (!hasConfiguredStrategy && !hasShownNoStrategyConfiguredWarning) {\n $log.warn('pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details.');\n hasShownNoStrategyConfiguredWarning = true;\n }\n };\n if ($injector.has('$sanitize')) {\n $sanitize = $injector.get('$sanitize');\n }\n if ($injector.has('$sce')) {\n $sce = $injector.get('$sce');\n }\n return {\n useStrategy: function (self) {\n return function (strategy) {\n self.useStrategy(strategy);\n };\n }(this),\n sanitize: function (value, mode, strategy, context) {\n if (!currentStrategy) {\n showNoStrategyConfiguredWarning();\n }\n if (!strategy && strategy !== null) {\n strategy = currentStrategy;\n }\n if (!strategy) {\n return value;\n }\n if (!context) {\n context = 'service';\n }\n var selectedStrategies = angular.isArray(strategy) ? strategy : [strategy];\n return applyStrategies(value, mode, context, selectedStrategies);\n }\n };\n }];\n var htmlEscapeValue = function (value) {\n var element = angular.element('
');\n element.text(value);\n return element.html();\n };\n var htmlSanitizeValue = function (value) {\n if (!$sanitize) {\n throw new Error('pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as \\'escape\\'.');\n }\n return $sanitize(value);\n };\n var htmlTrustValue = function (value) {\n if (!$sce) {\n throw new Error('pascalprecht.translate.$translateSanitization: Error cannot find $sce service.');\n }\n return $sce.trustAsHtml(value);\n };\n var mapInterpolationParameters = function (value, iteratee, stack) {\n if (angular.isDate(value)) {\n return value;\n } else if (angular.isObject(value)) {\n var result = angular.isArray(value) ? [] : {};\n if (!stack) {\n stack = [];\n } else {\n if (stack.indexOf(value) > -1) {\n throw new Error('pascalprecht.translate.$translateSanitization: Error cannot interpolate parameter due recursive object');\n }\n }\n stack.push(value);\n angular.forEach(value, function (propertyValue, propertyKey) {\n if (angular.isFunction(propertyValue)) {\n return;\n }\n result[propertyKey] = mapInterpolationParameters(propertyValue, iteratee, stack);\n });\n stack.splice(-1, 1);\n return result;\n } else if (angular.isNumber(value)) {\n return value;\n } else if (value === true || value === false) {\n return value;\n } else if (!angular.isUndefined(value) && value !== null) {\n return iteratee(value);\n } else {\n return value;\n }\n };\n }\n angular.module('pascalprecht.translate').constant('pascalprechtTranslateOverrider', {}).provider('$translate', $translate);\n function $translate($STORAGE_KEY, $windowProvider, $translateSanitizationProvider, pascalprechtTranslateOverrider) {\n var $translationTable = {},\n $preferredLanguage,\n $availableLanguageKeys = [],\n $languageKeyAliases,\n $fallbackLanguage,\n $fallbackWasString,\n $uses,\n $nextLang,\n $storageFactory,\n $storageKey = $STORAGE_KEY,\n $storagePrefix,\n $missingTranslationHandlerFactory,\n $interpolationFactory,\n $interpolatorFactories = [],\n $loaderFactory,\n $cloakClassName = 'translate-cloak',\n $loaderOptions,\n $notFoundIndicatorLeft,\n $notFoundIndicatorRight,\n $postCompilingEnabled = false,\n $forceAsyncReloadEnabled = false,\n $nestedObjectDelimeter = '.',\n $isReady = false,\n $keepContent = false,\n loaderCache,\n directivePriority = 0,\n statefulFilter = true,\n postProcessFn,\n uniformLanguageTagResolver = 'default',\n languageTagResolver = {\n 'default': function (tag) {\n return (tag || '').split('-').join('_');\n },\n java: function (tag) {\n var temp = (tag || '').split('-').join('_');\n var parts = temp.split('_');\n return parts.length > 1 ? parts[0].toLowerCase() + '_' + parts[1].toUpperCase() : temp;\n },\n bcp47: function (tag) {\n var temp = (tag || '').split('_').join('-');\n var parts = temp.split('-');\n switch (parts.length) {\n case 1:\n parts[0] = parts[0].toLowerCase();\n break;\n case 2:\n parts[0] = parts[0].toLowerCase();\n if (parts[1].length === 4) {\n parts[1] = parts[1].charAt(0).toUpperCase() + parts[1].slice(1).toLowerCase();\n } else {\n parts[1] = parts[1].toUpperCase();\n }\n break;\n case 3:\n parts[0] = parts[0].toLowerCase();\n parts[1] = parts[1].charAt(0).toUpperCase() + parts[1].slice(1).toLowerCase();\n parts[2] = parts[2].toUpperCase();\n break;\n default:\n return temp;\n }\n return parts.join('-');\n },\n 'iso639-1': function (tag) {\n var temp = (tag || '').split('_').join('-');\n var parts = temp.split('-');\n return parts[0].toLowerCase();\n }\n };\n var version = '2.18.4';\n var getFirstBrowserLanguage = function () {\n if (angular.isFunction(pascalprechtTranslateOverrider.getLocale)) {\n return pascalprechtTranslateOverrider.getLocale();\n }\n var nav = $windowProvider.$get().navigator,\n browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'],\n i,\n language;\n if (angular.isArray(nav.languages)) {\n for (i = 0; i < nav.languages.length; i++) {\n language = nav.languages[i];\n if (language && language.length) {\n return language;\n }\n }\n }\n for (i = 0; i < browserLanguagePropertyKeys.length; i++) {\n language = nav[browserLanguagePropertyKeys[i]];\n if (language && language.length) {\n return language;\n }\n }\n return null;\n };\n getFirstBrowserLanguage.displayName = 'angular-translate/service: getFirstBrowserLanguage';\n var getLocale = function () {\n var locale = getFirstBrowserLanguage() || '';\n if (languageTagResolver[uniformLanguageTagResolver]) {\n locale = languageTagResolver[uniformLanguageTagResolver](locale);\n }\n return locale;\n };\n getLocale.displayName = 'angular-translate/service: getLocale';\n var indexOf = function (array, searchElement) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === searchElement) {\n return i;\n }\n }\n return -1;\n };\n var trim = function () {\n return this.toString().replace(/^\\s+|\\s+$/g, '');\n };\n var lowercase = function (string) {\n return angular.isString(string) ? string.toLowerCase() : string;\n };\n var negotiateLocale = function (preferred) {\n if (!preferred) {\n return;\n }\n var avail = [],\n locale = lowercase(preferred),\n i = 0,\n n = $availableLanguageKeys.length;\n for (; i < n; i++) {\n avail.push(lowercase($availableLanguageKeys[i]));\n }\n i = indexOf(avail, locale);\n if (i > -1) {\n return $availableLanguageKeys[i];\n }\n if ($languageKeyAliases) {\n var alias;\n for (var langKeyAlias in $languageKeyAliases) {\n if ($languageKeyAliases.hasOwnProperty(langKeyAlias)) {\n var hasWildcardKey = false;\n var hasExactKey = Object.prototype.hasOwnProperty.call($languageKeyAliases, langKeyAlias) && lowercase(langKeyAlias) === lowercase(preferred);\n if (langKeyAlias.slice(-1) === '*') {\n hasWildcardKey = lowercase(langKeyAlias.slice(0, -1)) === lowercase(preferred.slice(0, langKeyAlias.length - 1));\n }\n if (hasExactKey || hasWildcardKey) {\n alias = $languageKeyAliases[langKeyAlias];\n if (indexOf(avail, lowercase(alias)) > -1) {\n return alias;\n }\n }\n }\n }\n }\n var parts = preferred.split('_');\n if (parts.length > 1 && indexOf(avail, lowercase(parts[0])) > -1) {\n return parts[0];\n }\n return;\n };\n var translations = function (langKey, translationTable) {\n if (!langKey && !translationTable) {\n return $translationTable;\n }\n if (langKey && !translationTable) {\n if (angular.isString(langKey)) {\n return $translationTable[langKey];\n }\n } else {\n if (!angular.isObject($translationTable[langKey])) {\n $translationTable[langKey] = {};\n }\n angular.extend($translationTable[langKey], flatObject(translationTable));\n }\n return this;\n };\n this.translations = translations;\n this.cloakClassName = function (name) {\n if (!name) {\n return $cloakClassName;\n }\n $cloakClassName = name;\n return this;\n };\n this.nestedObjectDelimeter = function (delimiter) {\n if (!delimiter) {\n return $nestedObjectDelimeter;\n }\n $nestedObjectDelimeter = delimiter;\n return this;\n };\n var flatObject = function (data, path, result, prevKey) {\n var key, keyWithPath, keyWithShortPath, val;\n if (!path) {\n path = [];\n }\n if (!result) {\n result = {};\n }\n for (key in data) {\n if (!Object.prototype.hasOwnProperty.call(data, key)) {\n continue;\n }\n val = data[key];\n if (angular.isObject(val)) {\n flatObject(val, path.concat(key), result, key);\n } else {\n keyWithPath = path.length ? '' + path.join($nestedObjectDelimeter) + $nestedObjectDelimeter + key : key;\n if (path.length && key === prevKey) {\n keyWithShortPath = '' + path.join($nestedObjectDelimeter);\n result[keyWithShortPath] = '@:' + keyWithPath;\n }\n result[keyWithPath] = val;\n }\n }\n return result;\n };\n flatObject.displayName = 'flatObject';\n this.addInterpolation = function (factory) {\n $interpolatorFactories.push(factory);\n return this;\n };\n this.useMessageFormatInterpolation = function () {\n return this.useInterpolation('$translateMessageFormatInterpolation');\n };\n this.useInterpolation = function (factory) {\n $interpolationFactory = factory;\n return this;\n };\n this.useSanitizeValueStrategy = function (value) {\n $translateSanitizationProvider.useStrategy(value);\n return this;\n };\n this.preferredLanguage = function (langKey) {\n if (langKey) {\n setupPreferredLanguage(langKey);\n return this;\n }\n return $preferredLanguage;\n };\n var setupPreferredLanguage = function (langKey) {\n if (langKey) {\n $preferredLanguage = langKey;\n }\n return $preferredLanguage;\n };\n this.translationNotFoundIndicator = function (indicator) {\n this.translationNotFoundIndicatorLeft(indicator);\n this.translationNotFoundIndicatorRight(indicator);\n return this;\n };\n this.translationNotFoundIndicatorLeft = function (indicator) {\n if (!indicator) {\n return $notFoundIndicatorLeft;\n }\n $notFoundIndicatorLeft = indicator;\n return this;\n };\n this.translationNotFoundIndicatorRight = function (indicator) {\n if (!indicator) {\n return $notFoundIndicatorRight;\n }\n $notFoundIndicatorRight = indicator;\n return this;\n };\n this.fallbackLanguage = function (langKey) {\n fallbackStack(langKey);\n return this;\n };\n var fallbackStack = function (langKey) {\n if (langKey) {\n if (angular.isString(langKey)) {\n $fallbackWasString = true;\n $fallbackLanguage = [langKey];\n } else if (angular.isArray(langKey)) {\n $fallbackWasString = false;\n $fallbackLanguage = langKey;\n }\n if (angular.isString($preferredLanguage) && indexOf($fallbackLanguage, $preferredLanguage) < 0) {\n $fallbackLanguage.push($preferredLanguage);\n }\n return this;\n } else {\n if ($fallbackWasString) {\n return $fallbackLanguage[0];\n } else {\n return $fallbackLanguage;\n }\n }\n };\n this.use = function (langKey) {\n if (langKey) {\n if (!$translationTable[langKey] && !$loaderFactory) {\n throw new Error('$translateProvider couldn\\'t find translationTable for langKey: \\'' + langKey + '\\'');\n }\n $uses = langKey;\n return this;\n }\n return $uses;\n };\n this.resolveClientLocale = function () {\n return getLocale();\n };\n var storageKey = function (key) {\n if (!key) {\n if ($storagePrefix) {\n return $storagePrefix + $storageKey;\n }\n return $storageKey;\n }\n $storageKey = key;\n return this;\n };\n this.storageKey = storageKey;\n this.useUrlLoader = function (url, options) {\n return this.useLoader('$translateUrlLoader', angular.extend({\n url: url\n }, options));\n };\n this.useStaticFilesLoader = function (options) {\n return this.useLoader('$translateStaticFilesLoader', options);\n };\n this.useLoader = function (loaderFactory, options) {\n $loaderFactory = loaderFactory;\n $loaderOptions = options || {};\n return this;\n };\n this.useLocalStorage = function () {\n return this.useStorage('$translateLocalStorage');\n };\n this.useCookieStorage = function () {\n return this.useStorage('$translateCookieStorage');\n };\n this.useStorage = function (storageFactory) {\n $storageFactory = storageFactory;\n return this;\n };\n this.storagePrefix = function (prefix) {\n if (!prefix) {\n return prefix;\n }\n $storagePrefix = prefix;\n return this;\n };\n this.useMissingTranslationHandlerLog = function () {\n return this.useMissingTranslationHandler('$translateMissingTranslationHandlerLog');\n };\n this.useMissingTranslationHandler = function (factory) {\n $missingTranslationHandlerFactory = factory;\n return this;\n };\n this.usePostCompiling = function (value) {\n $postCompilingEnabled = !!value;\n return this;\n };\n this.forceAsyncReload = function (value) {\n $forceAsyncReloadEnabled = !!value;\n return this;\n };\n this.uniformLanguageTag = function (options) {\n if (!options) {\n options = {};\n } else if (angular.isString(options)) {\n options = {\n standard: options\n };\n }\n uniformLanguageTagResolver = options.standard;\n return this;\n };\n this.determinePreferredLanguage = function (fn) {\n var locale = fn && angular.isFunction(fn) ? fn() : getLocale();\n if (!$availableLanguageKeys.length) {\n $preferredLanguage = locale;\n } else {\n $preferredLanguage = negotiateLocale(locale) || locale;\n }\n return this;\n };\n this.registerAvailableLanguageKeys = function (languageKeys, aliases) {\n if (languageKeys) {\n $availableLanguageKeys = languageKeys;\n if (aliases) {\n $languageKeyAliases = aliases;\n }\n return this;\n }\n return $availableLanguageKeys;\n };\n this.useLoaderCache = function (cache) {\n if (cache === false) {\n loaderCache = undefined;\n } else if (cache === true) {\n loaderCache = true;\n } else if (typeof cache === 'undefined') {\n loaderCache = '$translationCache';\n } else if (cache) {\n loaderCache = cache;\n }\n return this;\n };\n this.directivePriority = function (priority) {\n if (priority === undefined) {\n return directivePriority;\n } else {\n directivePriority = priority;\n return this;\n }\n };\n this.statefulFilter = function (state) {\n if (state === undefined) {\n return statefulFilter;\n } else {\n statefulFilter = state;\n return this;\n }\n };\n this.postProcess = function (fn) {\n if (fn) {\n postProcessFn = fn;\n } else {\n postProcessFn = undefined;\n }\n return this;\n };\n this.keepContent = function (value) {\n $keepContent = !!value;\n return this;\n };\n this.$get = ['$log', '$injector', '$rootScope', '$q', function ($log, $injector, $rootScope, $q) {\n var Storage,\n defaultInterpolator = $injector.get($interpolationFactory || '$translateDefaultInterpolation'),\n pendingLoader = false,\n interpolatorHashMap = {},\n langPromises = {},\n fallbackIndex,\n startFallbackIteration;\n var $translate = function (translationId, interpolateParams, interpolationId, defaultTranslationText, forceLanguage, sanitizeStrategy) {\n if (!$uses && $preferredLanguage) {\n $uses = $preferredLanguage;\n }\n var uses = forceLanguage && forceLanguage !== $uses ?\n negotiateLocale(forceLanguage) || forceLanguage : $uses;\n if (forceLanguage) {\n loadTranslationsIfMissing(forceLanguage);\n }\n if (angular.isArray(translationId)) {\n var translateAll = function (translationIds) {\n var results = {};\n var promises = [];\n var translate = function (translationId) {\n var deferred = $q.defer();\n var regardless = function (value) {\n results[translationId] = value;\n deferred.resolve([translationId, value]);\n };\n $translate(translationId, interpolateParams, interpolationId, defaultTranslationText, forceLanguage, sanitizeStrategy).then(regardless, regardless);\n return deferred.promise;\n };\n for (var i = 0, c = translationIds.length; i < c; i++) {\n promises.push(translate(translationIds[i]));\n }\n return $q.all(promises).then(function () {\n return results;\n });\n };\n return translateAll(translationId);\n }\n var deferred = $q.defer();\n if (translationId) {\n translationId = trim.apply(translationId);\n } else {\n throw new TypeError('translationId must be a not empty string');\n }\n var promiseToWaitFor = function () {\n var promise = langPromises[uses] || langPromises[$preferredLanguage];\n fallbackIndex = 0;\n if ($storageFactory && !promise) {\n var langKey = Storage.get($storageKey);\n promise = langPromises[langKey];\n if ($fallbackLanguage && $fallbackLanguage.length) {\n var index = indexOf($fallbackLanguage, langKey);\n fallbackIndex = index === 0 ? 1 : 0;\n if (indexOf($fallbackLanguage, $preferredLanguage) < 0) {\n $fallbackLanguage.push($preferredLanguage);\n }\n }\n }\n return promise;\n }();\n if (!promiseToWaitFor) {\n determineTranslation(translationId, interpolateParams, interpolationId, defaultTranslationText, uses, sanitizeStrategy).then(deferred.resolve, deferred.reject);\n } else {\n var promiseResolved = function () {\n if (!forceLanguage) {\n uses = $uses;\n }\n determineTranslation(translationId, interpolateParams, interpolationId, defaultTranslationText, uses, sanitizeStrategy).then(deferred.resolve, deferred.reject);\n };\n promiseResolved.displayName = 'promiseResolved';\n promiseToWaitFor['finally'](promiseResolved)['catch'](angular.noop);\n }\n return deferred.promise;\n };\n var applyNotFoundIndicators = function (translationId) {\n if ($notFoundIndicatorLeft) {\n translationId = [$notFoundIndicatorLeft, translationId].join(' ');\n }\n if ($notFoundIndicatorRight) {\n translationId = [translationId, $notFoundIndicatorRight].join(' ');\n }\n return translationId;\n };\n var useLanguage = function (key) {\n $uses = key;\n if ($storageFactory) {\n Storage.put($translate.storageKey(), $uses);\n }\n $rootScope.$emit('$translateChangeSuccess', {\n language: key\n });\n defaultInterpolator.setLocale($uses);\n var eachInterpolator = function (interpolator, id) {\n interpolatorHashMap[id].setLocale($uses);\n };\n eachInterpolator.displayName = 'eachInterpolatorLocaleSetter';\n angular.forEach(interpolatorHashMap, eachInterpolator);\n $rootScope.$emit('$translateChangeEnd', {\n language: key\n });\n };\n var loadAsync = function (key) {\n if (!key) {\n throw 'No language key specified for loading.';\n }\n var deferred = $q.defer();\n $rootScope.$emit('$translateLoadingStart', {\n language: key\n });\n pendingLoader = true;\n var cache = loaderCache;\n if (typeof cache === 'string') {\n cache = $injector.get(cache);\n }\n var loaderOptions = angular.extend({}, $loaderOptions, {\n key: key,\n $http: angular.extend({}, {\n cache: cache\n }, $loaderOptions.$http)\n });\n var onLoaderSuccess = function (data) {\n var translationTable = {};\n $rootScope.$emit('$translateLoadingSuccess', {\n language: key\n });\n if (angular.isArray(data)) {\n angular.forEach(data, function (table) {\n angular.extend(translationTable, flatObject(table));\n });\n } else {\n angular.extend(translationTable, flatObject(data));\n }\n pendingLoader = false;\n deferred.resolve({\n key: key,\n table: translationTable\n });\n $rootScope.$emit('$translateLoadingEnd', {\n language: key\n });\n };\n onLoaderSuccess.displayName = 'onLoaderSuccess';\n var onLoaderError = function (key) {\n $rootScope.$emit('$translateLoadingError', {\n language: key\n });\n deferred.reject(key);\n $rootScope.$emit('$translateLoadingEnd', {\n language: key\n });\n };\n onLoaderError.displayName = 'onLoaderError';\n $injector.get($loaderFactory)(loaderOptions).then(onLoaderSuccess, onLoaderError);\n return deferred.promise;\n };\n if ($storageFactory) {\n Storage = $injector.get($storageFactory);\n if (!Storage.get || !Storage.put) {\n throw new Error('Couldn\\'t use storage \\'' + $storageFactory + '\\', missing get() or put() method!');\n }\n }\n if ($interpolatorFactories.length) {\n var eachInterpolationFactory = function (interpolatorFactory) {\n var interpolator = $injector.get(interpolatorFactory);\n interpolator.setLocale($preferredLanguage || $uses);\n interpolatorHashMap[interpolator.getInterpolationIdentifier()] = interpolator;\n };\n eachInterpolationFactory.displayName = 'interpolationFactoryAdder';\n angular.forEach($interpolatorFactories, eachInterpolationFactory);\n }\n var getTranslationTable = function (langKey) {\n var deferred = $q.defer();\n if (Object.prototype.hasOwnProperty.call($translationTable, langKey)) {\n deferred.resolve($translationTable[langKey]);\n } else if (langPromises[langKey]) {\n var onResolve = function (data) {\n translations(data.key, data.table);\n deferred.resolve(data.table);\n };\n onResolve.displayName = 'translationTableResolver';\n langPromises[langKey].then(onResolve, deferred.reject);\n } else {\n deferred.reject();\n }\n return deferred.promise;\n };\n var getFallbackTranslation = function (langKey, translationId, interpolateParams, Interpolator, sanitizeStrategy) {\n var deferred = $q.defer();\n var onResolve = function (translationTable) {\n if (Object.prototype.hasOwnProperty.call(translationTable, translationId) && translationTable[translationId] !== null) {\n Interpolator.setLocale(langKey);\n var translation = translationTable[translationId];\n if (translation.substr(0, 2) === '@:') {\n getFallbackTranslation(langKey, translation.substr(2), interpolateParams, Interpolator, sanitizeStrategy).then(deferred.resolve, deferred.reject);\n } else {\n var interpolatedValue = Interpolator.interpolate(translationTable[translationId], interpolateParams, 'service', sanitizeStrategy, translationId);\n interpolatedValue = applyPostProcessing(translationId, translationTable[translationId], interpolatedValue, interpolateParams, langKey);\n deferred.resolve(interpolatedValue);\n }\n Interpolator.setLocale($uses);\n } else {\n deferred.reject();\n }\n };\n onResolve.displayName = 'fallbackTranslationResolver';\n getTranslationTable(langKey).then(onResolve, deferred.reject);\n return deferred.promise;\n };\n var getFallbackTranslationInstant = function (langKey, translationId, interpolateParams, Interpolator, sanitizeStrategy) {\n var result,\n translationTable = $translationTable[langKey];\n if (translationTable && Object.prototype.hasOwnProperty.call(translationTable, translationId) && translationTable[translationId] !== null) {\n Interpolator.setLocale(langKey);\n result = Interpolator.interpolate(translationTable[translationId], interpolateParams, 'filter', sanitizeStrategy, translationId);\n result = applyPostProcessing(translationId, translationTable[translationId], result, interpolateParams, langKey, sanitizeStrategy);\n if (!angular.isString(result) && angular.isFunction(result.$$unwrapTrustedValue)) {\n var result2 = result.$$unwrapTrustedValue();\n if (result2.substr(0, 2) === '@:') {\n return getFallbackTranslationInstant(langKey, result2.substr(2), interpolateParams, Interpolator, sanitizeStrategy);\n }\n } else if (result.substr(0, 2) === '@:') {\n return getFallbackTranslationInstant(langKey, result.substr(2), interpolateParams, Interpolator, sanitizeStrategy);\n }\n Interpolator.setLocale($uses);\n }\n return result;\n };\n var translateByHandler = function (translationId, interpolateParams, defaultTranslationText, sanitizeStrategy) {\n if ($missingTranslationHandlerFactory) {\n return $injector.get($missingTranslationHandlerFactory)(translationId, $uses, interpolateParams, defaultTranslationText, sanitizeStrategy);\n } else {\n return translationId;\n }\n };\n var resolveForFallbackLanguage = function (fallbackLanguageIndex, translationId, interpolateParams, Interpolator, defaultTranslationText, sanitizeStrategy) {\n var deferred = $q.defer();\n if (fallbackLanguageIndex < $fallbackLanguage.length) {\n var langKey = $fallbackLanguage[fallbackLanguageIndex];\n getFallbackTranslation(langKey, translationId, interpolateParams, Interpolator, sanitizeStrategy).then(function (data) {\n deferred.resolve(data);\n }, function () {\n return resolveForFallbackLanguage(fallbackLanguageIndex + 1, translationId, interpolateParams, Interpolator, defaultTranslationText, sanitizeStrategy).then(deferred.resolve, deferred.reject);\n });\n } else {\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n var missingTranslationHandlerTranslation = translateByHandler(translationId, interpolateParams, defaultTranslationText);\n if ($missingTranslationHandlerFactory && missingTranslationHandlerTranslation) {\n deferred.resolve(missingTranslationHandlerTranslation);\n } else {\n deferred.reject(applyNotFoundIndicators(translationId));\n }\n }\n }\n return deferred.promise;\n };\n var resolveForFallbackLanguageInstant = function (fallbackLanguageIndex, translationId, interpolateParams, Interpolator, sanitizeStrategy) {\n var result;\n if (fallbackLanguageIndex < $fallbackLanguage.length) {\n var langKey = $fallbackLanguage[fallbackLanguageIndex];\n result = getFallbackTranslationInstant(langKey, translationId, interpolateParams, Interpolator, sanitizeStrategy);\n if (!result && result !== '') {\n result = resolveForFallbackLanguageInstant(fallbackLanguageIndex + 1, translationId, interpolateParams, Interpolator);\n }\n }\n return result;\n };\n var fallbackTranslation = function (translationId, interpolateParams, Interpolator, defaultTranslationText, sanitizeStrategy) {\n return resolveForFallbackLanguage(startFallbackIteration > 0 ? startFallbackIteration : fallbackIndex, translationId, interpolateParams, Interpolator, defaultTranslationText, sanitizeStrategy);\n };\n var fallbackTranslationInstant = function (translationId, interpolateParams, Interpolator, sanitizeStrategy) {\n return resolveForFallbackLanguageInstant(startFallbackIteration > 0 ? startFallbackIteration : fallbackIndex, translationId, interpolateParams, Interpolator, sanitizeStrategy);\n };\n var determineTranslation = function (translationId, interpolateParams, interpolationId, defaultTranslationText, uses, sanitizeStrategy) {\n var deferred = $q.defer();\n var table = uses ? $translationTable[uses] : $translationTable,\n Interpolator = interpolationId ? interpolatorHashMap[interpolationId] : defaultInterpolator;\n if (table && Object.prototype.hasOwnProperty.call(table, translationId) && table[translationId] !== null) {\n var translation = table[translationId];\n if (translation.substr(0, 2) === '@:') {\n $translate(translation.substr(2), interpolateParams, interpolationId, defaultTranslationText, uses, sanitizeStrategy).then(deferred.resolve, deferred.reject);\n } else {\n var resolvedTranslation = Interpolator.interpolate(translation, interpolateParams, 'service', sanitizeStrategy, translationId);\n resolvedTranslation = applyPostProcessing(translationId, translation, resolvedTranslation, interpolateParams, uses);\n deferred.resolve(resolvedTranslation);\n }\n } else {\n var missingTranslationHandlerTranslation;\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n missingTranslationHandlerTranslation = translateByHandler(translationId, interpolateParams, defaultTranslationText);\n }\n if (uses && $fallbackLanguage && $fallbackLanguage.length) {\n fallbackTranslation(translationId, interpolateParams, Interpolator, defaultTranslationText, sanitizeStrategy).then(function (translation) {\n deferred.resolve(translation);\n }, function (_translationId) {\n deferred.reject(applyNotFoundIndicators(_translationId));\n });\n } else if ($missingTranslationHandlerFactory && !pendingLoader && missingTranslationHandlerTranslation) {\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n deferred.resolve(missingTranslationHandlerTranslation);\n }\n } else {\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n deferred.reject(applyNotFoundIndicators(translationId));\n }\n }\n }\n return deferred.promise;\n };\n var determineTranslationInstant = function (translationId, interpolateParams, interpolationId, uses, sanitizeStrategy) {\n var result,\n table = uses ? $translationTable[uses] : $translationTable,\n Interpolator = defaultInterpolator;\n if (interpolatorHashMap && Object.prototype.hasOwnProperty.call(interpolatorHashMap, interpolationId)) {\n Interpolator = interpolatorHashMap[interpolationId];\n }\n if (table && Object.prototype.hasOwnProperty.call(table, translationId) && table[translationId] !== null) {\n var translation = table[translationId];\n if (translation.substr(0, 2) === '@:') {\n result = determineTranslationInstant(translation.substr(2), interpolateParams, interpolationId, uses, sanitizeStrategy);\n } else {\n result = Interpolator.interpolate(translation, interpolateParams, 'filter', sanitizeStrategy, translationId);\n result = applyPostProcessing(translationId, translation, result, interpolateParams, uses, sanitizeStrategy);\n }\n } else {\n var missingTranslationHandlerTranslation;\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n missingTranslationHandlerTranslation = translateByHandler(translationId, interpolateParams, sanitizeStrategy);\n }\n if (uses && $fallbackLanguage && $fallbackLanguage.length) {\n fallbackIndex = 0;\n result = fallbackTranslationInstant(translationId, interpolateParams, Interpolator, sanitizeStrategy);\n } else if ($missingTranslationHandlerFactory && !pendingLoader && missingTranslationHandlerTranslation) {\n result = missingTranslationHandlerTranslation;\n } else {\n result = applyNotFoundIndicators(translationId);\n }\n }\n return result;\n };\n var clearNextLangAndPromise = function (key) {\n if ($nextLang === key) {\n $nextLang = undefined;\n }\n langPromises[key] = undefined;\n };\n var applyPostProcessing = function (translationId, translation, resolvedTranslation, interpolateParams, uses, sanitizeStrategy) {\n var fn = postProcessFn;\n if (fn) {\n if (typeof fn === 'string') {\n fn = $injector.get(fn);\n }\n if (fn) {\n return fn(translationId, translation, resolvedTranslation, interpolateParams, uses, sanitizeStrategy);\n }\n }\n return resolvedTranslation;\n };\n var loadTranslationsIfMissing = function (key) {\n if (!$translationTable[key] && $loaderFactory && !langPromises[key]) {\n langPromises[key] = loadAsync(key).then(function (translation) {\n translations(translation.key, translation.table);\n return translation;\n });\n }\n };\n $translate.preferredLanguage = function (langKey) {\n if (langKey) {\n setupPreferredLanguage(langKey);\n }\n return $preferredLanguage;\n };\n $translate.cloakClassName = function () {\n return $cloakClassName;\n };\n $translate.nestedObjectDelimeter = function () {\n return $nestedObjectDelimeter;\n };\n $translate.fallbackLanguage = function (langKey) {\n if (langKey !== undefined && langKey !== null) {\n fallbackStack(langKey);\n if ($loaderFactory) {\n if ($fallbackLanguage && $fallbackLanguage.length) {\n for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {\n if (!langPromises[$fallbackLanguage[i]]) {\n langPromises[$fallbackLanguage[i]] = loadAsync($fallbackLanguage[i]);\n }\n }\n }\n }\n $translate.use($translate.use());\n }\n if ($fallbackWasString) {\n return $fallbackLanguage[0];\n } else {\n return $fallbackLanguage;\n }\n };\n $translate.useFallbackLanguage = function (langKey) {\n if (langKey !== undefined && langKey !== null) {\n if (!langKey) {\n startFallbackIteration = 0;\n } else {\n var langKeyPosition = indexOf($fallbackLanguage, langKey);\n if (langKeyPosition > -1) {\n startFallbackIteration = langKeyPosition;\n }\n }\n }\n };\n $translate.proposedLanguage = function () {\n return $nextLang;\n };\n $translate.storage = function () {\n return Storage;\n };\n $translate.negotiateLocale = negotiateLocale;\n $translate.use = function (key) {\n if (!key) {\n return $uses;\n }\n var deferred = $q.defer();\n deferred.promise.then(null, angular.noop);\n $rootScope.$emit('$translateChangeStart', {\n language: key\n });\n var aliasedKey = negotiateLocale(key);\n if ($availableLanguageKeys.length > 0 && !aliasedKey) {\n return $q.reject(key);\n }\n if (aliasedKey) {\n key = aliasedKey;\n }\n $nextLang = key;\n if (($forceAsyncReloadEnabled || !$translationTable[key]) && $loaderFactory && !langPromises[key]) {\n langPromises[key] = loadAsync(key).then(function (translation) {\n translations(translation.key, translation.table);\n deferred.resolve(translation.key);\n if ($nextLang === key) {\n useLanguage(translation.key);\n }\n return translation;\n }, function (key) {\n $rootScope.$emit('$translateChangeError', {\n language: key\n });\n deferred.reject(key);\n $rootScope.$emit('$translateChangeEnd', {\n language: key\n });\n return $q.reject(key);\n });\n langPromises[key]['finally'](function () {\n clearNextLangAndPromise(key);\n })['catch'](angular.noop);\n } else if (langPromises[key]) {\n langPromises[key].then(function (translation) {\n if ($nextLang === translation.key) {\n useLanguage(translation.key);\n }\n deferred.resolve(translation.key);\n return translation;\n }, function (key) {\n if (!$uses && $fallbackLanguage && $fallbackLanguage.length > 0 && $fallbackLanguage[0] !== key) {\n return $translate.use($fallbackLanguage[0]).then(deferred.resolve, deferred.reject);\n } else {\n return deferred.reject(key);\n }\n });\n } else {\n deferred.resolve(key);\n useLanguage(key);\n }\n return deferred.promise;\n };\n $translate.resolveClientLocale = function () {\n return getLocale();\n };\n $translate.storageKey = function () {\n return storageKey();\n };\n $translate.isPostCompilingEnabled = function () {\n return $postCompilingEnabled;\n };\n $translate.isForceAsyncReloadEnabled = function () {\n return $forceAsyncReloadEnabled;\n };\n $translate.isKeepContent = function () {\n return $keepContent;\n };\n $translate.refresh = function (langKey) {\n if (!$loaderFactory) {\n throw new Error('Couldn\\'t refresh translation table, no loader registered!');\n }\n $rootScope.$emit('$translateRefreshStart', {\n language: langKey\n });\n var deferred = $q.defer(),\n updatedLanguages = {};\n function loadNewData(languageKey) {\n var promise = loadAsync(languageKey);\n langPromises[languageKey] = promise;\n promise.then(function (data) {\n $translationTable[languageKey] = {};\n translations(languageKey, data.table);\n updatedLanguages[languageKey] = true;\n },\n angular.noop);\n return promise;\n }\n deferred.promise.then(function () {\n for (var key in $translationTable) {\n if ($translationTable.hasOwnProperty(key)) {\n if (!(key in updatedLanguages)) {\n delete $translationTable[key];\n }\n }\n }\n if ($uses) {\n useLanguage($uses);\n }\n },\n angular.noop)['finally'](function () {\n $rootScope.$emit('$translateRefreshEnd', {\n language: langKey\n });\n });\n if (!langKey) {\n var languagesToReload = $fallbackLanguage && $fallbackLanguage.slice() || [];\n if ($uses && languagesToReload.indexOf($uses) === -1) {\n languagesToReload.push($uses);\n }\n $q.all(languagesToReload.map(loadNewData)).then(deferred.resolve, deferred.reject);\n } else if ($translationTable[langKey]) {\n loadNewData(langKey).then(deferred.resolve, deferred.reject);\n } else {\n deferred.reject();\n }\n return deferred.promise;\n };\n $translate.instant = function (translationId, interpolateParams, interpolationId, forceLanguage, sanitizeStrategy) {\n var uses = forceLanguage && forceLanguage !== $uses ?\n negotiateLocale(forceLanguage) || forceLanguage : $uses;\n if (translationId === null || angular.isUndefined(translationId)) {\n return translationId;\n }\n if (forceLanguage) {\n loadTranslationsIfMissing(forceLanguage);\n }\n if (angular.isArray(translationId)) {\n var results = {};\n for (var i = 0, c = translationId.length; i < c; i++) {\n results[translationId[i]] = $translate.instant(translationId[i], interpolateParams, interpolationId, forceLanguage, sanitizeStrategy);\n }\n return results;\n }\n if (angular.isString(translationId) && translationId.length < 1) {\n return translationId;\n }\n if (translationId) {\n translationId = trim.apply(translationId);\n }\n var result,\n possibleLangKeys = [];\n if ($preferredLanguage) {\n possibleLangKeys.push($preferredLanguage);\n }\n if (uses) {\n possibleLangKeys.push(uses);\n }\n if ($fallbackLanguage && $fallbackLanguage.length) {\n possibleLangKeys = possibleLangKeys.concat($fallbackLanguage);\n }\n for (var j = 0, d = possibleLangKeys.length; j < d; j++) {\n var possibleLangKey = possibleLangKeys[j];\n if ($translationTable[possibleLangKey]) {\n if (typeof $translationTable[possibleLangKey][translationId] !== 'undefined') {\n result = determineTranslationInstant(translationId, interpolateParams, interpolationId, uses, sanitizeStrategy);\n }\n }\n if (typeof result !== 'undefined') {\n break;\n }\n }\n if (!result && result !== '') {\n if ($notFoundIndicatorLeft || $notFoundIndicatorRight) {\n result = applyNotFoundIndicators(translationId);\n } else {\n result = defaultInterpolator.interpolate(translationId, interpolateParams, 'filter', sanitizeStrategy);\n var missingTranslationHandlerTranslation;\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n missingTranslationHandlerTranslation = translateByHandler(translationId, interpolateParams, sanitizeStrategy);\n }\n if ($missingTranslationHandlerFactory && !pendingLoader && missingTranslationHandlerTranslation) {\n result = missingTranslationHandlerTranslation;\n }\n }\n }\n return result;\n };\n $translate.versionInfo = function () {\n return version;\n };\n $translate.loaderCache = function () {\n return loaderCache;\n };\n $translate.directivePriority = function () {\n return directivePriority;\n };\n $translate.statefulFilter = function () {\n return statefulFilter;\n };\n $translate.isReady = function () {\n return $isReady;\n };\n var $onReadyDeferred = $q.defer();\n $onReadyDeferred.promise.then(function () {\n $isReady = true;\n });\n $translate.onReady = function (fn) {\n var deferred = $q.defer();\n if (angular.isFunction(fn)) {\n deferred.promise.then(fn);\n }\n if ($isReady) {\n deferred.resolve();\n } else {\n $onReadyDeferred.promise.then(deferred.resolve);\n }\n return deferred.promise;\n };\n $translate.getAvailableLanguageKeys = function () {\n if ($availableLanguageKeys.length > 0) {\n return $availableLanguageKeys;\n }\n return null;\n };\n $translate.getTranslationTable = function (langKey) {\n langKey = langKey || $translate.use();\n if (langKey && $translationTable[langKey]) {\n return angular.copy($translationTable[langKey]);\n }\n return null;\n };\n var globalOnReadyListener = $rootScope.$on('$translateReady', function () {\n $onReadyDeferred.resolve();\n globalOnReadyListener();\n globalOnReadyListener = null;\n });\n var globalOnChangeListener = $rootScope.$on('$translateChangeEnd', function () {\n $onReadyDeferred.resolve();\n globalOnChangeListener();\n globalOnChangeListener = null;\n });\n if ($loaderFactory) {\n if (angular.equals($translationTable, {})) {\n if ($translate.use()) {\n $translate.use($translate.use());\n }\n }\n if ($fallbackLanguage && $fallbackLanguage.length) {\n var processAsyncResult = function (translation) {\n translations(translation.key, translation.table);\n $rootScope.$emit('$translateChangeEnd', {\n language: translation.key\n });\n return translation;\n };\n for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {\n var fallbackLanguageId = $fallbackLanguage[i];\n if ($forceAsyncReloadEnabled || !$translationTable[fallbackLanguageId]) {\n langPromises[fallbackLanguageId] = loadAsync(fallbackLanguageId).then(processAsyncResult);\n }\n }\n }\n } else {\n $rootScope.$emit('$translateReady', {\n language: $translate.use()\n });\n }\n return $translate;\n }];\n }\n $translate.displayName = 'displayName';\n angular.module('pascalprecht.translate').factory('$translateDefaultInterpolation', $translateDefaultInterpolation);\n function $translateDefaultInterpolation($interpolate, $translateSanitization) {\n var $translateInterpolator = {},\n $identifier = 'default';\n $translateInterpolator.setLocale = function (locale) {\n };\n $translateInterpolator.getInterpolationIdentifier = function () {\n return $identifier;\n };\n $translateInterpolator.useSanitizeValueStrategy = function (value) {\n $translateSanitization.useStrategy(value);\n return this;\n };\n $translateInterpolator.interpolate = function (value, interpolationParams, context, sanitizeStrategy, translationId) {\n interpolationParams = interpolationParams || {};\n interpolationParams = $translateSanitization.sanitize(interpolationParams, 'params', sanitizeStrategy, context);\n var interpolatedText;\n if (angular.isNumber(value)) {\n interpolatedText = '' + value;\n } else if (angular.isString(value)) {\n interpolatedText = $interpolate(value)(interpolationParams);\n interpolatedText = $translateSanitization.sanitize(interpolatedText, 'text', sanitizeStrategy, context);\n } else {\n interpolatedText = '';\n }\n return interpolatedText;\n };\n return $translateInterpolator;\n }\n $translateDefaultInterpolation.displayName = '$translateDefaultInterpolation';\n angular.module('pascalprecht.translate').constant('$STORAGE_KEY', 'NG_TRANSLATE_LANG_KEY');\n angular.module('pascalprecht.translate')\n .directive('translate', translateDirective);\n function translateDirective($translate, $interpolate, $compile, $parse, $rootScope) {\n var trim = function () {\n return this.toString().replace(/^\\s+|\\s+$/g, '');\n };\n var lowercase = function (string) {\n return angular.isString(string) ? string.toLowerCase() : string;\n };\n return {\n restrict: 'AE',\n scope: true,\n priority: $translate.directivePriority(),\n compile: function (tElement, tAttr) {\n var translateValuesExist = tAttr.translateValues ? tAttr.translateValues : undefined;\n var translateInterpolation = tAttr.translateInterpolation ? tAttr.translateInterpolation : undefined;\n var translateSanitizeStrategyExist = tAttr.translateSanitizeStrategy ? tAttr.translateSanitizeStrategy : undefined;\n var translateValueExist = tElement[0].outerHTML.match(/translate-value-+/i);\n var interpolateRegExp = '^(.*)(' + $interpolate.startSymbol() + '.*' + $interpolate.endSymbol() + ')(.*)',\n watcherRegExp = '^(.*)' + $interpolate.startSymbol() + '(.*)' + $interpolate.endSymbol() + '(.*)';\n return function linkFn(scope, iElement, iAttr) {\n scope.interpolateParams = {};\n scope.preText = '';\n scope.postText = '';\n scope.translateNamespace = getTranslateNamespace(scope);\n var translationIds = {};\n var initInterpolationParams = function (interpolateParams, iAttr, tAttr) {\n if (iAttr.translateValues) {\n angular.extend(interpolateParams, $parse(iAttr.translateValues)(scope.$parent));\n }\n if (translateValueExist) {\n for (var attr in tAttr) {\n if (Object.prototype.hasOwnProperty.call(iAttr, attr) && attr.substr(0, 14) === 'translateValue' && attr !== 'translateValues') {\n var attributeName = lowercase(attr.substr(14, 1)) + attr.substr(15);\n interpolateParams[attributeName] = tAttr[attr];\n }\n }\n }\n };\n var observeElementTranslation = function (translationId) {\n if (angular.isFunction(observeElementTranslation._unwatchOld)) {\n observeElementTranslation._unwatchOld();\n observeElementTranslation._unwatchOld = undefined;\n }\n if (angular.equals(translationId, '') || !angular.isDefined(translationId)) {\n var iElementText = trim.apply(iElement.text()).replace(/\\n/g, ' ');\n var interpolateMatches = iElementText.match(interpolateRegExp);\n if (angular.isArray(interpolateMatches)) {\n scope.preText = interpolateMatches[1];\n scope.postText = interpolateMatches[3];\n translationIds.translate = $interpolate(interpolateMatches[2])(scope.$parent);\n var watcherMatches = iElementText.match(watcherRegExp);\n if (angular.isArray(watcherMatches) && watcherMatches[2] && watcherMatches[2].length) {\n observeElementTranslation._unwatchOld = scope.$watch(watcherMatches[2], function (newValue) {\n translationIds.translate = newValue;\n updateTranslations();\n });\n }\n } else {\n translationIds.translate = !iElementText ? undefined : iElementText;\n }\n } else {\n translationIds.translate = translationId;\n }\n updateTranslations();\n };\n var observeAttributeTranslation = function (translateAttr) {\n iAttr.$observe(translateAttr, function (translationId) {\n translationIds[translateAttr] = translationId;\n updateTranslations();\n });\n };\n initInterpolationParams(scope.interpolateParams, iAttr, tAttr);\n var firstAttributeChangedEvent = true;\n iAttr.$observe('translate', function (translationId) {\n if (typeof translationId === 'undefined') {\n observeElementTranslation('');\n } else {\n if (translationId !== '' || !firstAttributeChangedEvent) {\n translationIds.translate = translationId;\n updateTranslations();\n }\n }\n firstAttributeChangedEvent = false;\n });\n for (var translateAttr in iAttr) {\n if (iAttr.hasOwnProperty(translateAttr) && translateAttr.substr(0, 13) === 'translateAttr' && translateAttr.length > 13) {\n observeAttributeTranslation(translateAttr);\n }\n }\n iAttr.$observe('translateDefault', function (value) {\n scope.defaultText = value;\n updateTranslations();\n });\n if (translateSanitizeStrategyExist) {\n iAttr.$observe('translateSanitizeStrategy', function (value) {\n scope.sanitizeStrategy = $parse(value)(scope.$parent);\n updateTranslations();\n });\n }\n if (translateValuesExist) {\n iAttr.$observe('translateValues', function (interpolateParams) {\n if (interpolateParams) {\n scope.$parent.$watch(function () {\n angular.extend(scope.interpolateParams, $parse(interpolateParams)(scope.$parent));\n });\n }\n });\n }\n if (translateValueExist) {\n var observeValueAttribute = function (attrName) {\n iAttr.$observe(attrName, function (value) {\n var attributeName = lowercase(attrName.substr(14, 1)) + attrName.substr(15);\n scope.interpolateParams[attributeName] = value;\n });\n };\n for (var attr in iAttr) {\n if (Object.prototype.hasOwnProperty.call(iAttr, attr) && attr.substr(0, 14) === 'translateValue' && attr !== 'translateValues') {\n observeValueAttribute(attr);\n }\n }\n }\n var updateTranslations = function () {\n for (var key in translationIds) {\n if (translationIds.hasOwnProperty(key) && translationIds[key] !== undefined) {\n updateTranslation(key, translationIds[key], scope, scope.interpolateParams, scope.defaultText, scope.translateNamespace);\n }\n }\n };\n var updateTranslation = function (translateAttr, translationId, scope, interpolateParams, defaultTranslationText, translateNamespace) {\n if (translationId) {\n if (translateNamespace && translationId.charAt(0) === '.') {\n translationId = translateNamespace + translationId;\n }\n $translate(translationId, interpolateParams, translateInterpolation, defaultTranslationText, scope.translateLanguage, scope.sanitizeStrategy).then(function (translation) {\n applyTranslation(translation, scope, true, translateAttr);\n }, function (translationId) {\n applyTranslation(translationId, scope, false, translateAttr);\n });\n } else {\n applyTranslation(translationId, scope, false, translateAttr);\n }\n };\n var applyTranslation = function (value, scope, successful, translateAttr) {\n if (!successful) {\n if (typeof scope.defaultText !== 'undefined') {\n value = scope.defaultText;\n }\n }\n if (translateAttr === 'translate') {\n if (successful || !successful && !$translate.isKeepContent() && typeof iAttr.translateKeepContent === 'undefined') {\n iElement.empty().append(scope.preText + value + scope.postText);\n }\n var globallyEnabled = $translate.isPostCompilingEnabled();\n var locallyDefined = typeof tAttr.translateCompile !== 'undefined';\n var locallyEnabled = locallyDefined && tAttr.translateCompile !== 'false';\n if (globallyEnabled && !locallyDefined || locallyEnabled) {\n $compile(iElement.contents())(scope);\n }\n } else {\n var attributeName = iAttr.$attr[translateAttr];\n if (attributeName.substr(0, 5) === 'data-') {\n attributeName = attributeName.substr(5);\n }\n attributeName = attributeName.substr(15);\n iElement.attr(attributeName, value);\n }\n };\n if (translateValuesExist || translateValueExist || iAttr.translateDefault) {\n scope.$watch('interpolateParams', updateTranslations, true);\n }\n scope.$on('translateLanguageChanged', updateTranslations);\n var unbind = $rootScope.$on('$translateChangeSuccess', updateTranslations);\n if (iElement.text().length) {\n if (iAttr.translate) {\n observeElementTranslation(iAttr.translate);\n } else {\n observeElementTranslation('');\n }\n } else if (iAttr.translate) {\n observeElementTranslation(iAttr.translate);\n }\n updateTranslations();\n scope.$on('$destroy', unbind);\n };\n }\n };\n }\n function getTranslateNamespace(scope) {\n if (scope.translateNamespace) {\n return scope.translateNamespace;\n }\n if (scope.$parent) {\n return getTranslateNamespace(scope.$parent);\n }\n }\n translateDirective.displayName = 'translateDirective';\n angular.module('pascalprecht.translate')\n .directive('translateAttr', translateAttrDirective);\n function translateAttrDirective($translate, $rootScope) {\n return {\n restrict: 'A',\n priority: $translate.directivePriority(),\n link: function linkFn(scope, element, attr) {\n var translateAttr,\n translateValues,\n translateSanitizeStrategy,\n previousAttributes = {};\n var updateTranslations = function () {\n angular.forEach(translateAttr, function (translationId, attributeName) {\n if (!translationId) {\n return;\n }\n previousAttributes[attributeName] = true;\n if (scope.translateNamespace && translationId.charAt(0) === '.') {\n translationId = scope.translateNamespace + translationId;\n }\n $translate(translationId, translateValues, attr.translateInterpolation, undefined, scope.translateLanguage, translateSanitizeStrategy).then(function (translation) {\n element.attr(attributeName, translation);\n }, function (translationId) {\n element.attr(attributeName, translationId);\n });\n });\n angular.forEach(previousAttributes, function (flag, attributeName) {\n if (!translateAttr[attributeName]) {\n element.removeAttr(attributeName);\n delete previousAttributes[attributeName];\n }\n });\n };\n watchAttribute(scope, attr.translateAttr, function (newValue) {\n translateAttr = newValue;\n }, updateTranslations);\n watchAttribute(scope, attr.translateValues, function (newValue) {\n translateValues = newValue;\n }, updateTranslations);\n watchAttribute(scope, attr.translateSanitizeStrategy, function (newValue) {\n translateSanitizeStrategy = newValue;\n }, updateTranslations);\n if (attr.translateValues) {\n scope.$watch(attr.translateValues, updateTranslations, true);\n }\n scope.$on('translateLanguageChanged', updateTranslations);\n var unbind = $rootScope.$on('$translateChangeSuccess', updateTranslations);\n updateTranslations();\n scope.$on('$destroy', unbind);\n }\n };\n }\n function watchAttribute(scope, attribute, valueCallback, changeCallback) {\n if (!attribute) {\n return;\n }\n if (attribute.substr(0, 2) === '::') {\n attribute = attribute.substr(2);\n } else {\n scope.$watch(attribute, function (newValue) {\n valueCallback(newValue);\n changeCallback();\n }, true);\n }\n valueCallback(scope.$eval(attribute));\n }\n translateAttrDirective.displayName = 'translateAttrDirective';\n angular.module('pascalprecht.translate')\n .directive('translateCloak', translateCloakDirective);\n function translateCloakDirective($translate, $rootScope) {\n return {\n compile: function (tElement) {\n var applyCloak = function (element) {\n element.addClass($translate.cloakClassName());\n },\n removeCloak = function (element) {\n element.removeClass($translate.cloakClassName());\n };\n applyCloak(tElement);\n return function linkFn(scope, iElement, iAttr) {\n var iRemoveCloak = removeCloak.bind(this, iElement),\n iApplyCloak = applyCloak.bind(this, iElement);\n if (iAttr.translateCloak && iAttr.translateCloak.length) {\n iAttr.$observe('translateCloak', function (translationId) {\n $translate(translationId).then(iRemoveCloak, iApplyCloak);\n });\n $rootScope.$on('$translateChangeSuccess', function () {\n $translate(iAttr.translateCloak).then(iRemoveCloak, iApplyCloak);\n });\n } else {\n $translate.onReady(iRemoveCloak);\n }\n };\n }\n };\n }\n translateCloakDirective.displayName = 'translateCloakDirective';\n angular.module('pascalprecht.translate')\n .directive('translateNamespace', translateNamespaceDirective);\n function translateNamespaceDirective() {\n return {\n restrict: 'A',\n scope: true,\n compile: function () {\n return {\n pre: function (scope, iElement, iAttrs) {\n scope.translateNamespace = _getTranslateNamespace(scope);\n if (scope.translateNamespace && iAttrs.translateNamespace.charAt(0) === '.') {\n scope.translateNamespace += iAttrs.translateNamespace;\n } else {\n scope.translateNamespace = iAttrs.translateNamespace;\n }\n }\n };\n }\n };\n }\n function _getTranslateNamespace(scope) {\n if (scope.translateNamespace) {\n return scope.translateNamespace;\n }\n if (scope.$parent) {\n return _getTranslateNamespace(scope.$parent);\n }\n }\n translateNamespaceDirective.displayName = 'translateNamespaceDirective';\n angular.module('pascalprecht.translate')\n .directive('translateLanguage', translateLanguageDirective);\n function translateLanguageDirective() {\n return {\n restrict: 'A',\n scope: true,\n compile: function () {\n return function linkFn(scope, iElement, iAttrs) {\n iAttrs.$observe('translateLanguage', function (newTranslateLanguage) {\n scope.translateLanguage = newTranslateLanguage;\n });\n scope.$watch('translateLanguage', function () {\n scope.$broadcast('translateLanguageChanged');\n });\n };\n }\n };\n }\n translateLanguageDirective.displayName = 'translateLanguageDirective';\n angular.module('pascalprecht.translate')\n .filter('translate', translateFilterFactory);\n function translateFilterFactory($parse, $translate) {\n var translateFilter = function (translationId, interpolateParams, interpolation, forceLanguage) {\n if (!angular.isObject(interpolateParams)) {\n var ctx = this || {\n '__SCOPE_IS_NOT_AVAILABLE': 'More info at https://github.com/angular/angular.js/commit/8863b9d04c722b278fa93c5d66ad1e578ad6eb1f'\n };\n interpolateParams = $parse(interpolateParams)(ctx);\n }\n return $translate.instant(translationId, interpolateParams, interpolation, forceLanguage);\n };\n if ($translate.statefulFilter()) {\n translateFilter.$stateful = true;\n }\n return translateFilter;\n }\n translateFilterFactory.displayName = 'translateFilterFactory';\n angular.module('pascalprecht.translate')\n .factory('$translationCache', $translationCache);\n function $translationCache($cacheFactory) {\n return $cacheFactory('translations');\n }\n $translationCache.displayName = '$translationCache';\n return 'pascalprecht.translate';\n});\n});\n\nfunction appRoutes ($stateProvider, $urlRouterProvider) {\n var appState = {\n name: 'app',\n url: '',\n \"abstract\": true,\n views: {\n '': {\n component: 'app'\n },\n 'header@app': {\n component: 'header'\n },\n 'footer@app': {\n component: 'footer'\n }\n }\n };\n var categoriesState = {\n name: 'app.categories',\n url: '/categories',\n \"abstract\": true,\n component: 'categories'\n };\n var categoryListState = {\n name: 'app.categories.categoryList',\n url: '',\n component: 'categoryList'\n };\n var categoryThemeState = {\n name: 'app.categoryTheme',\n url: '/menu',\n component: 'categoryTheme'\n };\n var categoryState = {\n name: 'app.categories.category',\n url: '/:categoryId',\n component: 'category'\n };\n var productState = {\n name: 'app.product',\n url: '/product/:productId',\n component: 'productDetail'\n };\n var feedbackState = {\n name: 'app.feedback',\n url: '/feedback',\n component: 'feedback'\n };\n var basketState = {\n name: 'app.basket',\n url: '/basket',\n component: 'basket'\n };\n var loginState = {\n name: 'app.login',\n url: '/',\n component: 'login'\n };\n var thanksState = {\n name: 'app.thanks',\n url: '/thanks',\n component: 'thanks'\n };\n var ordersState = {\n name: 'app.orders',\n url: '/orders',\n component: 'orders'\n };\n $stateProvider.state(appState).state(feedbackState).state(basketState).state(loginState).state(thanksState).state(ordersState).state(categoriesState).state(categoryListState).state(categoryThemeState).state(categoryState).state(productState);\n $urlRouterProvider.otherwise('/');\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _createForOfIteratorHelper(o) {\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) {\n var i = 0;\n\n var F = function () {};\n\n return {\n s: F,\n n: function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function (e) {\n throw e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var it,\n normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function () {\n it = o[Symbol.iterator]();\n },\n n: function () {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function (e) {\n didErr = true;\n err = e;\n },\n f: function () {\n try {\n if (!normalCompletion && it.return != null) it.return();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}\n\nvar AppStorageSingleton = function () {\n function AppStorageSingleton(storageType) {\n _classCallCheck(this, AppStorageSingleton);\n if (this._instance !== undefined) {\n return this._instance;\n }\n this._storageHandler = null;\n if (storageType === StorageType.Local) {\n this._storageHandler = localStorage;\n } else if (storageType === StorageType.Session) {\n this._storageHandler = sessionStorage;\n }\n this._storage = {};\n this._instance = this;\n }\n _createClass(AppStorageSingleton, [{\n key: \"setItem\",\n value: function setItem(key, value) {\n if (AppStorageSingleton._isEmpty(value)) {\n return false;\n }\n this._storageHandler.setItem(key, JSON.stringify(value));\n this._storage[key] = value;\n return true;\n }\n }, {\n key: \"getItem\",\n value: function getItem(key) {\n if (this._storage.hasOwnProperty(key)) {\n return this._storage[key];\n }\n var value = this._storageHandler.getItem(key);\n if (AppStorageSingleton._isEmpty(value)) {\n return null;\n }\n try {\n value = JSON.parse(value);\n } catch (e) {} finally {\n this._storage[key] = value;\n }\n return value;\n }\n }, {\n key: \"removeItem\",\n value: function removeItem(key) {\n delete this._storage[key];\n this._storageHandler.removeItem(key);\n }\n }, {\n key: \"clear\",\n value: function clear() {\n for (var _len = arguments.length, exceptions = new Array(_len), _key = 0; _key < _len; _key++) {\n exceptions[_key] = arguments[_key];\n }\n for (var _i = 0, _Object$keys = Object.keys(this._storageHandler); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n if (!exceptions.includes(key)) {\n this.removeItem(key);\n }\n }\n }\n }], [{\n key: \"_isEmpty\",\n value: function _isEmpty(value) {\n return value == null || value === '' || value === 'null' || value === 'undefined';\n }\n }]);\n return AppStorageSingleton;\n}();\nvar StorageType = {\n Local: 1,\n Session: 2\n};\nvar AppStorage = Object.freeze(new AppStorageSingleton(StorageType.Local));\nvar SessionAppStorage = Object.freeze(new AppStorageSingleton(StorageType.Session));\nvar StorageKey = Object.freeze({\n REGISTERED: 'Registered',\n LANGUAGES: 'Languages',\n LANGUAGE_CODE: 'LanguageCode',\n LATLNG: 'LatLng',\n CART: 'Cart',\n SETTINGS: 'QrMenuSettings',\n TABLE_NO: 'TableNo',\n CURRENCY: 'Currency',\n CURRENCY_ID: 'CurrencyID',\n RESERVATION: 'Reservation',\n QR_ORDER_TIMES: 'QrOrderTimes',\n ONLINEPAYMENTMODE: 'OnlinePaymentMode'\n});\n\nvar AppLanguageKeys = Object.freeze({\n EN: 'EN',\n TR: 'TR',\n DE: 'DE',\n FR: 'FR',\n AR: 'AR',\n RU: 'RU',\n DA: 'DA'\n});\nvar APP_DEFAULT_LANG = AppLanguageKeys.EN;\nvar APP_TRANSLATIONS = Object.freeze({\n yes: {\n EN: 'Yes',\n TR: 'Evet',\n DE: 'Ja',\n FR: 'Oui',\n RU: 'да',\n DA: 'Ja'\n },\n no: {\n EN: 'No',\n TR: 'Hayır',\n DE: 'Nein',\n FR: 'Non',\n RU: 'Нет',\n DA: 'Ingen'\n },\n room_number: {\n EN: 'Room Number',\n TR: 'Oda Numarası',\n DE: 'Zimmernummer',\n FR: 'Numéro de chambre',\n RU: 'Номер комнаты',\n DA: 'Værelsesnummer'\n },\n welcome_c: {\n EN: 'Welcome',\n TR: 'Hoşgeldiniz',\n DE: 'Willkommen',\n FR: 'Bienvenue',\n RU: 'Добро пожаловать',\n DA: 'Velkommen'\n },\n order_time_range: {\n EN: 'Order times are between {{start}} - {{end}}.',\n TR: 'Sipariş saatleri {{start}} - {{end}} arasındadır.',\n DE: 'Die Bestellzeiten liegen zwischen {{start}} und {{end}} Uhr.',\n FR: 'Les heures de commande sont entre {{start}} et {{end}}.',\n RU: 'Время приема заказов с {{start}} до {{end}}.',\n DA: 'Bestillingstiderne er mellem {{start}} - {{end}}.'\n },\n order_service_price: {\n EN: '{{servicePrice}}% service fee is added to our accounts.',\n TR: 'Hesaplarımıza %{{servicePrice}} servis ücreti uygulanmaktadır.',\n DE: 'Die Servicegebühr in Höhe von {{servicePrice}}% wird Ihren Konten hinzugefügt.',\n FR: 'Des frais de service de {{servicePrice}}% sont ajoutés à vos comptes.',\n RU: 'Плата за обслуживание {{servicePrice}}% добавляется к вашим счетам.',\n DA: '{{servicePrice}}% servicegebyr tilføjes til dine konti.'\n },\n place_name_c: {\n EN: 'Your Name',\n TR: 'Adınız',\n DE: 'Dein Name',\n FR: 'Votre nom',\n RU: 'Ваше имя',\n DA: 'Dit navn'\n },\n place_name: {\n EN: 'Enter Your Name',\n TR: 'Adınızı Giriniz',\n DE: 'Gib deinen Namen ein',\n FR: 'Entrez votre nom',\n RU: 'Введите ваше имя',\n DA: 'Indtast dit navn'\n },\n name_surname_u: {\n EN: 'NAME SURNAME',\n TR: 'AD SOYAD',\n DE: 'NAME FAMILIENNAME',\n FR: 'PRÉNOM NOM DE FAMILLE',\n RU: 'ФИО',\n DA: 'FULDE NAVN'\n },\n place_name_surname_c: {\n EN: 'Your name and surname',\n TR: 'Ad Soyad',\n DE: 'Dein Familienname',\n FR: 'Votre nom et prénom',\n RU: 'Фамилия Имя',\n DA: 'Fulde navn'\n },\n place_tax_c: {\n EN: 'Id No',\n TR: 'Tc Kimlik Numaranız',\n DE: 'Ich Würde',\n FR: 'Numéro d\\'identification',\n RU: 'Ваш ИНН',\n DA: 'Dit CPR-nummer'\n },\n taxno_u: {\n EN: 'ID NO',\n TR: 'TC KİMLİK NO',\n DE: 'ID NO',\n FR: 'Numéro d\\'identification',\n RU: 'ИНН',\n DA: 'CPR-NUMMER'\n },\n place_phone_c: {\n EN: '5xx xxx xx xx',\n TR: '5xx xxx xx xx',\n DE: '5xx xxx xx xx',\n FR: '5xx xxx xx xx',\n RU: '5xx xxx xx xx',\n DA: '5xx xxx xx xx'\n },\n phone_u: {\n EN: 'PHONE',\n TR: 'TELEFON',\n DE: 'TELEFON',\n FR: 'TÉLÉPHONER',\n RU: 'ТЕЛЕФОН',\n DA: 'TELEFON'\n },\n phone_c: {\n EN: 'Phone',\n TR: 'Telefon',\n DE: 'Telefon',\n FR: 'Telephone',\n RU: 'телефон',\n DA: 'Telefon'\n },\n back_c: {\n EN: 'Back',\n TR: 'Geri',\n DE: 'Zurück',\n FR: 'Dos',\n RU: 'Назад',\n DA: 'Tilbage'\n },\n cancel_c: {\n EN: 'Cancel',\n TR: 'Vazgeç',\n DE: 'Stornieren',\n FR: 'Annuler',\n RU: 'Отмена',\n DA: 'Afbestille'\n },\n options_c: {\n EN: 'Options',\n TR: 'Seçenekler',\n DE: 'Optionen',\n FR: 'Choix',\n RU: 'Опции',\n DA: 'Muligheder'\n },\n place_email_c: {\n EN: 'E-Mail Address',\n TR: 'E-posta adresiniz',\n DE: 'E-Mail-Addresse',\n FR: 'Adresse e-mail',\n RU: 'Ваш адрес электронной почты',\n DA: 'Din e-mailadresse'\n },\n last_price_change: {\n EN: 'Price Change Date',\n TR: 'Fiyat Değ. Tarihi',\n DE: 'Preisänderungsdatum',\n FR: 'Date de changement de prix',\n RU: 'Дата изменения цены',\n DA: 'Prisændringsdato'\n },\n email_u: {\n EN: 'EMAIL',\n TR: 'E-POSTA',\n DE: 'EMAIL',\n FR: 'E-MAIL',\n RU: 'ЭЛ. АДРЕС',\n DA: 'E-MAIL'\n },\n email_c: {\n EN: 'Email',\n TR: 'E-posta',\n DE: 'Email',\n FR: 'E-mail',\n RU: 'ЭЛ. АДРЕС',\n DA: 'E-mail'\n },\n city_c: {\n EN: 'City',\n TR: 'Şehir',\n DE: 'Stadt',\n FR: 'Ville',\n RU: 'Город',\n DA: 'By'\n },\n postcode_c: {\n EN: 'Post Code',\n TR: 'Posta Kodu',\n DE: 'Postleitzahl',\n FR: 'Code postal',\n RU: 'Почтовый индекс',\n DA: 'Postnummer'\n },\n address_c: {\n EN: 'Address',\n TR: 'Adres',\n DE: 'Adresse',\n FR: 'Adresse',\n RU: 'Адрес',\n DA: 'Adresse'\n },\n next_c: {\n EN: 'Next',\n TR: 'İleri',\n DE: 'Nächste',\n FR: 'Suivante',\n RU: 'Следующий',\n DA: 'Næste'\n },\n billinginfo_c: {\n EN: 'Billing information',\n TR: 'Fatura Bilgisi',\n DE: 'Abrechnungsdaten',\n FR: 'Informations de facturation',\n RU: 'Платежная информация',\n DA: 'Betalingsinformation'\n },\n paymentinfo_c: {\n EN: 'Payment information',\n TR: 'Ödeme Bilgisi',\n DE: 'Zahlungsinformationen',\n FR: 'information de paiement',\n RU: 'Платежная информация',\n DA: 'Betalingsinformation'\n },\n payment_c: {\n EN: 'Pay',\n TR: 'Ödeme Yap',\n DE: 'Zahlen',\n FR: 'Payer',\n RU: 'Платить',\n DA: 'Betale'\n },\n montyear_c: {\n EN: 'MM/YY',\n TR: 'AA/YY',\n DE: 'MM/JJ',\n FR: 'MM/AA',\n RU: 'MM/ГГ',\n DA: 'MM/ÅÅ'\n },\n add_to_cart: {\n EN: 'Add To Cart',\n TR: 'Sepete Ekle',\n DE: 'Zum Warenkorb hinzufügen',\n FR: 'Ajouter au panier',\n RU: 'Добавить в корзину',\n DA: 'Tilføj til kurv'\n },\n added_to_cart: {\n EN: 'Added To Cart!',\n TR: 'Sepete Eklendi!',\n DE: 'In den Warenkorb gelegt!',\n FR: 'Ajouté au panier!',\n RU: 'Добавлено в корзину!',\n DA: 'Tilføjet til kurven!'\n },\n quantityMessage: {\n EN: 'Enter quantity',\n TR: 'Adet girin',\n DE: 'Menge eingeben',\n FR: 'Entrez la quantité',\n RU: 'Введите количество',\n DA: 'Indtast antal'\n },\n sold_out: {\n EN: 'Sold Out',\n TR: 'Tükendi',\n DE: 'Ausverkauft',\n FR: 'Épuisé',\n RU: 'Распродано',\n DA: 'Udsolgt'\n },\n table_not_found: {\n EN: 'Table not found.',\n TR: 'Masa numarası bulunamadı.',\n DE: 'Tabellennummer nicht gefunden.',\n FR: 'Tableau introuvable.',\n RU: 'Не удалось найти номер стола.',\n DA: 'Bordnummer kunne ikke findes.'\n },\n reservation_not_found: {\n EN: 'Reservation not found.',\n TR: 'Rezervasyon bulunamadı.',\n DE: 'Reservierung nicht gefunden.',\n FR: 'Réservation introuvable.',\n RU: 'Бронирование не найдено.',\n DA: 'Reservationen blev ikke fundet.'\n },\n ok: {\n EN: 'Done',\n TR: 'Tamam',\n DE: 'Komplett',\n FR: 'Terminé',\n RU: 'Хорошо',\n DA: 'Okay'\n },\n ok_c: {\n EN: 'Complete',\n TR: 'Tamamla',\n DE: 'Komplett',\n FR: 'Compléter',\n RU: 'Завершить',\n DA: 'Færdiggør'\n },\n total_u: {\n EN: 'TOTAL',\n TR: 'TOPLAM',\n DE: 'GESAMT',\n FR: 'Total',\n RU: 'ИТОГО',\n DA: 'TOTAL'\n },\n total_c: {\n EN: 'Total',\n TR: 'Toplam',\n DE: 'Gesamt',\n FR: 'Total',\n RU: 'Итого',\n DA: 'Total'\n },\n required_c: {\n EN: 'Required',\n TR: 'Zorunlu',\n DE: 'Erforderlich',\n FR: 'Obligatoire',\n RU: 'Обязательно',\n DA: 'Påkrævet'\n },\n call_waiter_message: {\n EN: 'The waiter will take care of you shortly. Thanks for waiting.',\n TR: 'Garson birazdan sizinle ilgilenecek. Beklediğiniz için teşekkürler.',\n DE: 'Der Kellner wird sich in Kürze um Sie kümmern. Danke für\\'s Warten.',\n FR: 'Le serveur s\\'occupera de vous sous peu. Merci pour votre patience.',\n RU: 'Официант скоро обслужит вас. Спасибо за ожидание.',\n DA: 'Tjeneren vil tage sig af dig om lidt. Tak for din tålmodighed.'\n },\n registration_success_message: {\n EN: 'Registration successful!',\n TR: 'Kayıt işlemi başarılı!',\n DE: 'Registrierung erfolgreich!',\n FR: 'Inscription réussi!',\n RU: 'Регистрация прошла успешно!',\n DA: 'Registreringen lykkedes!'\n },\n registration_error_message: {\n EN: 'Registration could not be completed.',\n TR: 'Kayıt işlemi tamamlanamadı.',\n DE: 'Die Registrierung konnte nicht abgeschlossen werden.',\n FR: 'L\\'inscription n\\'a pas pu être complétée.',\n RU: 'Не удалось завершить регистрацию.',\n DA: 'Registreringen kunne ikke fuldføres.'\n },\n registration_error_message_2: {\n EN: 'Please fill in the blanks to register.',\n TR: 'Lütfen kayıt olmak için boş alanları doldurunuz.',\n DE: 'Bitte füllen Sie die Felder aus, um sich anzumelden.',\n FR: 'Veuillez remplir les champs pour vous inscrire.',\n RU: 'Пожалуйста, заполните все пустые поля для регистрации.',\n DA: 'Udfyld venligst de tomme felter for at registrere dig.'\n },\n table_no_c: {\n EN: 'Table',\n TR: 'Masa',\n DE: 'Tisch',\n FR: 'Table',\n RU: 'Стол',\n DA: 'Bord'\n },\n self_service: {\n EN: 'Self Service',\n TR: 'Self Servis',\n DE: 'Selbstbedienung',\n FR: 'En libre service',\n RU: 'Самообслуживание',\n DA: 'Self-service'\n },\n self_order: {\n EN: 'Self Order',\n TR: 'Self Sipariş',\n DE: 'Selbstbestellung',\n FR: 'Auto-commande',\n RU: 'Самообслуживание с заказом',\n DA: 'Self-bestilling'\n },\n fast_order_message: {\n EN: 'Welcome',\n TR: 'Kayıt!',\n DE: 'Willkommen',\n FR: 'Disque',\n RU: 'Регистрация!',\n DA: 'Registrer!'\n },\n fast_order_message_2: {\n EN: 'Please fill the form for public health within the scope of Covid-19!',\n TR: 'Covid-19 kapsamında toplum sağlığı için lütfen formu doldurun!',\n DE: 'Bitte füllen Sie das Formular für die öffentliche Gesundheit im Rahmen von Covid-19 aus!',\n FR: 'Merci de remplir le formulaire pour la santé publique dans le cadre du Covid-19 !',\n RU: 'В рамках Covid-19, пожалуйста, заполните форму для общественного здоровья!',\n DA: 'Udfyld venligst formularen for at bidrage til samfundets sundhed inden for rammerne af Covid-19!'\n },\n order_take_message: {\n EN: 'We have received your order. We will deliver as soon as possible.',\n TR: 'Siparişinizi aldık. En kısa sürede teslim edeceğiz.',\n DE: 'Wir haben Ihre Bestellung erhalten. Wir liefern so schnell wie möglich.',\n FR: 'Nous avons reçu votre commande. Nous vous livrerons dès que possible.',\n RU: 'Мы получили ваш заказ. Мы доставим его в кратчайшие сроки.',\n DA: 'Vi har modtaget din ordre. Vi vil levere den så hurtigt som muligt.'\n },\n self_order_take_message: {\n EN: 'We have received your order. Please come to the cashier for payment.',\n TR: 'Siparişinizi aldık. Ödeme için lütfen kasaya geliniz.',\n DE: 'Wir haben Ihre Bestellung erhalten. Bitte kommen Sie zum Bezahlen an die Kasse.',\n FR: 'Nous avons reçu votre commande. Veuillez vous présenter à la caisse pour le paiement.',\n RU: 'Мы получили ваш заказ. Пожалуйста, оплатите его на кассе.',\n DA: 'Vi har modtaget din ordre. Kom venligst til kassen for at betale.'\n },\n self_order_take_message_c: {\n EN: 'We have received your order. Thanks!',\n TR: 'Siparişiniz alınmıştır. Teşekkürler.',\n DE: 'Wir haben Ihre Bestellung erhalten. Danke!',\n FR: 'Nous avons reçu votre commande. Merci!',\n RU: 'Ваш заказ принят. Спасибо.',\n DA: 'Din ordre er blevet modtaget. Tak.'\n },\n order_fail_message: {\n EN: 'A problem has been encountered. Please try again later.',\n TR: 'Bir sorunla karşılaşıldı. Lütfen daha sonra tekrar deneyin.',\n DE: 'Es ist ein Problem aufgetreten. Bitte versuchen Sie es später erneut.',\n FR: 'Un problème a été rencontré. Veuillez réessayer plus tard.',\n RU: 'Произошла ошибка. Пожалуйста, попробуйте еще раз позже.',\n DA: 'Der opstod en fejl. Prøv venligst igen senere.'\n },\n order_number: {\n EN: 'ORDER NO',\n TR: 'SİPARİŞ NO',\n DE: 'BESTELLNUMMER:',\n FR: 'NUMÉRO DE COMMANDE',\n RU: '№ ЗАКАЗА',\n DA: 'ORDRE NR.'\n },\n send_c: {\n EN: 'Send',\n TR: 'Gönder',\n DE: 'Senden',\n FR: 'Envoyer',\n RU: 'Отправить',\n DA: 'Send'\n },\n save_c: {\n EN: 'Save',\n TR: 'Kaydet',\n DE: 'Speichern',\n FR: 'Sauvegarder',\n RU: 'Сохранить',\n DA: 'Gem'\n },\n discover_products_c: {\n EN: 'Discover Products',\n TR: 'Ürünleri Keşfet',\n DE: 'Produkte entdecken',\n FR: 'Découvrez les produits',\n RU: 'Просмотреть товары',\n DA: 'Udforsk produkterne'\n },\n discover_products_now_c: {\n EN: 'Discover the latest products now',\n TR: 'En yeni ürünleri şimdi keşfedin',\n DE: 'Jetzt die neuesten Produkte entdecken',\n FR: 'Découvrez maintenant les derniers produits',\n RU: 'Откройте для себя новейшие продукты сейчас',\n DA: 'Opdag de nyeste produkter nu'\n },\n empty_cart_c: {\n EN: 'Your Shopping Cart is Empty',\n TR: 'Alışveriş Sepetiniz Boş',\n DE: 'Dein Einkaufswagen ist leer',\n FR: 'Votre panier est vide',\n RU: 'Корзина пуста',\n DA: 'Indkøbskurven er tom'\n },\n go_to_menu_c: {\n EN: 'Go to Menu',\n TR: 'Menüye Git',\n DE: 'Gehe Zum Menü',\n FR: 'Aller au menu',\n RU: 'Перейти в меню',\n DA: 'Gå til menuen'\n },\n go_to_campaign_c: {\n EN: 'Review to Campaigns',\n TR: 'Kampanyaları İncele',\n DE: 'Gehe Zum Menü',\n FR: 'Aller au menu',\n RU: 'Перейти в меню',\n DA: 'Gå til menuen'\n },\n follow_us_c: {\n EN: 'Follow Us',\n TR: 'Bizi Takip Edin',\n DE: 'Follow Uns',\n FR: 'Suivez-nous',\n RU: 'Следите за нами',\n DA: 'Følg os'\n },\n feature_quantity_short_error: {\n EN: 'You have to select at least {{amount}} option(s) on {{name}}',\n TR: '{{ name }} kategorisinde en az {{ amount }} seçenek seçmelisiniz.',\n AR: 'يجب عليك تحديد ما لا يقل عن {{amount}} خيار (خيارات) على {{name}}',\n DE: 'Sie müssen mindestens {{amount}} Option(en) auf {{name}} auswählen',\n FR: 'Vous devez choisir au moins {{amount}} options dans la catégorie {{name}}.',\n RU: 'Вы должны выбрать не менее {{ amount }} вариантов в категории {{ name }}.',\n DA: 'Du skal vælge mindst {{amount}} valgmuligheder i kategorien {{name}}.'\n },\n feature_quantity_long_error: {\n EN: 'You can select maximum {{amount}} options on {{name}}',\n TR: '{{name}} kategorisinde en fazla {{amount}} seçenek seçebilirsiniz.',\n AR: 'يمكنك تحديد الحد الأقصى {{amount}} من الخيارات على {{name}}',\n DE: 'Sie können maximal {{amount}} Optionen für {{name}} auswählen',\n FR: 'Vous pouvez choisir jusqu\\'à {{amount}} options dans la catégorie {{name}}.',\n RU: 'Вы можете выбрать не более {{ amount }} вариантов в категории {{ name }}.',\n DA: 'Du kan kun vælge op til {{amount}} valgmuligheder i kategorien {{name}}.'\n },\n feedback_title: {\n EN: 'FEEDBACK',\n TR: 'GERİ BİLDİRİM',\n DE: 'RÜCKMELDUNG',\n FR: 'RETOUR D\\'INFORMATION',\n RU: 'ОБРАТНАЯ СВЯЗЬ',\n DA: 'FEEDBACK'\n },\n basket_title: {\n EN: 'BASKET',\n TR: 'SEPET',\n DE: 'BASKET',\n FR: 'CORBEILLE',\n RU: 'КОРЗИНА',\n DA: 'KURV'\n },\n order_title: {\n EN: 'MY ORDERS',\n TR: 'SİPARİŞLERİM',\n DE: 'MEINE BESTELLUNGEN',\n FR: 'MES COMMANDES',\n RU: 'МОИ ЗАКАЗЫ',\n DA: 'MINE ORDRER'\n },\n order_detail_title: {\n EN: 'Order Detail',\n TR: 'Sipariş Detayı',\n DE: 'Bestelldetails',\n FR: 'Détails',\n RU: 'Детали заказа',\n DA: 'Ordredetaljer'\n },\n ready_order: {\n EN: 'Ready',\n TR: 'Hazır',\n DE: 'Bereit',\n FR: 'Prêt',\n RU: 'Готово',\n DA: 'Klar'\n },\n prepared_order: {\n EN: 'Preparing',\n TR: 'Hazırlanıyor',\n DE: 'Vorbereiten',\n FR: 'En train de préparer',\n RU: 'Готовится',\n DA: 'Under tilberedning'\n },\n rejected_order: {\n EN: 'Rejected',\n TR: 'Reddedildi',\n DE: 'Ablehnen',\n FR: 'Refusé',\n RU: 'Отклонено',\n DA: 'Afvist'\n },\n receipt: {\n EN: 'Receipt',\n TR: 'Fiş',\n DE: 'Kassenbon',\n FR: 'Le reçu',\n RU: 'Чек',\n DA: 'Kvittering'\n },\n touch_for_allergens: {\n EN: 'Tap to see allergens',\n TR: 'Alerjenleri görmek için dokunun',\n DE: 'Tippen, um Allergene anzuzeigen',\n FR: 'Appuyez pour voir les allergènes',\n RU: 'Коснитесь, чтобы увидеть аллергены',\n DA: 'Tryk for at se allergener'\n },\n thanks: {\n EN: 'Thanks!',\n TR: 'Teşekkürler!',\n DE: 'Danke!',\n FR: 'Merci!',\n RU: 'Спасибо!',\n DA: 'Tak!'\n },\n kvkkText: {\n EN: 'I have read and approve the disclosure text.',\n TR: 'Aydınlatma metnini okudum, onaylıyorum.',\n DE: 'Ich habe den Informationstext gelesen und akzeptiere ihn.',\n FR: 'J\\'ai lu et j\\'accepte le texte d\\'information.',\n RU: 'Я прочитал и принимаю информационный текст.',\n DA: 'Jeg har læst og accepterer informationsteksten.'\n },\n campaignText: {\n EN: 'I want to be informed about campaigns.',\n TR: 'Kampanyalardan haberdar olmak istiyorum.',\n DE: 'Ich möchte über Kampagnen informiert werden.',\n FR: 'Je souhaite être informé des campagnes.',\n RU: 'Я хочу получать информацию о кампаниях.',\n DA: 'Jeg vil gerne informeres om kampagner.'\n },\n kvkkHead_u: {\n EN: 'INFORMATION TEXT',\n TR: 'AYDINLATMA METNİ',\n DE: 'ERKLÄRUNGSTEXT',\n FR: 'TEXTE DE CLARIFICATION',\n RU: 'РАЗЪЯСНИТЕЛЬНЫЙ ТЕКСТ',\n DA: 'OPLYSNINGSTEKST'\n },\n thank_you_for_your_feedback: {\n EN: 'Thank you for your feedback.',\n TR: 'Geri bildiriminiz için teşekkür ederiz.',\n DE: 'Danke für deine Rückmeldung.',\n FR: 'Merci pour votre avis.',\n RU: 'Благодарим за отзыв.',\n DA: 'Tak for din feedback.'\n },\n close: {\n EN: 'Close',\n TR: 'Kapat',\n DE: 'Schließen',\n FR: 'Fermer',\n RU: 'Закрыть',\n DA: 'Luk'\n },\n menu: {\n EN: 'Menu',\n TR: 'Menü',\n DE: 'Menüs',\n FR: 'Menu',\n RU: 'Меню',\n DA: 'Menu'\n },\n price: {\n EN: 'Price',\n TR: 'Fiyat',\n DE: 'Betrag',\n FR: 'Prix',\n RU: 'Цена',\n DA: 'Pris'\n },\n environment: {\n EN: 'Environment',\n TR: 'Ortam',\n DE: 'Umgebung',\n FR: 'Environnement',\n RU: 'Атмосфера',\n DA: 'Miljø'\n },\n service: {\n EN: 'Service',\n TR: 'Servis',\n DE: 'Service',\n FR: 'Service',\n RU: 'Сервис',\n DA: 'Service'\n },\n courtesy: {\n EN: 'Courtesy',\n TR: 'Nezaket',\n DE: 'Höflichkeit',\n FR: 'Gentillesse',\n RU: 'Вежливость',\n DA: 'Venlighed'\n },\n description: {\n EN: 'Description',\n TR: 'Açıklama',\n DE: 'Beschreibung',\n FR: 'La description',\n RU: 'Описание',\n DA: 'Beskrivelse'\n },\n send: {\n EN: 'SEND',\n TR: 'GÖNDER',\n DE: 'SENDEN',\n FR: 'ENVOYER',\n RU: 'ОТПРАВИТЬ',\n DA: 'SEND'\n },\n warning: {\n EN: 'Warning!',\n TR: 'Uyarı!',\n DE: 'Warnung!',\n FR: 'Avertissement!',\n RU: 'Предупреждение!',\n DA: 'Advarsel!'\n },\n feedback_couldnt_be_sent: {\n EN: 'Sorry, your feedback could not be send.',\n TR: 'Üzgünüz, geri bildiriminiz gönderilemedi.',\n DE: 'Traurig, ihr feedback konnte nicht gesendet werden',\n FR: 'Désolé, votre commentaire n\\'a pas pu être envoyé.',\n RU: 'К сожалению, ваш отзыв не может быть отправлен.',\n DA: 'Beklager, din feedback kunne ikke sendes.'\n },\n my_cart: {\n EN: 'My Cart',\n TR: 'Sepetim',\n DE: 'Einkaufswagen',\n FR: 'Mon panier',\n RU: 'Моя корзина',\n DA: 'Min kurv'\n },\n call_waiter_c: {\n EN: 'Call Waiter',\n TR: 'Garson Çağır',\n DE: 'Kellner anrufen',\n FR: 'Serveur d\\'appel',\n RU: 'Вызвать официанта',\n DA: 'Kald tjener'\n },\n my_orders: {\n EN: 'My Orders',\n TR: 'Siparişlerim',\n DE: 'Meine Bestellungen',\n FR: 'Mes commandes',\n RU: 'Мои заказы',\n DA: 'Mine bestillinger'\n },\n register_form_c: {\n EN: 'Registration Form',\n TR: 'Kayıt Formu',\n DE: 'Anmeldeformular',\n FR: 'Formulaire d\\'inscription',\n RU: 'Форма регистрации',\n DA: 'Registreringsformular'\n },\n exit_menu_c: {\n EN: 'Exit Menu',\n TR: 'Menüden Çık',\n DE: 'Menü Verlassen',\n FR: 'Quitter le menu',\n RU: 'Выход из меню',\n DA: 'Forlad menuen'\n },\n mobile_app: {\n EN: 'Mobile App',\n TR: 'Mobil Uygulaması',\n DE: 'Mobile Applikation',\n FR: 'Application mobile',\n RU: 'Мобильное приложение',\n DA: 'Mobilapplikation'\n },\n download_app: {\n EN: 'Download App',\n TR: 'Uygulamayı Yükle',\n DE: 'App Installieren',\n FR: 'Installer l\\'application',\n RU: 'Установить приложение',\n DA: 'Installer appen'\n },\n location_based_error: {\n EN: 'Please make sure your device\\'s location information is turned on.',\n TR: 'Lütfen cihazınızın konum bilgisinin açık olduğundan emin olunuz.',\n DE: 'Bitte stellen Sie sicher, dass die Standortinformationen Ihres Geräts aktiviert sind.:',\n FR: 'Veuillez vous assurer que les informations de localisation de votre appareil sont activées.',\n RU: 'Убедитесь, что информация о местоположении вашего устройства включена.',\n DA: 'Sørg for, at din enheds placeringsoplysninger er slået til.'\n },\n location_perm_error: {\n EN: 'Please turn on \"Order Location Verified\" mode.',\n TR: 'Lütfen \"Konum Doğrulamalı Sipariş\" modunu açın.',\n DE: 'Bitte aktivieren Sie den Modus „Bestellung mit Standortbestätigung“.',\n FR: 'Veuillez activer le mode \"Commander avec vérification de l\\'emplacement\".',\n RU: 'Включите режим «Заказ с проверкой местоположения».',\n DA: 'Slå tilstanden \"Bestil med placeringsbekræftelse\" til'\n },\n location_not_support: {\n EN: 'Your browser does not support location information.',\n TR: 'Tarayıcınız konum bilgisini desteklemiyor.',\n DE: 'Ihr Browser unterstützt keine Standortinformationen.',\n FR: 'Votre navigateur ne prend pas en charge les informations de localisation.',\n RU: 'Ваш браузер не поддерживает информацию о местоположении.',\n DA: 'Din browser understøtter ikke placeringsoplysninger'\n },\n call_c: {\n EN: 'Call',\n TR: 'Çağır',\n DE: 'Anruf',\n FR: 'Appel',\n RU: 'Вызов',\n DA: 'Kald'\n },\n guest_call_type_header_c: {\n EN: 'Call for',\n TR: 'Ne İstersiniz?',\n DE: 'Was möchten Sie?',\n FR: 'Que désirez-vous?',\n RU: 'Что вы хотите заказать?',\n DA: 'Hvad vil du gerne have?'\n },\n guest_call_c: {\n EN: 'Waiter',\n TR: 'Garson Çağır',\n DE: 'Kellner Anfordern',\n FR: 'Serveur d\\'appel',\n RU: 'Вызов официанта',\n DA: 'Kald tjener'\n },\n guest_call_type_bill_c: {\n EN: 'Bill',\n TR: 'Hesap İste',\n DE: 'Rechnung Anfordern',\n FR: 'Demander un compte',\n RU: 'Запрос счета',\n DA: 'Regning, tak'\n },\n guest_call_type_koez_c: {\n EN: 'Charcoal',\n TR: 'Köz İste',\n DE: 'Kohle Anfordern',\n FR: 'Demander des braises',\n RU: 'Просить уголь',\n DA: 'Ristet, tak'\n },\n send_order_c: {\n EN: 'Send order',\n TR: 'Sipariş gönder',\n DE: 'Bestellung abschicken',\n FR: 'Soumettre la commande',\n RU: 'Отправить заказ',\n DA: 'Send ordre'\n },\n feedback_c: {\n EN: 'Feedback',\n TR: 'Geri Bildirim',\n DE: 'Feedback',\n FR: 'Retour d\\'information',\n RU: 'Обратная связь',\n DA: 'Feedback'\n },\n ALCO: {\n EN: 'Contains Alcohol',\n TR: 'Alkol İçerir',\n DE: 'Enthält Alkohol',\n FR: 'Contient de l\\'alcool',\n RU: 'Содержит алкоголь',\n DA: 'Indeholder alkohol'\n },\n ALCOF: {\n EN: 'Alcohol Free',\n TR: 'Alkol İçermez',\n DE: 'Alkohol Frei',\n FR: 'Sans alcool',\n RU: 'Не содержит алкоголь',\n DA: 'Indeholder ikke alkohol'\n },\n ALMO: {\n EN: 'Contains Almond',\n TR: 'Badem İçerir',\n DE: 'Enthält Mandel',\n FR: 'Contient des amandes',\n RU: 'Содержит миндаль',\n DA: 'Indeholder mandler'\n },\n ALMOF: {\n EN: 'Almond Free',\n TR: 'Badem İçermez',\n DE: 'Mandel Frei',\n FR: 'Pas d\\'amandes',\n RU: 'Не содержит миндаль',\n DA: 'Indeholder ikke mandler'\n },\n ANTI: {\n EN: 'Contains Antioxidant',\n TR: 'Antioksidan İçerir',\n DE: 'Enthält Antioxidans',\n FR: 'Contient des antioxydants',\n RU: 'Содержит антиоксиданты',\n DA: 'Indeholder antioxidanter'\n },\n ANTIF: {\n EN: 'Antioxidant Free',\n TR: 'Antioksidan İçermez',\n DE: 'Antioxidans Frei',\n FR: 'Ne contient pas d\\'antioxydants',\n RU: 'Не содержит антиоксиданты',\n DA: 'Indeholder ikke antioxidanter'\n },\n BLCK: {\n EN: 'Contains Blacked',\n TR: 'Karartılmış İçerir',\n DE: 'Enthält Geschwarzt',\n FR: 'Contient noirci',\n RU: 'Содержит загар',\n DA: 'Indeholder mørk farvning'\n },\n BLCKF: {\n EN: 'Blacked Free',\n TR: 'Karartılmış İçermez',\n DE: 'Geschwarzt Frei',\n FR: 'Noirci non inclus',\n RU: 'Не содержит загар',\n DA: 'Indeholder ikke mørk farvning'\n },\n CAFN: {\n EN: 'Contains Cafein',\n TR: 'Kafein İçerir',\n DE: 'Enthält Koffein',\n FR: 'Contient de la caféine',\n RU: 'Содержит кофеин',\n DA: 'Indeholder koffein'\n },\n CAFNF: {\n EN: 'Cafein Free',\n TR: 'Kafein İçermez',\n DE: 'Koffein Frei',\n FR: 'Sans caféine',\n RU: 'Не содержит кофеин',\n DA: 'Indeholder ikke koffein'\n },\n CLRY: {\n EN: 'Contains Celery',\n TR: 'Kereviz İçerir',\n DE: 'Enthält Sellerie',\n FR: 'Contient du céleri',\n RU: 'Содержит сельдерей',\n DA: 'Indeholder selleri'\n },\n CLRYF: {\n EN: 'Celery Free',\n TR: 'Kereviz İçermez',\n DE: 'Sellerie Frei',\n FR: 'Sans céleri',\n RU: 'Не содержит сельдерей',\n DA: 'Indeholder ikke selleri'\n },\n COLR: {\n EN: 'Contains Color',\n TR: 'Renklendirici İçerir',\n DE: 'Enthält Farbe',\n FR: 'Contient du colorant',\n RU: 'Содержит красители',\n DA: 'Indeholder farvestoffer'\n },\n COLRF: {\n EN: 'Color Free',\n TR: 'Renklendirici İçermez',\n DE: 'Farbe Frei',\n FR: 'Sans colorant',\n RU: 'Не содержит красители',\n DA: 'Indeholder ikke farvestoffer'\n },\n CORN: {\n EN: 'Contains Corn',\n TR: 'Mısır İçerir',\n DE: 'Enthält Mais',\n FR: 'Contient du maïs',\n RU: 'Содержит кукурузу',\n DA: 'Indeholder majs'\n },\n CORNF: {\n EN: 'Corn Free',\n TR: 'Mısır İçermez',\n DE: 'Mais Frei',\n FR: 'Sans maïs',\n RU: 'Не содержит кукурузу',\n DA: 'Indeholder ikke majs'\n },\n CRLT: {\n EN: 'Contains Cruelty',\n TR: 'Zulüm İçerir',\n DE: 'Enthält Grausamkeit',\n FR: 'Contient de la cruauté',\n RU: 'Содержит жестокость',\n DA: 'Indeholder grusomhed'\n },\n CRLTF: {\n EN: 'Cruelty Free',\n TR: 'Zulüm İçermez',\n DE: 'Grausamkeit Frei',\n FR: 'Sans cruauté',\n RU: 'Не содержит жестокость',\n DA: 'Indeholder ikke grusomhed'\n },\n CRUS: {\n EN: 'Contains Crustaceans',\n TR: 'Kabuklu İçerir',\n DE: 'Enthält Mais',\n FR: 'Contient des coquillages',\n RU: 'Содержит скорлупу',\n DA: 'Indeholder skaldyr'\n },\n CRUSF: {\n EN: 'Crustaceans Free',\n TR: 'Kabuklu İçermez',\n DE: 'Mais Frei',\n FR: 'Pas de coquillages',\n RU: 'Не содержит скорлупу',\n DA: 'Indeholder ikke skaldyr'\n },\n EGGS: {\n EN: 'Contains Eggs',\n TR: 'Yumurta İçerir',\n DE: 'Enthält Ei',\n FR: 'Contient des œufs',\n RU: 'Содержит яйца',\n DA: 'Indeholder æg'\n },\n EGGSF: {\n EN: 'Eggs Free',\n TR: 'Yumurta İçermez',\n DE: 'Ei Frei',\n FR: 'Pas d\\'oeufs',\n RU: 'Не содержит яйца',\n DA: 'Indeholder ikke æg'\n },\n FISH: {\n EN: 'Contains Fish',\n TR: 'Balık İçerir',\n DE: 'Enthält Fisch',\n FR: 'Contient du poisson',\n RU: 'Содержит рыбу',\n DA: 'Indeholder fisk'\n },\n FISHF: {\n EN: 'Fish Free',\n TR: 'Balık İçermez',\n DE: 'Fisch Frei',\n FR: 'Pas de poisson',\n RU: 'Не содержит рыбу',\n DA: 'Indeholder ikke fisk'\n },\n FLAV: {\n EN: 'Contains Flavor Enhancer',\n TR: 'Lezzet Artırıcı İçerir',\n DE: 'Enthält Geschmarksverstarker',\n FR: 'Contient un exhausteur de goût',\n RU: 'Содержит усилитель вкуса',\n DA: 'Indeholder smagsforstærkere'\n },\n GLTN: {\n EN: 'Contains Gluten',\n TR: 'Gluten İçerir',\n DE: 'Enthält Gluten',\n FR: 'Contient du gluten',\n RU: 'Содержит глютен',\n DA: 'Indeholder gluten'\n },\n GLTNF: {\n EN: 'Gluten Free',\n TR: 'Gluten İçermez',\n DE: 'Gluten Frei',\n FR: 'Sans gluten',\n RU: 'Не содержит глютен',\n DA: 'Indeholder ikke gluten'\n },\n GMO: {\n EN: 'Contains GMO',\n TR: 'GDO İçerir',\n DE: 'Enthält GVO',\n FR: 'Contient des OGM',\n RU: 'Содержит ГМО',\n DA: 'Indeholder GMO'\n },\n GMOF: {\n EN: 'GMO Free',\n TR: 'GDO İçermez',\n DE: 'GVO Frei',\n FR: 'Sans OGM',\n RU: 'Не содержит ГМО',\n DA: 'Indeholder ikke GMO'\n },\n HONY: {\n EN: 'Contains Honey',\n TR: 'Bal İçerir',\n DE: 'Enthält Honig',\n FR: 'Contient du miel',\n RU: 'Содержит мед',\n DA: 'Indeholder honning'\n },\n HONYF: {\n EN: 'Honey Free',\n TR: 'Bal İçermez',\n DE: 'Honig Frei',\n FR: 'Pas de miel',\n RU: 'Не содержит мед',\n DA: 'Indeholder ikke honning'\n },\n LUPN: {\n EN: 'Contains Lupin',\n TR: 'Lupin İçerir',\n DE: 'Enthält Lupine',\n FR: 'Contient du lupin',\n RU: 'Содержит люпин',\n DA: 'Indeholder lupin'\n },\n LUPNF: {\n EN: 'Lupin Free',\n TR: 'Lupin İçermez',\n DE: 'Lupine Frei',\n FR: 'Sans lupin',\n RU: 'Не содержит люпин',\n DA: 'Indeholder ikke lupin'\n },\n MILK: {\n EN: 'Contains Milk',\n TR: 'Süt İçerir',\n DE: 'Enthält Milch',\n FR: 'Contient du lait',\n RU: 'Содержит молоко',\n DA: 'Indeholder mælk'\n },\n MILKF: {\n EN: 'Milk Free',\n TR: 'Süt İçermez',\n DE: 'Milch Frei',\n FR: 'Pas de produits laitiers',\n RU: 'Не содержит молоко',\n DA: 'Indeholder ikke mælk'\n },\n MOLL: {\n EN: 'Contains Molluscs',\n TR: 'Yumuşakça İçerir',\n DE: 'Enthält Weichtiere',\n FR: 'Contient des mollusques',\n RU: 'Содержит моллюсков',\n DA: 'Indeholder bløddyr'\n },\n MOLLF: {\n EN: 'Molluscs Free',\n TR: 'Yumuşakça İçermez',\n DE: 'Weichtiere Frei',\n FR: 'Pas de mollusques',\n RU: 'Не содержит моллюсков',\n DA: 'Indeholder ikke bløddyr'\n },\n MUSH: {\n EN: 'Contains Mushroom',\n TR: 'Mantar İçerir',\n DE: 'Enthält Pilz',\n FR: 'Contient des champignons',\n RU: 'Содержит грибы',\n DA: 'Indeholder svampe'\n },\n MUSHF: {\n EN: 'Mushroom Free',\n TR: 'Mantar İçermez',\n DE: 'Pilz Frei',\n FR: 'Sans champignons',\n RU: 'Не содержит грибы',\n DA: 'Indeholder ikke svampe'\n },\n MUST: {\n EN: 'Contains Mustard',\n TR: 'Hardal İçerir',\n DE: 'Enthält Senf',\n FR: 'Contient de la moutarde',\n RU: 'Содержит горчицу',\n DA: 'Indeholder sennep'\n },\n MUSTF: {\n EN: 'Mustard Free',\n TR: 'Hardal İçermez',\n DE: 'Senf Frei',\n FR: 'Ne contient pas de moutarde',\n RU: 'Не содержит горчицу',\n DA: 'Indeholder ikke sennep'\n },\n PHNL: {\n EN: 'Contains Phenyalanine',\n TR: 'Fenilalanin İçerir',\n DE: 'Enthält Phenylalanin',\n FR: 'Contient de la Phénylalanine',\n RU: 'Содержит фенилаланин',\n DA: 'Indeholder phenylalanin'\n },\n PHNLF: {\n EN: 'Phenyalanine Free',\n TR: 'Fenilalanin İçermez',\n DE: 'Phenylalanin Frei',\n FR: 'Ne contient pas de phénylalanine',\n RU: 'Не содержит фенилаланин',\n DA: 'Indeholder ikke phenylalanin'\n },\n PHOS: {\n EN: 'Contains Phosphate',\n TR: 'Fosfat İçerir',\n DE: 'Enthält Phosphat',\n FR: 'Contient du phosphate',\n RU: 'Содержит фосфаты',\n DA: 'Indeholder fosfat'\n },\n PHOSF: {\n EN: 'Phosphate Free',\n TR: 'Fosfat İçermez',\n DE: 'Phosphat Frei',\n FR: 'Sans phosphate',\n RU: 'Не содержит фосфаты',\n DA: 'Indeholder ikke fosfat'\n },\n PNTS: {\n EN: 'Contains Peanuts',\n TR: 'Fıstık İçerir',\n DE: 'Enthält Erdnüsse',\n FR: 'Contient des cacahuètes',\n RU: 'Содержит орехи',\n DA: 'Indeholder jordnødder'\n },\n PNTSF: {\n EN: 'Peanuts Free',\n TR: 'Fıstık İçermez',\n DE: 'Erdnüsse Frei',\n FR: 'Sans arachide',\n RU: 'Не содержит орехи',\n DA: 'Indeholder ikke jordnødder'\n },\n PRBN: {\n EN: 'Contains Paraben',\n TR: 'Paraben İçerir',\n DE: 'Enthält Paraben',\n FR: 'Contient du parabène',\n RU: 'Содержит парабены',\n DA: 'Indeholder parabener'\n },\n PRBNF: {\n EN: 'Paraben Free',\n TR: 'Paraben İçermez',\n DE: 'Paraben Frei',\n FR: 'Sans paraben',\n RU: 'Не содержит парабены',\n DA: 'Indeholder ikke parabener'\n },\n PRES: {\n EN: 'Contains Preservatives',\n TR: 'Koruyucu İçerir',\n DE: 'Enthält Schutz',\n FR: 'Contient des conservateurs',\n RU: 'Содержит консерванты',\n DA: 'Indeholder konserveringsmidler'\n },\n PRESF: {\n EN: 'Preservatives Free',\n TR: 'Koruyucu İçermez',\n DE: 'Schutz Frei',\n FR: 'Aucun agent de conservation',\n RU: 'Не содержит консерванты',\n DA: 'Indeholder ikke konserveringsmidler'\n },\n QUIN: {\n EN: 'Contains Quinine',\n TR: 'Kinin',\n DE: 'Chinin',\n FR: 'Quinine',\n RU: 'Кинин',\n DA: 'Indeholder kinin'\n },\n QUINF: {\n EN: 'Quinine Free',\n TR: 'Kinin İçermez',\n DE: 'Chinin Frei',\n FR: 'Sans quinine',\n RU: 'Не содержит кинин',\n DA: 'Indeholder ikke kinin'\n },\n SESM: {\n EN: 'Contains Sesame',\n TR: 'Susam İçerir',\n DE: 'Enthält Susam',\n FR: 'Contient du sésame',\n RU: 'Содержит кунжут',\n DA: 'Indeholder sesamfrø'\n },\n SESMF: {\n EN: 'Sesame Free',\n TR: 'Susam İçermez',\n DE: 'Susam Frei',\n FR: 'Ne contient pas de sésame',\n RU: 'Не содержит кунжут',\n DA: 'Indeholder ikke sesamfrø'\n },\n SLCN: {\n EN: 'Contains Silicone',\n TR: 'Silikon',\n DE: 'Silikon',\n FR: 'Silicium',\n RU: 'Содержит силиконы',\n DA: 'Indeholder silikone'\n },\n SLCNF: {\n EN: 'Silicone Free',\n TR: 'Silikon İçermez',\n DE: 'Silikon Frei',\n FR: 'Sans silicone',\n RU: 'Не содержит силиконы',\n DA: 'Indeholder ikke silikone'\n },\n SODM: {\n EN: 'Contains Sodium',\n TR: 'Sodyum',\n DE: 'Natrium',\n FR: 'Sodium',\n RU: 'Содержит натрий',\n DA: 'Indeholder natrium'\n },\n SODMF: {\n EN: 'Sodium Free',\n TR: 'Sodyum İçermez',\n DE: 'Natrium Frei',\n FR: 'Sans sodium',\n RU: 'Не содержит натрий',\n DA: 'Indeholder ikke natrium'\n },\n SOYA: {\n EN: 'Contains Soya',\n TR: 'Soya İçerir',\n DE: 'Enthält Soya',\n FR: 'Contient du soja',\n RU: 'Содержит сою',\n DA: 'Indeholder soja'\n },\n SOYAF: {\n EN: 'Soya Free',\n TR: 'Soya İçermez',\n DE: 'Soya Frei',\n FR: 'Sans soja',\n RU: 'Не содержит сои',\n DA: 'Indeholder ikke soja'\n },\n SPCY: {\n EN: 'Contains Spicy',\n TR: 'Baharat İçerir',\n DE: 'Enthält Würzig',\n FR: 'Contient des épices',\n RU: 'Содержит специи',\n DA: 'Indeholder krydderier'\n },\n SPCYF: {\n EN: 'Spicy Free',\n TR: 'Baharat İçermez',\n DE: 'Würzig Frei',\n FR: 'Sans épices',\n RU: 'Не содержит специи',\n DA: 'Indeholder ikke krydderier'\n },\n SUGR: {\n EN: 'Contains Sugar',\n TR: 'Şeker İçerir',\n DE: 'Enthält Zucker',\n FR: 'Contient du sucre',\n RU: 'Содержит сахар',\n DA: 'Indeholder sukker'\n },\n SUGRF: {\n EN: 'Sugar Free',\n TR: 'Şeker İçermez',\n DE: 'Zucker Frei',\n FR: 'Sans sucre',\n RU: 'Не содержит сахар',\n DA: 'Indeholder ikke sukker'\n },\n SULF: {\n EN: 'Contains Sulfate',\n TR: 'Sülfat İçerir',\n DE: 'Enthält Sulfate',\n FR: 'Contient du sulfate',\n RU: 'Содержит сульфаты',\n DA: 'Indeholder sulfater'\n },\n SULFF: {\n EN: 'Contains Free',\n TR: 'Sülfat İçermez',\n DE: 'Enthält Frei',\n FR: 'Sans sulfate',\n RU: 'Не содержит сульфаты',\n DA: 'Indeholder ikke sulfater'\n },\n SULP: {\n EN: 'Contains Sulphites',\n TR: 'Sülfit İçerir',\n DE: 'Enthält Sulfit',\n FR: 'Contient des sulfites',\n RU: 'Содержит сульфиты',\n DA: 'Indeholder sulfitter'\n },\n SULPF: {\n EN: 'Sulphites Free',\n TR: 'Sülfit İçermez',\n DE: 'Sulfit Frei',\n FR: 'Sans sulfite',\n RU: 'Не содержит сульфиты',\n DA: 'Indeholder ikke sulfitter'\n },\n SWET: {\n EN: 'Contains Sweetening',\n TR: 'Tatlandırıcı',\n DE: 'Sübung',\n FR: 'Édulcorant',\n RU: 'Подсластитель',\n DA: 'Sødestof'\n },\n SWETF: {\n EN: 'Sweetening Free',\n TR: 'Tatlandırıcı İçermez',\n DE: 'Sübung Frei',\n FR: 'Sans édulcorant',\n RU: 'Не содержит подсластитель',\n DA: 'Indeholder ikke sødestoffer'\n },\n TNTS: {\n EN: 'Contains Treenuts',\n TR: 'Fındık İçerir',\n DE: 'Enthält Nüsse',\n FR: 'Contient des noisettes',\n RU: 'Содержит орехи',\n DA: 'Indeholder hasselnødder'\n },\n TNTSF: {\n EN: 'Treenuts Free',\n TR: 'Fındık İçermez',\n DE: 'Nüsse Frei',\n FR: 'Sans noisette',\n RU: 'Не содержит орехи',\n DA: 'Indeholder ikke hasselnødder'\n },\n TRNS: {\n EN: 'Contains Trans Fat',\n TR: 'Trans Yağ',\n DE: 'Transfett',\n FR: 'Gras trans',\n RU: 'Трансжиры',\n DA: 'Transfedt'\n },\n TRNSF: {\n EN: 'Trans Fat Free',\n TR: 'Trans Yağ İçermez',\n DE: 'Transfett Frei',\n FR: 'Ne contient pas de gras trans',\n RU: 'Не содержит трансжиры',\n DA: 'Indeholder ikke transfedt'\n },\n WLNT: {\n EN: 'Contains Walnut',\n TR: 'Ceviz İçerir',\n DE: 'Enthält Walnuss',\n FR: 'Contient de la noix',\n RU: 'Содержит грецкий орех',\n DA: 'Indeholder valnød'\n },\n WLNTF: {\n EN: 'Walnut Free',\n TR: 'Ceviz İçermez',\n DE: 'Walnussfrei',\n FR: 'Sans noix',\n RU: 'Грецкий орех Бесплатно',\n DA: 'Valnød fri'\n },\n allergens_c: {\n EN: 'Allergens',\n TR: 'Alerjenler',\n DE: 'Allergene',\n FR: 'Allergènes',\n RU: 'Аллергены',\n DA: 'Allergener'\n },\n allergen_popup_message: {\n EN: 'This product may contain allergens that may harm your health.',\n TR: 'Bu ürün sağlığınıza zarar verebilecek alerjenler içerebilir.',\n DE: 'Dieses Produkt kann Allergene enthalten, die Ihrer Gesundheit schaden können.',\n FR: 'Ce produit peut contenir des allergènes qui peuvent nuire à votre santé.',\n RU: 'Этот продукт может содержать аллергены, которые могут навредить вашему здоровью.',\n DA: 'Dette produkt kan indeholde allergener, som kan være skadelige for din sundhed.'\n },\n New: {\n EN: 'NEW',\n TR: 'YENİ',\n DE: 'NEU',\n FR: 'NOUVELLE',\n RU: 'НОВИНКА',\n DA: 'NYT'\n },\n Favourite: {\n EN: 'FAVORITE',\n TR: 'FAVORİ',\n DE: 'FAVORITIN',\n FR: 'FAVORI',\n RU: 'ИЗБРАННОЕ',\n DA: 'FAVORIT'\n },\n Discount: {\n EN: 'DISCOUNT',\n TR: 'İNDİRİM',\n DE: 'RABATT',\n FR: 'REMISE',\n RU: 'СКИДКА',\n DA: 'RABAT'\n },\n DayMenu: {\n EN: 'MENU OF THE DAY',\n TR: 'GÜNÜN MENÜSÜ',\n DE: 'MENÜ DES TAGES',\n FR: 'MENU DU JOUR',\n RU: 'МЕНЮ ДНЯ',\n DA: 'DAGENS MENU'\n },\n Vegetarian: {\n EN: 'VEGETARIAN',\n TR: 'VEJETARYEN',\n DE: 'VEGETARIER',\n FR: 'VEGETARIER',\n RU: 'ВЕГЕТАРИАНСКИЙ',\n DA: 'VEGETARISK'\n },\n Spicy: {\n EN: 'SPICY',\n TR: 'ACILI',\n DE: 'WÜRZIG',\n FR: 'ÉPICÉE',\n RU: 'ОСТРЫЙ',\n DA: 'KRYDRET'\n },\n QuickServe: {\n EN: 'QUICK PREPARE',\n TR: 'ÇABUK ÇIKANLAR',\n DE: 'SCHNELL VORBEREITEN',\n FR: 'PRÉPAREZ-VOUS RAPIDEMENT',\n RU: 'БЫСТРЫЙ ЗАВТРАК',\n DA: 'HURTIGT UDSOLGT'\n },\n Traditional: {\n EN: 'TRADITIONAL',\n TR: 'GELENEKSEL',\n DE: 'TRADITIONELL',\n FR: 'TRADITIONNELLE',\n RU: 'ТРАДИЦИОННЫЙ',\n DA: 'TRADITIONEL'\n },\n Season: {\n EN: 'MEVSİMLİK',\n TR: 'SEASON',\n DE: 'JAHRESZEIT',\n FR: 'SAISON',\n RU: 'СЕЗОН',\n DA: 'SESON'\n },\n Economic: {\n EN: 'ECONOMIC',\n TR: 'EKONOMİK',\n DE: 'WIRTSCHAFTLICH',\n FR: 'ÉCONOMIQUE',\n RU: 'ЭКОНОМИЧНЫЙ',\n DA: 'ØKONOMISK'\n },\n Halal: {\n EN: 'HALAL',\n TR: 'HELAL',\n DE: 'HALAL',\n FR: 'HALAL',\n RU: 'ХАЛАЛ',\n DA: 'HALAL'\n },\n Organic: {\n EN: 'ORGANIC',\n TR: 'ORGANİK',\n DE: 'BIO',\n FR: 'BIO',\n RU: 'ОРГАНИЧЕСКИЙ',\n DA: 'ØKO'\n },\n DomesticProduction: {\n EN: 'DOMESTIC PRODUCTION',\n TR: 'YERLİ ÜRETİM',\n DE: 'INLANDSPRODUKTION',\n FR: 'PRODUCTION DOMESTIQUE',\n RU: 'ВНУТРЕННЕЕ ПРОИЗВОДСТВО ',\n DA: 'INDENLANDSK PRODUKTION'\n },\n ImportedProduction: {\n EN: 'IMPORTED PRODUCTION',\n TR: 'İTHAL ÜRETIM',\n DE: 'IMPORTIERTE PRODUKTION',\n FR: 'PRODUCTIONS IMPORTÉES',\n RU: 'ИМПОРТНАЯ ПРОДУКЦИЯ',\n DA: 'IMPORTERET PRODUKTION'\n },\n TRY: {\n EN: '₺',\n TR: '₺',\n DE: '₺',\n FR: '₺',\n AR: '₺'\n },\n USD: {\n EN: '$',\n TR: '$',\n DE: '$',\n FR: '$',\n AR: '$'\n },\n NGN: {\n EN: '₦',\n TR: '₦',\n DE: '₦',\n FR: '₦',\n AR: '₦'\n },\n EUR: {\n EN: '€',\n TR: '€',\n DE: '€',\n FR: '€',\n AR: '€'\n },\n GBP: {\n EN: '£',\n TR: '£',\n DE: '£',\n FR: '£',\n AR: '£'\n },\n JPY: {\n EN: '¥',\n TR: '¥',\n DE: '¥',\n FR: '¥',\n AR: '¥'\n },\n RUB: {\n EN: 'руб',\n TR: 'руб',\n DE: 'руб',\n FR: 'руб',\n AR: 'руб'\n },\n CAD: {\n EN: '$',\n TR: '$',\n DE: '$',\n FR: '$',\n AR: '$'\n },\n AUD: {\n EN: '$',\n TR: '$',\n DE: '$',\n FR: '$',\n AR: '$'\n },\n SAR: {\n EN: '﷼',\n TR: '﷼',\n DE: '﷼',\n FR: '﷼',\n AR: '﷼'\n },\n KWD: {\n EN: 'KWD',\n TR: 'KWD',\n DE: 'KWD',\n FR: 'KWD',\n AR: 'د.ك'\n },\n CNY: {\n EN: '¥',\n TR: '¥',\n DE: '¥',\n FR: '¥',\n AR: '¥'\n },\n IQD: {\n EN: 'د.ع',\n TR: 'د.ع',\n DE: 'د.ع',\n FR: 'د.ع',\n AR: 'د.ع'\n },\n INR: {\n EN: '₹',\n TR: '₹',\n DE: '₹',\n FR: '₹',\n AR: '₹'\n },\n IRR: {\n EN: '﷼',\n TR: '﷼',\n DE: '﷼',\n FR: '﷼',\n AR: '﷼'\n },\n AED: {\n EN: 'AED',\n TR: 'AED',\n DE: 'AED',\n FR: 'AED',\n AR: 'د.إ'\n },\n AFN: {\n EN: '؋',\n TR: '؋',\n DE: '؋',\n FR: '؋',\n AR: '؋'\n },\n ARS: {\n EN: '$',\n TR: '$',\n DE: '$',\n FR: '$',\n AR: '$'\n },\n AZN: {\n EN: '₼',\n TR: '₼',\n DE: '₼',\n FR: '₼',\n AR: '₼'\n },\n BRL: {\n EN: 'R$',\n TR: 'R$',\n DE: 'R$',\n FR: 'R$',\n AR: 'R$'\n },\n CHF: {\n EN: '₣',\n TR: '₣',\n DE: '₣',\n FR: '₣',\n AR: '₣'\n },\n CLP: {\n EN: '$',\n TR: '$',\n DE: '$',\n FR: '$',\n AR: '$'\n },\n COP: {\n EN: '$',\n TR: '$',\n DE: '$',\n FR: '$',\n AR: '$'\n },\n CUP: {\n EN: '₱',\n TR: '₱',\n DE: '₱',\n FR: '₱',\n AR: '₱'\n },\n DKK: {\n EN: 'kr',\n TR: 'kr',\n DE: 'kr',\n FR: 'kr',\n AR: 'kr'\n },\n EGP: {\n EN: '£',\n TR: '£',\n DE: '£',\n FR: '£',\n AR: '£'\n },\n HKD: {\n EN: 'HK$',\n TR: 'HK$',\n DE: 'HK$',\n FR: 'HK$',\n AR: 'HK$'\n },\n KGS: {\n EN: 'c.',\n TR: 'c.',\n DE: 'c.',\n FR: 'c.',\n AR: 'c.'\n },\n KRW: {\n EN: '₩',\n TR: '₩',\n DE: '₩',\n FR: '₩',\n AR: '₩'\n },\n KZT: {\n EN: '₸',\n TR: '₸',\n DE: '₸',\n FR: '₸',\n AR: '₸'\n },\n LYD: {\n EN: 'LD',\n TR: 'LD',\n DE: 'LD',\n FR: 'LD',\n AR: 'LD'\n },\n MXN: {\n EN: '$',\n TR: '$',\n DE: '$',\n FR: '$',\n AR: '$'\n },\n MYR: {\n EN: 'RM',\n TR: 'RM',\n DE: 'RM',\n FR: 'RM',\n AR: 'RM'\n },\n PKR: {\n EN: '₨',\n TR: '₨',\n DE: '₨',\n FR: '₨',\n AR: '₨'\n },\n TJS: {\n EN: 'лв',\n TR: 'лв',\n DE: 'лв',\n FR: 'лв',\n AR: 'лв'\n },\n TMT: {\n EN: '₼',\n TR: '₼',\n DE: '₼',\n FR: '₼',\n AR: '₼'\n },\n TND: {\n EN: 'د.ت',\n TR: 'د.ت',\n DE: 'د.ت',\n FR: 'د.ت',\n AR: 'د.ت'\n },\n UZS: {\n EN: 'UZS',\n TR: 'UZS',\n DE: 'UZS',\n FR: 'UZS',\n AR: 'UZS'\n },\n NOK: {\n EN: 'kr',\n TR: 'kr',\n DE: 'kr',\n FR: 'kr',\n AR: 'kr'\n },\n NPR: {\n EN: '₨',\n TR: '₨',\n DE: '₨',\n FR: '₨',\n AR: '₨'\n },\n SYP: {\n EN: '£',\n TR: '£',\n DE: '£',\n FR: '£',\n AR: '£'\n },\n RWF: {\n EN: '£',\n TR: '£',\n DE: '£',\n FR: '£',\n AR: '£'\n },\n QAR: {\n EN: 'ر.ق',\n TR: 'ر.ق',\n DE: 'ر.ق',\n FR: 'ر.ق',\n AR: 'ر.ق'\n },\n GEL: {\n EN: '₾',\n TR: '₾',\n DE: '₾',\n FR: '₾',\n AR: '₾'\n },\n THB: {\n EN: '฿',\n TR: '฿',\n DE: '฿',\n FR: '฿',\n AR: '฿'\n },\n CNT: {\n EN: '¢',\n TR: '¢',\n DE: '¢',\n FR: '¢',\n AR: '¢'\n },\n OMR: {\n EN: 'ر.ع.',\n TR: 'ر.ع.',\n DE: 'ر.ع.',\n FR: 'ر.ع.',\n AR: 'ر.ع.'\n },\n UGX: {\n EN: 'USh',\n TR: 'USh',\n DE: 'USh',\n FR: 'USh',\n AR: 'USh'\n }\n});\nvar APP_TRANSLATE_PROVIDER = [];\nfunction getDefaultTranslation() {\n return APP_TRANSLATE_PROVIDER.find(function (value) {\n return value.lang === APP_DEFAULT_LANG;\n });\n}\nfunction getTranslation() {\n var savedLang = AppStorage.getItem(StorageKey.LANGUAGE_CODE);\n var lang = AppLanguageKeys.hasOwnProperty(savedLang) ? savedLang : APP_DEFAULT_LANG;\n return APP_TRANSLATE_PROVIDER.find(function (value) {\n return value.lang === lang;\n });\n}\nfunction initTranslations($translateProvider) {\n var langKeys = Object.keys(AppLanguageKeys);\n var traKeys = Object.keys(APP_TRANSLATIONS);\n for (var _i = 0, _langKeys = langKeys; _i < _langKeys.length; _i++) {\n var lang = _langKeys[_i];\n var values = {};\n APP_TRANSLATE_PROVIDER.push({\n lang: lang,\n values: values\n });\n var _iterator = _createForOfIteratorHelper(traKeys),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var tra = _step.value;\n var currentLang = APP_TRANSLATIONS[tra].hasOwnProperty(lang) ? lang : APP_DEFAULT_LANG;\n values[tra] = APP_TRANSLATIONS[tra][currentLang];\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n Object.freeze(APP_TRANSLATE_PROVIDER);\n var _iterator2 = _createForOfIteratorHelper(APP_TRANSLATE_PROVIDER),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _tra = _step2.value;\n $translateProvider.translations(_tra.lang, _tra.values);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n $translateProvider.fallbackLanguage(getDefaultTranslation().lang);\n}\n\nvar lodash = createCommonjsModule(function (module, exports) {\n(function(){var undefined$1;var VERSION='4.17.21';var LARGE_ARRAY_SIZE=200;var CORE_ERROR_TEXT='Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',FUNC_ERROR_TEXT='Expected a function',INVALID_TEMPL_VAR_ERROR_TEXT='Invalid `variable` option passed into `_.template`';var HASH_UNDEFINED='__lodash_hash_undefined__';var MAX_MEMOIZE_SIZE=500;var PLACEHOLDER='__lodash_placeholder__';var CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4;var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;var WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512;var DEFAULT_TRUNC_LENGTH=30,DEFAULT_TRUNC_OMISSION='...';var HOT_COUNT=800,HOT_SPAN=16;var LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3;var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e+308,NAN=0/0;var MAX_ARRAY_LENGTH=4294967295,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1;var wrapFlags=[['ary',WRAP_ARY_FLAG],['bind',WRAP_BIND_FLAG],['bindKey',WRAP_BIND_KEY_FLAG],['curry',WRAP_CURRY_FLAG],['curryRight',WRAP_CURRY_RIGHT_FLAG],['flip',WRAP_FLIP_FLAG],['partial',WRAP_PARTIAL_FLAG],['partialRight',WRAP_PARTIAL_RIGHT_FLAG],['rearg',WRAP_REARG_FLAG]];var argsTag='[object Arguments]',arrayTag='[object Array]',asyncTag='[object AsyncFunction]',boolTag='[object Boolean]',dateTag='[object Date]',domExcTag='[object DOMException]',errorTag='[object Error]',funcTag='[object Function]',genTag='[object GeneratorFunction]',mapTag='[object Map]',numberTag='[object Number]',nullTag='[object Null]',objectTag='[object Object]',promiseTag='[object Promise]',proxyTag='[object Proxy]',regexpTag='[object RegExp]',setTag='[object Set]',stringTag='[object String]',symbolTag='[object Symbol]',undefinedTag='[object Undefined]',weakMapTag='[object WeakMap]',weakSetTag='[object WeakSet]';var arrayBufferTag='[object ArrayBuffer]',dataViewTag='[object DataView]',float32Tag='[object Float32Array]',float64Tag='[object Float64Array]',int8Tag='[object Int8Array]',int16Tag='[object Int16Array]',int32Tag='[object Int32Array]',uint8Tag='[object Uint8Array]',uint8ClampedTag='[object Uint8ClampedArray]',uint16Tag='[object Uint16Array]',uint32Tag='[object Uint32Array]';var reEmptyStringLeading=/\\b__p \\+= '';/g,reEmptyStringMiddle=/\\b(__p \\+=) '' \\+/g,reEmptyStringTrailing=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;var reEscapedHtml=/&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml=/[&<>\"']/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source);var reEscape=/<%-([\\s\\S]+?)%>/g,reEvaluate=/<%([\\s\\S]+?)%>/g,reInterpolate=/<%=([\\s\\S]+?)%>/g;var reIsDeepProp=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,reIsPlainProp=/^\\w*$/,rePropName=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\nvar reRegExpChar=/[\\\\^$.*+?()[\\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source);var reTrimStart=/^\\s+/;var reWhitespace=/\\s/;var reWrapComment=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,reWrapDetails=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,reSplitDetails=/,? & /;var reAsciiWord=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\nvar reForbiddenIdentifierChars=/[()=,{}\\[\\]\\/\\s]/;var reEscapeChar=/\\\\(\\\\)?/g;\nvar reEsTemplate=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;var reFlags=/\\w*$/;var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;var reIsBinary=/^0b[01]+$/i;var reIsHostCtor=/^\\[object .+?Constructor\\]$/;var reIsOctal=/^0o[0-7]+$/i;var reIsUint=/^(?:0|[1-9]\\d*)$/;var reLatin=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;var reNoMatch=/($^)/;var reUnescapedString=/['\\n\\r\\u2028\\u2029\\\\]/g;var rsAstralRange='\\\\ud800-\\\\udfff',rsComboMarksRange='\\\\u0300-\\\\u036f',reComboHalfMarksRange='\\\\ufe20-\\\\ufe2f',rsComboSymbolsRange='\\\\u20d0-\\\\u20ff',rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsDingbatRange='\\\\u2700-\\\\u27bf',rsLowerRange='a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',rsMathOpRange='\\\\xac\\\\xb1\\\\xd7\\\\xf7',rsNonCharRange='\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',rsPunctuationRange='\\\\u2000-\\\\u206f',rsSpaceRange=' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',rsUpperRange='A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',rsVarRange='\\\\ufe0e\\\\ufe0f',rsBreakRange=rsMathOpRange+rsNonCharRange+rsPunctuationRange+rsSpaceRange;var rsApos=\"['\\u2019]\",rsAstral='['+rsAstralRange+']',rsBreak='['+rsBreakRange+']',rsCombo='['+rsComboRange+']',rsDigits='\\\\d+',rsDingbat='['+rsDingbatRange+']',rsLower='['+rsLowerRange+']',rsMisc='[^'+rsAstralRange+rsBreakRange+rsDigits+rsDingbatRange+rsLowerRange+rsUpperRange+']',rsFitz='\\\\ud83c[\\\\udffb-\\\\udfff]',rsModifier='(?:'+rsCombo+'|'+rsFitz+')',rsNonAstral='[^'+rsAstralRange+']',rsRegional='(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',rsSurrPair='[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',rsUpper='['+rsUpperRange+']',rsZWJ='\\\\u200d';var rsMiscLower='(?:'+rsLower+'|'+rsMisc+')',rsMiscUpper='(?:'+rsUpper+'|'+rsMisc+')',rsOptContrLower='(?:'+rsApos+'(?:d|ll|m|re|s|t|ve))?',rsOptContrUpper='(?:'+rsApos+'(?:D|LL|M|RE|S|T|VE))?',reOptMod=rsModifier+'?',rsOptVar='['+rsVarRange+']?',rsOptJoin='(?:'+rsZWJ+'(?:'+[rsNonAstral,rsRegional,rsSurrPair].join('|')+')'+rsOptVar+reOptMod+')*',rsOrdLower='\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',rsOrdUpper='\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',rsSeq=rsOptVar+reOptMod+rsOptJoin,rsEmoji='(?:'+[rsDingbat,rsRegional,rsSurrPair].join('|')+')'+rsSeq,rsSymbol='(?:'+[rsNonAstral+rsCombo+'?',rsCombo,rsRegional,rsSurrPair,rsAstral].join('|')+')';var reApos=RegExp(rsApos,'g');\nvar reComboMark=RegExp(rsCombo,'g');var reUnicode=RegExp(rsFitz+'(?='+rsFitz+')|'+rsSymbol+rsSeq,'g');var reUnicodeWord=RegExp([rsUpper+'?'+rsLower+'+'+rsOptContrLower+'(?='+[rsBreak,rsUpper,'$'].join('|')+')',rsMiscUpper+'+'+rsOptContrUpper+'(?='+[rsBreak,rsUpper+rsMiscLower,'$'].join('|')+')',rsUpper+'?'+rsMiscLower+'+'+rsOptContrLower,rsUpper+'+'+rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join('|'),'g');var reHasUnicode=RegExp('['+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+']');var reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var contextProps=['Array','Buffer','DataView','Date','Error','Float32Array','Float64Array','Function','Int8Array','Int16Array','Int32Array','Map','Math','Object','Promise','RegExp','Set','String','Symbol','TypeError','Uint8Array','Uint8ClampedArray','Uint16Array','Uint32Array','WeakMap','_','clearTimeout','isFinite','parseInt','setTimeout'];var templateCounter=-1;var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=false;var deburredLetters={\n'\\xc0':'A','\\xc1':'A','\\xc2':'A','\\xc3':'A','\\xc4':'A','\\xc5':'A','\\xe0':'a','\\xe1':'a','\\xe2':'a','\\xe3':'a','\\xe4':'a','\\xe5':'a','\\xc7':'C','\\xe7':'c','\\xd0':'D','\\xf0':'d','\\xc8':'E','\\xc9':'E','\\xca':'E','\\xcb':'E','\\xe8':'e','\\xe9':'e','\\xea':'e','\\xeb':'e','\\xcc':'I','\\xcd':'I','\\xce':'I','\\xcf':'I','\\xec':'i','\\xed':'i','\\xee':'i','\\xef':'i','\\xd1':'N','\\xf1':'n','\\xd2':'O','\\xd3':'O','\\xd4':'O','\\xd5':'O','\\xd6':'O','\\xd8':'O','\\xf2':'o','\\xf3':'o','\\xf4':'o','\\xf5':'o','\\xf6':'o','\\xf8':'o','\\xd9':'U','\\xda':'U','\\xdb':'U','\\xdc':'U','\\xf9':'u','\\xfa':'u','\\xfb':'u','\\xfc':'u','\\xdd':'Y','\\xfd':'y','\\xff':'y','\\xc6':'Ae','\\xe6':'ae','\\xde':'Th','\\xfe':'th','\\xdf':'ss',\n'\\u0100':'A','\\u0102':'A','\\u0104':'A','\\u0101':'a','\\u0103':'a','\\u0105':'a','\\u0106':'C','\\u0108':'C','\\u010a':'C','\\u010c':'C','\\u0107':'c','\\u0109':'c','\\u010b':'c','\\u010d':'c','\\u010e':'D','\\u0110':'D','\\u010f':'d','\\u0111':'d','\\u0112':'E','\\u0114':'E','\\u0116':'E','\\u0118':'E','\\u011a':'E','\\u0113':'e','\\u0115':'e','\\u0117':'e','\\u0119':'e','\\u011b':'e','\\u011c':'G','\\u011e':'G','\\u0120':'G','\\u0122':'G','\\u011d':'g','\\u011f':'g','\\u0121':'g','\\u0123':'g','\\u0124':'H','\\u0126':'H','\\u0125':'h','\\u0127':'h','\\u0128':'I','\\u012a':'I','\\u012c':'I','\\u012e':'I','\\u0130':'I','\\u0129':'i','\\u012b':'i','\\u012d':'i','\\u012f':'i','\\u0131':'i','\\u0134':'J','\\u0135':'j','\\u0136':'K','\\u0137':'k','\\u0138':'k','\\u0139':'L','\\u013b':'L','\\u013d':'L','\\u013f':'L','\\u0141':'L','\\u013a':'l','\\u013c':'l','\\u013e':'l','\\u0140':'l','\\u0142':'l','\\u0143':'N','\\u0145':'N','\\u0147':'N','\\u014a':'N','\\u0144':'n','\\u0146':'n','\\u0148':'n','\\u014b':'n','\\u014c':'O','\\u014e':'O','\\u0150':'O','\\u014d':'o','\\u014f':'o','\\u0151':'o','\\u0154':'R','\\u0156':'R','\\u0158':'R','\\u0155':'r','\\u0157':'r','\\u0159':'r','\\u015a':'S','\\u015c':'S','\\u015e':'S','\\u0160':'S','\\u015b':'s','\\u015d':'s','\\u015f':'s','\\u0161':'s','\\u0162':'T','\\u0164':'T','\\u0166':'T','\\u0163':'t','\\u0165':'t','\\u0167':'t','\\u0168':'U','\\u016a':'U','\\u016c':'U','\\u016e':'U','\\u0170':'U','\\u0172':'U','\\u0169':'u','\\u016b':'u','\\u016d':'u','\\u016f':'u','\\u0171':'u','\\u0173':'u','\\u0174':'W','\\u0175':'w','\\u0176':'Y','\\u0177':'y','\\u0178':'Y','\\u0179':'Z','\\u017b':'Z','\\u017d':'Z','\\u017a':'z','\\u017c':'z','\\u017e':'z','\\u0132':'IJ','\\u0133':'ij','\\u0152':'Oe','\\u0153':'oe','\\u0149':\"'n\",'\\u017f':'s'};var htmlEscapes={'&':'&','<':'<','>':'>','\"':'"',\"'\":'''};var htmlUnescapes={'&':'&','<':'<','>':'>','"':'\"',''':\"'\"};var stringEscapes={'\\\\':'\\\\',\"'\":\"'\",'\\n':'n','\\r':'r','\\u2028':'u2028','\\u2029':'u2029'};var freeParseFloat=parseFloat,freeParseInt=parseInt;var freeGlobal=typeof commonjsGlobal=='object'&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;var freeSelf=typeof self=='object'&&self&&self.Object===Object&&self;var root=freeGlobal||freeSelf||Function('return this')();var freeExports=exports&&!exports.nodeType&&exports;var freeModule=freeExports&&'object'=='object'&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports;var freeProcess=moduleExports&&freeGlobal.process;var nodeUtil=function(){try{\nvar types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}\nreturn freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();var nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;\nfunction apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2]);}return func.apply(thisArg,args);}\nfunction arrayAggregator(array,setter,iteratee,accumulator){var index=-1,length=array==null?0:array.length;while(++index-1;}\nfunction arrayIncludesWith(array,value,comparator){var index=-1,length=array==null?0:array.length;while(++index-1){}return index;}\nfunction charsEndIndex(strSymbols,chrSymbols){var index=strSymbols.length;while(index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1){}return index;}\nfunction countHolders(array,placeholder){var length=array.length,result=0;while(length--){if(array[length]===placeholder){++result;}}return result;}\nvar deburrLetter=basePropertyOf(deburredLetters);\nvar escapeHtmlChar=basePropertyOf(htmlEscapes);\nfunction escapeStringChar(chr){return '\\\\'+stringEscapes[chr];}\nfunction getValue(object,key){return object==null?undefined$1:object[key];}\nfunction hasUnicode(string){return reHasUnicode.test(string);}\nfunction hasUnicodeWord(string){return reHasUnicodeWord.test(string);}\nfunction iteratorToArray(iterator){var data,result=[];while(!(data=iterator.next()).done){result.push(data.value);}return result;}\nfunction mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}\nfunction overArg(func,transform){return function(arg){return func(transform(arg));};}\nfunction replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=0,result=[];while(++index-1;}\nfunction listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else {data[index][1]=value;}return this;}\nListCache.prototype.clear=listCacheClear;ListCache.prototype['delete']=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;\nfunction MapCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index=lower?number:lower;}}return number;}\nfunction baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer){result=object?customizer(value,key,object,stack):customizer(value);}if(result!==undefined$1){return result;}if(!isObject(value)){return value;}var isArr=isArray(value);if(isArr){result=initCloneArray(value);if(!isDeep){return copyArray(value,result);}}else {var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value)){return cloneBuffer(value,isDeep);}if(tag==objectTag||tag==argsTag||isFunc&&!object){result=isFlat||isFunc?{}:initCloneObject(value);if(!isDeep){return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):copySymbols(value,baseAssign(result,value));}}else {if(!cloneableTags[tag]){return object?value:{};}result=initCloneByTag(value,tag,isDeep);}}\nstack||(stack=new Stack());var stacked=stack.get(value);if(stacked){return stacked;}stack.set(value,result);if(isSet(value)){value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack));});}else if(isMap(value)){value.forEach(function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack));});}var keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys;var props=isArr?undefined$1:keysFunc(value);arrayEach(props||value,function(subValue,key){if(props){key=subValue;subValue=value[key];}\nassignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack));});return result;}\nfunction baseConforms(source){var props=keys(source);return function(object){return baseConformsTo(object,source,props);};}\nfunction baseConformsTo(object,source,props){var length=props.length;if(object==null){return !length;}object=Object(object);while(length--){var key=props[length],predicate=source[key],value=object[key];if(value===undefined$1&&!(key in object)||!predicate(value)){return false;}}return true;}\nfunction baseDelay(func,wait,args){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return setTimeout(function(){func.apply(undefined$1,args);},wait);}\nfunction baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=true,length=array.length,result=[],valuesLength=values.length;if(!length){return result;}if(iteratee){values=arrayMap(values,baseUnary(iteratee));}if(comparator){includes=arrayIncludesWith;isCommon=false;}else if(values.length>=LARGE_ARRAY_SIZE){includes=cacheHas;isCommon=false;values=new SetCache(values);}outer:while(++indexlength?0:length+start;}end=end===undefined$1||end>length?length:toInteger(end);if(end<0){end+=length;}end=start>end?0:toLength(end);while(start0&&predicate(value)){if(depth>1){\nbaseFlatten(value,depth-1,predicate,isStrict,result);}else {arrayPush(result,value);}}else if(!isStrict){result[result.length]=value;}}return result;}\nvar baseFor=createBaseFor();\nvar baseForRight=createBaseFor(true);\nfunction baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys);}\nfunction baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys);}\nfunction baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key]);});}\nfunction baseGet(object,path){path=castPath(path,object);var index=0,length=path.length;while(object!=null&&indexother;}\nfunction baseHas(object,key){return object!=null&&hasOwnProperty.call(object,key);}\nfunction baseHasIn(object,key){return object!=null&&key in Object(object);}\nfunction baseInRange(number,start,end){return number>=nativeMin(start,end)&&number=120&&array.length>=120)?new SetCache(othIndex&&array):undefined$1;}array=arrays[0];var index=-1,seen=caches[0];outer:while(++index-1){if(seen!==array){splice.call(seen,fromIndex,1);}splice.call(array,fromIndex,1);}}return array;}\nfunction basePullAt(array,indexes){var length=array?indexes.length:0,lastIndex=length-1;while(length--){var index=indexes[length];if(length==lastIndex||index!==previous){var previous=index;if(isIndex(index)){splice.call(array,index,1);}else {baseUnset(array,index);}}}return array;}\nfunction baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1));}\nfunction baseRange(start,end,step,fromRight){var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);while(length--){result[fromRight?length:++index]=start;start+=step;}return result;}\nfunction baseRepeat(string,n){var result='';if(!string||n<1||n>MAX_SAFE_INTEGER){return result;}\ndo{if(n%2){result+=string;}n=nativeFloor(n/2);if(n){string+=string;}}while(n);return result;}\nfunction baseRest(func,start){return setToString(overRest(func,start,identity),func+'');}\nfunction baseSample(collection){return arraySample(values(collection));}\nfunction baseSampleSize(collection,n){var array=values(collection);return shuffleSelf(array,baseClamp(n,0,array.length));}\nfunction baseSet(object,path,value,customizer){if(!isObject(object)){return object;}path=castPath(path,object);var index=-1,length=path.length,lastIndex=length-1,nested=object;while(nested!=null&&++indexlength?0:length+start;}end=end>length?length:end;if(end<0){end+=length;}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index>>1,computed=array[mid];if(computed!==null&&!isSymbol(computed)&&(retHighest?computed<=value:computed=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set){return setToArray(set);}isCommon=false;includes=cacheHas;seen=new SetCache();}else {seen=iteratee?[]:result;}outer:while(++index=length?array:baseSlice(array,start,end);}\nvar clearTimeout=ctxClearTimeout||function(id){return root.clearTimeout(id);};\nfunction cloneBuffer(buffer,isDeep){if(isDeep){return buffer.slice();}var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);buffer.copy(result);return result;}\nfunction cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}\nfunction cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength);}\nfunction cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));result.lastIndex=regexp.lastIndex;return result;}\nfunction cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{};}\nfunction cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length);}\nfunction compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined$1,valIsNull=value===null,valIsReflexive=value===value,valIsSymbol=isSymbol(value);var othIsDefined=other!==undefined$1,othIsNull=other===null,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive){return 1;}if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength){return result;}var order=orders[index];return result*(order=='desc'?-1:1);}}\nreturn object.index-other.index;}\nfunction composeArgs(args,partials,holders,isCurried){var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;while(++leftIndex1?sources[length-1]:undefined$1,guard=length>2?sources[2]:undefined$1;customizer=assigner.length>3&&typeof customizer=='function'?(length--,customizer):undefined$1;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined$1:customizer;length=1;}object=Object(object);while(++index-1?iterable[iteratee?collection[index]:index]:undefined$1;};}\nfunction createFlow(fromRight){return flatRest(function(funcs){var length=funcs.length,index=length,prereq=LodashWrapper.prototype.thru;if(fromRight){funcs.reverse();}while(index--){var func=funcs[index];if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(prereq&&!wrapper&&getFuncName(func)=='wrapper'){var wrapper=new LodashWrapper([],true);}}index=wrapper?index:length;while(++index1){args.reverse();}if(isAry&&aryarrLength)){return false;}\nvar arrStacked=stack.get(array);var othStacked=stack.get(other);if(arrStacked&&othStacked){return arrStacked==other&&othStacked==array;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache():undefined$1;stack.set(array,other);stack.set(other,array);\nwhile(++index1?'& ':'')+details[lastIndex];details=details.join(length>2?', ':' ');return source.replace(reWrapComment,'{\\n/* [wrapped with '+details+'] */\\n');}\nfunction isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol]);}\nfunction isIndex(value,length){var type=typeof value;length=length==null?MAX_SAFE_INTEGER:length;return !!length&&(type=='number'||type!='symbol'&&reIsUint.test(value))&&value>-1&&value%1==0&&value0){if(++count>=HOT_COUNT){return arguments[0];}}else {count=0;}return func.apply(undefined$1,arguments);};}\nfunction shuffleSelf(array,size){var index=-1,length=array.length,lastIndex=length-1;size=size===undefined$1?length:size;while(++index1?arrays[length-1]:undefined$1;iteratee=typeof iteratee=='function'?(arrays.pop(),iteratee):undefined$1;return unzipWith(arrays,iteratee);});\nfunction chain(value){var result=lodash(value);result.__chain__=true;return result;}\nfunction tap(value,interceptor){interceptor(value);return value;}\nfunction thru(value,interceptor){return interceptor(value);}\nvar wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths);};if(length>1||this.__actions__.length||!(value instanceof LazyWrapper)||!isIndex(start)){return this.thru(interceptor);}value=value.slice(start,+start+(length?1:0));value.__actions__.push({'func':thru,'args':[interceptor],'thisArg':undefined$1});return new LodashWrapper(value,this.__chain__).thru(function(array){if(length&&!array.length){array.push(undefined$1);}return array;});});\nfunction wrapperChain(){return chain(this);}\nfunction wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__);}\nfunction wrapperNext(){if(this.__values__===undefined$1){this.__values__=toArray(this.value());}var done=this.__index__>=this.__values__.length,value=done?undefined$1:this.__values__[this.__index__++];return {'done':done,'value':value};}\nfunction wrapperToIterator(){return this;}\nfunction wrapperPlant(value){var result,parent=this;while(parent instanceof baseLodash){var clone=wrapperClone(parent);clone.__index__=0;clone.__values__=undefined$1;if(result){previous.__wrapped__=clone;}else {result=clone;}var previous=clone;parent=parent.__wrapped__;}previous.__wrapped__=value;return result;}\nfunction wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;if(this.__actions__.length){wrapped=new LazyWrapper(this);}wrapped=wrapped.reverse();wrapped.__actions__.push({'func':thru,'args':[reverse],'thisArg':undefined$1});return new LodashWrapper(wrapped,this.__chain__);}return this.thru(reverse);}\nfunction wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__);}\nvar countBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){++result[key];}else {baseAssignValue(result,key,1);}});\nfunction every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined$1;}return func(collection,getIteratee(predicate,3));}\nfunction filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,getIteratee(predicate,3));}\nvar find=createFind(findIndex);\nvar findLast=createFind(findLastIndex);\nfunction flatMap(collection,iteratee){return baseFlatten(map(collection,iteratee),1);}\nfunction flatMapDeep(collection,iteratee){return baseFlatten(map(collection,iteratee),INFINITY);}\nfunction flatMapDepth(collection,iteratee,depth){depth=depth===undefined$1?1:toInteger(depth);return baseFlatten(map(collection,iteratee),depth);}\nfunction forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,getIteratee(iteratee,3));}\nfunction forEachRight(collection,iteratee){var func=isArray(collection)?arrayEachRight:baseEachRight;return func(collection,getIteratee(iteratee,3));}\nvar groupBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){result[key].push(value);}else {baseAssignValue(result,key,[value]);}});\nfunction includes(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection);fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;if(fromIndex<0){fromIndex=nativeMax(length+fromIndex,0);}return isString(collection)?fromIndex<=length&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1;}\nvar invokeMap=baseRest(function(collection,path,args){var index=-1,isFunc=typeof path=='function',result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value){result[++index]=isFunc?apply(path,value,args):baseInvoke(value,path,args);});return result;});\nvar keyBy=createAggregator(function(result,value,key){baseAssignValue(result,key,value);});\nfunction map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,getIteratee(iteratee,3));}\nfunction orderBy(collection,iteratees,orders,guard){if(collection==null){return [];}if(!isArray(iteratees)){iteratees=iteratees==null?[]:[iteratees];}orders=guard?undefined$1:orders;if(!isArray(orders)){orders=orders==null?[]:[orders];}return baseOrderBy(collection,iteratees,orders);}\nvar partition=createAggregator(function(result,value,key){result[key?0:1].push(value);},function(){return [[],[]];});\nfunction reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEach);}\nfunction reduceRight(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduceRight:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEachRight);}\nfunction reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(getIteratee(predicate,3)));}\nfunction sample(collection){var func=isArray(collection)?arraySample:baseSample;return func(collection);}\nfunction sampleSize(collection,n,guard){if(guard?isIterateeCall(collection,n,guard):n===undefined$1){n=1;}else {n=toInteger(n);}var func=isArray(collection)?arraySampleSize:baseSampleSize;return func(collection,n);}\nfunction shuffle(collection){var func=isArray(collection)?arrayShuffle:baseShuffle;return func(collection);}\nfunction size(collection){if(collection==null){return 0;}if(isArrayLike(collection)){return isString(collection)?stringSize(collection):collection.length;}var tag=getTag(collection);if(tag==mapTag||tag==setTag){return collection.size;}return baseKeys(collection).length;}\nfunction some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined$1;}return func(collection,getIteratee(predicate,3));}\nvar sortBy=baseRest(function(collection,iteratees){if(collection==null){return [];}var length=iteratees.length;if(length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])){iteratees=[];}else if(length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])){iteratees=[iteratees[0]];}return baseOrderBy(collection,baseFlatten(iteratees,1),[]);});\nvar now=ctxNow||function(){return root.Date.now();};\nfunction after(n,func){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}n=toInteger(n);return function(){if(--n<1){return func.apply(this,arguments);}};}\nfunction ary(func,n,guard){n=guard?undefined$1:n;n=func&&n==null?func.length:n;return createWrap(func,WRAP_ARY_FLAG,undefined$1,undefined$1,undefined$1,undefined$1,n);}\nfunction before(n,func){var result;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}n=toInteger(n);return function(){if(--n>0){result=func.apply(this,arguments);}if(n<=1){func=undefined$1;}return result;};}\nvar bind=baseRest(function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG;}return createWrap(func,bitmask,thisArg,partials,holders);});\nvar bindKey=baseRest(function(object,key,partials){var bitmask=WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=WRAP_PARTIAL_FLAG;}return createWrap(key,bitmask,object,partials,holders);});\nfunction curry(func,arity,guard){arity=guard?undefined$1:arity;var result=createWrap(func,WRAP_CURRY_FLAG,undefined$1,undefined$1,undefined$1,undefined$1,undefined$1,arity);result.placeholder=curry.placeholder;return result;}\nfunction curryRight(func,arity,guard){arity=guard?undefined$1:arity;var result=createWrap(func,WRAP_CURRY_RIGHT_FLAG,undefined$1,undefined$1,undefined$1,undefined$1,undefined$1,arity);result.placeholder=curryRight.placeholder;return result;}\nfunction debounce(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=false,maxing=false,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}wait=toNumber(wait)||0;if(isObject(options)){leading=!!options.leading;maxing='maxWait'in options;maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait;trailing='trailing'in options?!!options.trailing:trailing;}function invokeFunc(time){var args=lastArgs,thisArg=lastThis;lastArgs=lastThis=undefined$1;lastInvokeTime=time;result=func.apply(thisArg,args);return result;}function leadingEdge(time){\nlastInvokeTime=time;\ntimerId=setTimeout(timerExpired,wait);\nreturn leading?invokeFunc(time):result;}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting;}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;\nreturn lastCallTime===undefined$1||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait;}function timerExpired(){var time=now();if(shouldInvoke(time)){return trailingEdge(time);}\ntimerId=setTimeout(timerExpired,remainingWait(time));}function trailingEdge(time){timerId=undefined$1;\nif(trailing&&lastArgs){return invokeFunc(time);}lastArgs=lastThis=undefined$1;return result;}function cancel(){if(timerId!==undefined$1){clearTimeout(timerId);}lastInvokeTime=0;lastArgs=lastCallTime=lastThis=timerId=undefined$1;}function flush(){return timerId===undefined$1?result:trailingEdge(now());}function debounced(){var time=now(),isInvoking=shouldInvoke(time);lastArgs=arguments;lastThis=this;lastCallTime=time;if(isInvoking){if(timerId===undefined$1){return leadingEdge(lastCallTime);}if(maxing){\nclearTimeout(timerId);timerId=setTimeout(timerExpired,wait);return invokeFunc(lastCallTime);}}if(timerId===undefined$1){timerId=setTimeout(timerExpired,wait);}return result;}debounced.cancel=cancel;debounced.flush=flush;return debounced;}\nvar defer=baseRest(function(func,args){return baseDelay(func,1,args);});\nvar delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args);});\nfunction flip(func){return createWrap(func,WRAP_FLIP_FLAG);}\nfunction memoize(func,resolver){if(typeof func!='function'||resolver!=null&&typeof resolver!='function'){throw new TypeError(FUNC_ERROR_TEXT);}var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key);}var result=func.apply(this,args);memoized.cache=cache.set(key,result)||cache;return result;};memoized.cache=new(memoize.Cache||MapCache)();return memoized;}\nmemoize.Cache=MapCache;\nfunction negate(predicate){if(typeof predicate!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return function(){var args=arguments;switch(args.length){case 0:return !predicate.call(this);case 1:return !predicate.call(this,args[0]);case 2:return !predicate.call(this,args[0],args[1]);case 3:return !predicate.call(this,args[0],args[1],args[2]);}return !predicate.apply(this,args);};}\nfunction once(func){return before(2,func);}\nvar overArgs=castRest(function(func,transforms){transforms=transforms.length==1&&isArray(transforms[0])?arrayMap(transforms[0],baseUnary(getIteratee())):arrayMap(baseFlatten(transforms,1),baseUnary(getIteratee()));var funcsLength=transforms.length;return baseRest(function(args){var index=-1,length=nativeMin(args.length,funcsLength);while(++index=other;});\nvar isArguments=baseIsArguments(function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');};\nvar isArray=Array.isArray;\nvar isArrayBuffer=nodeIsArrayBuffer?baseUnary(nodeIsArrayBuffer):baseIsArrayBuffer;\nfunction isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}\nfunction isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value);}\nfunction isBoolean(value){return value===true||value===false||isObjectLike(value)&&baseGetTag(value)==boolTag;}\nvar isBuffer=nativeIsBuffer||stubFalse;\nvar isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate;\nfunction isElement(value){return isObjectLike(value)&&value.nodeType===1&&!isPlainObject(value);}\nfunction isEmpty(value){if(value==null){return true;}if(isArrayLike(value)&&(isArray(value)||typeof value=='string'||typeof value.splice=='function'||isBuffer(value)||isTypedArray(value)||isArguments(value))){return !value.length;}var tag=getTag(value);if(tag==mapTag||tag==setTag){return !value.size;}if(isPrototype(value)){return !baseKeys(value).length;}for(var key in value){if(hasOwnProperty.call(value,key)){return false;}}return true;}\nfunction isEqual(value,other){return baseIsEqual(value,other);}\nfunction isEqualWith(value,other,customizer){customizer=typeof customizer=='function'?customizer:undefined$1;var result=customizer?customizer(value,other):undefined$1;return result===undefined$1?baseIsEqual(value,other,undefined$1,customizer):!!result;}\nfunction isError(value){if(!isObjectLike(value)){return false;}var tag=baseGetTag(value);return tag==errorTag||tag==domExcTag||typeof value.message=='string'&&typeof value.name=='string'&&!isPlainObject(value);}\nfunction isFinite(value){return typeof value=='number'&&nativeIsFinite(value);}\nfunction isFunction(value){if(!isObject(value)){return false;}\nvar tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag;}\nfunction isInteger(value){return typeof value=='number'&&value==toInteger(value);}\nfunction isLength(value){return typeof value=='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}\nfunction isObject(value){var type=typeof value;return value!=null&&(type=='object'||type=='function');}\nfunction isObjectLike(value){return value!=null&&typeof value=='object';}\nvar isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap;\nfunction isMatch(object,source){return object===source||baseIsMatch(object,source,getMatchData(source));}\nfunction isMatchWith(object,source,customizer){customizer=typeof customizer=='function'?customizer:undefined$1;return baseIsMatch(object,source,getMatchData(source),customizer);}\nfunction isNaN(value){\nreturn isNumber(value)&&value!=+value;}\nfunction isNative(value){if(isMaskable(value)){throw new Error(CORE_ERROR_TEXT);}return baseIsNative(value);}\nfunction isNull(value){return value===null;}\nfunction isNil(value){return value==null;}\nfunction isNumber(value){return typeof value=='number'||isObjectLike(value)&&baseGetTag(value)==numberTag;}\nfunction isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag){return false;}var proto=getPrototype(value);if(proto===null){return true;}var Ctor=hasOwnProperty.call(proto,'constructor')&&proto.constructor;return typeof Ctor=='function'&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString;}\nvar isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp;\nfunction isSafeInteger(value){return isInteger(value)&&value>=-MAX_SAFE_INTEGER&&value<=MAX_SAFE_INTEGER;}\nvar isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet;\nfunction isString(value){return typeof value=='string'||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag;}\nfunction isSymbol(value){return typeof value=='symbol'||isObjectLike(value)&&baseGetTag(value)==symbolTag;}\nvar isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;\nfunction isUndefined(value){return value===undefined$1;}\nfunction isWeakMap(value){return isObjectLike(value)&&getTag(value)==weakMapTag;}\nfunction isWeakSet(value){return isObjectLike(value)&&baseGetTag(value)==weakSetTag;}\nvar lt=createRelationalOperation(baseLt);\nvar lte=createRelationalOperation(function(value,other){return value<=other;});\nfunction toArray(value){if(!value){return [];}if(isArrayLike(value)){return isString(value)?stringToArray(value):copyArray(value);}if(symIterator&&value[symIterator]){return iteratorToArray(value[symIterator]());}var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value);}\nfunction toFinite(value){if(!value){return value===0?value:0;}value=toNumber(value);if(value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER;}return value===value?value:0;}\nfunction toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0;}\nfunction toLength(value){return value?baseClamp(toInteger(value),0,MAX_ARRAY_LENGTH):0;}\nfunction toNumber(value){if(typeof value=='number'){return value;}if(isSymbol(value)){return NAN;}if(isObject(value)){var other=typeof value.valueOf=='function'?value.valueOf():value;value=isObject(other)?other+'':other;}if(typeof value!='string'){return value===0?value:+value;}value=baseTrim(value);var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value;}\nfunction toPlainObject(value){return copyObject(value,keysIn(value));}\nfunction toSafeInteger(value){return value?baseClamp(toInteger(value),-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER):value===0?value:0;}\nfunction toString(value){return value==null?'':baseToString(value);}\nvar assign=createAssigner(function(object,source){if(isPrototype(source)||isArrayLike(source)){copyObject(source,keys(source),object);return;}for(var key in source){if(hasOwnProperty.call(source,key)){assignValue(object,key,source[key]);}}});\nvar assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object);});\nvar assignInWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keysIn(source),object,customizer);});\nvar assignWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keys(source),object,customizer);});\nvar at=flatRest(baseAt);\nfunction create(prototype,properties){var result=baseCreate(prototype);return properties==null?result:baseAssign(result,properties);}\nvar defaults=baseRest(function(object,sources){object=Object(object);var index=-1;var length=sources.length;var guard=length>2?sources[2]:undefined$1;if(guard&&isIterateeCall(sources[0],sources[1],guard)){length=1;}while(++index1);return path;});copyObject(object,getAllKeysIn(object),result);if(isDeep){result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone);}var length=paths.length;while(length--){baseUnset(result,paths[length]);}return result;});\nfunction omitBy(object,predicate){return pickBy(object,negate(getIteratee(predicate)));}\nvar pick=flatRest(function(object,paths){return object==null?{}:basePick(object,paths);});\nfunction pickBy(object,predicate){if(object==null){return {};}var props=arrayMap(getAllKeysIn(object),function(prop){return [prop];});predicate=getIteratee(predicate);return basePickBy(object,props,function(value,path){return predicate(value,path[0]);});}\nfunction result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;\nif(!length){length=1;object=undefined$1;}while(++indexupper){var temp=lower;lower=upper;upper=temp;}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat('1e-'+((rand+'').length-1))),upper);}return baseRandom(lower,upper);}\nvar camelCase=createCompounder(function(result,word,index){word=word.toLowerCase();return result+(index?capitalize(word):word);});\nfunction capitalize(string){return upperFirst(toString(string).toLowerCase());}\nfunction deburr(string){string=toString(string);return string&&string.replace(reLatin,deburrLetter).replace(reComboMark,'');}\nfunction endsWith(string,target,position){string=toString(string);target=baseToString(target);var length=string.length;position=position===undefined$1?length:baseClamp(toInteger(position),0,length);var end=position;position-=target.length;return position>=0&&string.slice(position,end)==target;}\nfunction escape(string){string=toString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string;}\nfunction escapeRegExp(string){string=toString(string);return string&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,'\\\\$&'):string;}\nvar kebabCase=createCompounder(function(result,word,index){return result+(index?'-':'')+word.toLowerCase();});\nvar lowerCase=createCompounder(function(result,word,index){return result+(index?' ':'')+word.toLowerCase();});\nvar lowerFirst=createCaseFirst('toLowerCase');\nfunction pad(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;if(!length||strLength>=length){return string;}var mid=(length-strLength)/2;return createPadding(nativeFloor(mid),chars)+string+createPadding(nativeCeil(mid),chars);}\nfunction padEnd(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;return length&&strLength>>0;if(!limit){return [];}string=toString(string);if(string&&(typeof separator=='string'||separator!=null&&!isRegExp(separator))){separator=baseToString(separator);if(!separator&&hasUnicode(string)){return castSlice(stringToArray(string),0,limit);}}return string.split(separator,limit);}\nvar startCase=createCompounder(function(result,word,index){return result+(index?' ':'')+upperFirst(word);});\nfunction startsWith(string,target,position){string=toString(string);position=position==null?0:baseClamp(toInteger(position),0,string.length);target=baseToString(target);return string.slice(position,position+target.length)==target;}\nfunction template(string,options,guard){\nvar settings=lodash.templateSettings;if(guard&&isIterateeCall(string,options,guard)){options=undefined$1;}string=toString(string);options=assignInWith({},options,settings,customDefaultsAssignIn);var imports=assignInWith({},options.imports,settings.imports,customDefaultsAssignIn),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys);var isEscaping,isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source=\"__p += '\";\nvar reDelimiters=RegExp((options.escape||reNoMatch).source+'|'+interpolate.source+'|'+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+'|'+(options.evaluate||reNoMatch).source+'|$','g');\nvar sourceURL='//# sourceURL='+(hasOwnProperty.call(options,'sourceURL')?(options.sourceURL+'').replace(/\\s/g,' '):'lodash.templateSources['+ ++templateCounter+']')+'\\n';string.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);\nsource+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar);\nif(escapeValue){isEscaping=true;source+=\"' +\\n__e(\"+escapeValue+\") +\\n'\";}if(evaluateValue){isEvaluating=true;source+=\"';\\n\"+evaluateValue+\";\\n__p += '\";}if(interpolateValue){source+=\"' +\\n((__t = (\"+interpolateValue+\")) == null ? '' : __t) +\\n'\";}index=offset+match.length;\nreturn match;});source+=\"';\\n\";\nvar variable=hasOwnProperty.call(options,'variable')&&options.variable;if(!variable){source='with (obj) {\\n'+source+'\\n}\\n';}\nelse if(reForbiddenIdentifierChars.test(variable)){throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);}\nsource=(isEvaluating?source.replace(reEmptyStringLeading,''):source).replace(reEmptyStringMiddle,'$1').replace(reEmptyStringTrailing,'$1;');\nsource='function('+(variable||'obj')+') {\\n'+(variable?'':'obj || (obj = {});\\n')+\"var __t, __p = ''\"+(isEscaping?', __e = _.escape':'')+(isEvaluating?', __j = Array.prototype.join;\\n'+\"function print() { __p += __j.call(arguments, '') }\\n\":';\\n')+source+'return __p\\n}';var result=attempt(function(){return Function(importsKeys,sourceURL+'return '+source).apply(undefined$1,importsValues);});\nresult.source=source;if(isError(result)){throw result;}return result;}\nfunction toLower(value){return toString(value).toLowerCase();}\nfunction toUpper(value){return toString(value).toUpperCase();}\nfunction trim(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined$1)){return baseTrim(string);}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join('');}\nfunction trimEnd(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined$1)){return string.slice(0,trimmedEndIndex(string)+1);}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),end=charsEndIndex(strSymbols,stringToArray(chars))+1;return castSlice(strSymbols,0,end).join('');}\nfunction trimStart(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined$1)){return string.replace(reTrimStart,'');}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),start=charsStartIndex(strSymbols,stringToArray(chars));return castSlice(strSymbols,start).join('');}\nfunction truncate(string,options){var length=DEFAULT_TRUNC_LENGTH,omission=DEFAULT_TRUNC_OMISSION;if(isObject(options)){var separator='separator'in options?options.separator:separator;length='length'in options?toInteger(options.length):length;omission='omission'in options?baseToString(options.omission):omission;}string=toString(string);var strLength=string.length;if(hasUnicode(string)){var strSymbols=stringToArray(string);strLength=strSymbols.length;}if(length>=strLength){return string;}var end=length-stringSize(omission);if(end<1){return omission;}var result=strSymbols?castSlice(strSymbols,0,end).join(''):string.slice(0,end);if(separator===undefined$1){return result+omission;}if(strSymbols){end+=result.length-end;}if(isRegExp(separator)){if(string.slice(end).search(separator)){var match,substring=result;if(!separator.global){separator=RegExp(separator.source,toString(reFlags.exec(separator))+'g');}separator.lastIndex=0;while(match=separator.exec(substring)){var newEnd=match.index;}result=result.slice(0,newEnd===undefined$1?end:newEnd);}}else if(string.indexOf(baseToString(separator),end)!=end){var index=result.lastIndexOf(separator);if(index>-1){result=result.slice(0,index);}}return result+omission;}\nfunction unescape(string){string=toString(string);return string&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string;}\nvar upperCase=createCompounder(function(result,word,index){return result+(index?' ':'')+word.toUpperCase();});\nvar upperFirst=createCaseFirst('toUpperCase');\nfunction words(string,pattern,guard){string=toString(string);pattern=guard?undefined$1:pattern;if(pattern===undefined$1){return hasUnicodeWord(string)?unicodeWords(string):asciiWords(string);}return string.match(pattern)||[];}\nvar attempt=baseRest(function(func,args){try{return apply(func,undefined$1,args);}catch(e){return isError(e)?e:new Error(e);}});\nvar bindAll=flatRest(function(object,methodNames){arrayEach(methodNames,function(key){key=toKey(key);baseAssignValue(object,key,bind(object[key],object));});return object;});\nfunction cond(pairs){var length=pairs==null?0:pairs.length,toIteratee=getIteratee();pairs=!length?[]:arrayMap(pairs,function(pair){if(typeof pair[1]!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return [toIteratee(pair[0]),pair[1]];});return baseRest(function(args){var index=-1;while(++indexMAX_SAFE_INTEGER){return [];}var index=MAX_ARRAY_LENGTH,length=nativeMin(n,MAX_ARRAY_LENGTH);iteratee=getIteratee(iteratee);n-=MAX_ARRAY_LENGTH;var result=baseTimes(length,iteratee);while(++index0||end<0)){return new LazyWrapper(result);}if(start<0){result=result.takeRight(-start);}else if(start){result=result.drop(start);}if(end!==undefined$1){end=toInteger(end);result=end<0?result.dropRight(-end):result.take(end-start);}return result;};LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse();};LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH);};\nbaseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?'take'+(methodName=='last'?'Right':''):methodName],retUnwrapped=isTaker||/^find/.test(methodName);if(!lodashFunc){return;}lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value);var interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result;};if(useLazy&&checkIteratee&&typeof iteratee=='function'&&iteratee.length!=1){\nisLazy=useLazy=false;}var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);result.__actions__.push({'func':thru,'args':[interceptor],'thisArg':undefined$1});return new LodashWrapper(result,chainAll);}if(isUnwrapped&&onlyLazy){return func.apply(this,args);}result=this.thru(interceptor);return isUnwrapped?isTaker?result.value()[0]:result.value():result;};});\narrayEach(['pop','push','shift','sort','splice','unshift'],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?'tap':'thru',retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args);}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args);});};});\nbaseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+'';if(!hasOwnProperty.call(realNames,key)){realNames[key]=[];}realNames[key].push({'name':methodName,'func':lodashFunc});}});realNames[createHybrid(undefined$1,WRAP_BIND_KEY_FLAG).name]=[{'name':'wrapper','func':undefined$1}];\nLazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;\nlodash.prototype.at=wrapperAt;lodash.prototype.chain=wrapperChain;lodash.prototype.commit=wrapperCommit;lodash.prototype.next=wrapperNext;lodash.prototype.plant=wrapperPlant;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;\nlodash.prototype.first=lodash.prototype.head;if(symIterator){lodash.prototype[symIterator]=wrapperToIterator;}return lodash;};\nvar _=runInContext();\nif(freeModule){\n(freeModule.exports=_)._=_;\nfreeExports._=_;}else {\nroot._=_;}}).call(commonjsGlobal);\n});\n\nfunction getUrlParams() {\n var pl = /\\+/g;\n var search = /([^&=]+)=?([^&]*)/g;\n var decode = function decode(s) {\n return decodeURIComponent(s.replace(pl, ' '));\n };\n var queryTarget = function getQueryTarget() {\n var windowLocation = window.location;\n var windowSearch = windowLocation.search;\n var windowHash = windowLocation.hash;\n return windowSearch !== '' ? windowSearch : windowHash.substring(windowHash.indexOf('?'), windowHash.length);\n }();\n var query = queryTarget.substring(1);\n var urlParams = {};\n do {\n var match = search.exec(query);\n if (!match) {\n break;\n }\n urlParams[decode(match[1]).toLowerCase()] = decode(match[2]);\n } while (true);\n return urlParams;\n}\nfunction replaceParams(template, params) {\n if (!lodash.isString(template)) {\n console.error(AppLog.TEMPLATE_INVALID, template);\n return undefined;\n }\n if (!lodash.isObject(params)) {\n console.error(AppLog.PARAMS_INVALID, params);\n return undefined;\n }\n var delims = template.match(/{{([^}]+)}}/g);\n if (delims.length < 1) {\n console.error(AppLog.TEMPLATE_NO_PARAMS, template);\n return undefined;\n }\n var result = template;\n for (var i = 0; i < delims.length; i++) {\n var key = delims[i].replace(/\\s+/g, '').substr(2).slice(0, -2);\n var value = params[key];\n if (value == null) {\n console.error(replaceLogParams(AppLog.PARAM_NO_REQUIRED, {\n param: key\n }));\n return undefined;\n }\n result = result.replace(delims[i], value);\n }\n return result;\n}\nfunction hasOwnProperty(thisArg) {\n for (var _len = arguments.length, argArray = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n argArray[_key - 1] = arguments[_key];\n }\n return Object.prototype.hasOwnProperty.call(thisArg, argArray);\n}\nfunction checkQrSettingsType(settings) {\n for (var key in settings) {\n if (typeof settings[key] === 'string' && key !== 'QrMenuOrderHours') {\n settings[key] = parseInt(settings[key]);\n }\n }\n return settings;\n}\nfunction getCurrentTime() {\n var now = new Date();\n var year = now.getFullYear();\n var month = (now.getMonth() + 1).toString().padStart(2, '0');\n var day = now.getDate().toString().padStart(2, '0');\n var hours = now.getHours().toString().padStart(2, '0');\n var minutes = now.getMinutes().toString().padStart(2, '0');\n var seconds = now.getSeconds().toString().padStart(2, '0');\n var milliseconds = now.getMilliseconds().toString().padStart(3, '0');\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day, \"T\").concat(hours, \":\").concat(minutes, \":\").concat(seconds, \".\").concat(milliseconds);\n}\nfunction getFileNameWithoutExtension(fileName) {\n return fileName.replace(/\\.[^/.]+$/, '');\n}\nfunction getThumbnail(imageUrl) {\n if (typeof imageUrl === 'undefined' || imageUrl === null) {\n return '';\n }\n var setting = AppStorage.getItem(StorageKey.SETTINGS);\n var imageResolution = setting['QrMenuImageResolution'];\n var size;\n switch (imageResolution) {\n case 0:\n size = 200;\n break;\n case 1:\n size = 400;\n break;\n default:\n size = 200;\n break;\n }\n var fileUrl = getFileNameWithoutExtension(imageUrl);\n var fileExtension = imageUrl.replace(fileUrl, '');\n if (imageResolution === 2) {\n return \"\".concat(fileUrl).concat(fileExtension);\n } else {\n return \"\".concat(fileUrl, \"x\").concat(size).concat(fileExtension);\n }\n}\nfunction setMissingImage(item, fallbackUrl) {\n if (!lodash.isString(item.ImageUrl)) {\n item.ImageUrl = fallbackUrl;\n }\n}\nfunction setMissingImages(iterable, fallbackUrl) {\n var _iterator = _createForOfIteratorHelper(iterable),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n setMissingImage(item, fallbackUrl);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n}\n\nvar appComponent = {\n app: {\n bindings: {},\n templateUrl: 'app/components/app.component.html',\n controller: function controller($rootScope, $scope, $state, $timeout, commonVariablesService, apiService, dataService, cartService, $transitions, $locale, $translate, workingHoursService) {\n $scope.totalQuantity = cartService._totalQuantity;\n dataService._setIsMenu(false);\n dataService._customerObservable().subscribe(function (data) {\n $scope.$apply(function () {\n var _$scope$qrOrderTimes$;\n $scope.QrMenuSettings = data['Settings'];\n $scope.latlng = data['LatLng'];\n $scope.QrMenuMode = $scope.QrMenuSettings['QrMenuMode'];\n $scope.QrMenuOrderMode = $scope.QrMenuSettings['QrMenuOrderMode'];\n $scope.QrMenuGuestCall = $scope.QrMenuSettings['QrMenuGuestCall'];\n $scope.QrMenuViewMode = $scope.QrMenuSettings['QrMenuViewMode'];\n $scope.QrMenuFeedback = $scope.QrMenuSettings['QrMenuFeedback'];\n $scope.QrMenuThemeColor = $scope.QrMenuSettings['QrMenuThemeColor'];\n $rootScope.QrMenuLocationMode = $scope.QrMenuSettings['QrMenuLocationMode'];\n $scope.QrMenuShowCampaign = $scope.QrMenuSettings['QrMenuShowCampaign'];\n $scope.QrMenuServicePrice = $scope.QrMenuSettings['QrMenuServicePrice'];\n $scope.QrMenuLocationRange = $scope.QrMenuSettings['QrMenuLocationRange'];\n if ($rootScope.QrMenuLocationMode === 1) {\n $scope.getLocation();\n }\n $scope.ordersInfo = localStorage.getItem('OrdersInfo');\n if ($scope.ordersInfo !== null) {\n $scope.ordersInfo = JSON.parse($scope.ordersInfo);\n var date = new Date();\n var newOrderInfo = [];\n for (var i = 0; i < $scope.ordersInfo.length; i++) {\n var _$scope$ordersInfo$i$, _$scope$ordersInfo$i$2, _$scope$ordersInfo$i$3, _$scope$ordersInfo$i$4, _$scope$ordersInfo$i$5, _$scope$ordersInfo$i$6;\n if (!$scope.ordersInfo[i]) continue;\n var year = (_$scope$ordersInfo$i$ = $scope.ordersInfo[i].Code) === null || _$scope$ordersInfo$i$ === void 0 ? void 0 : _$scope$ordersInfo$i$.slice(0, 2);\n var month = (_$scope$ordersInfo$i$2 = $scope.ordersInfo[i].Code) === null || _$scope$ordersInfo$i$2 === void 0 ? void 0 : _$scope$ordersInfo$i$2.slice(2, 4);\n var day = (_$scope$ordersInfo$i$3 = $scope.ordersInfo[i].Code) === null || _$scope$ordersInfo$i$3 === void 0 ? void 0 : _$scope$ordersInfo$i$3.slice(4, 6);\n var hour = (_$scope$ordersInfo$i$4 = $scope.ordersInfo[i].Code) === null || _$scope$ordersInfo$i$4 === void 0 ? void 0 : _$scope$ordersInfo$i$4.slice(6, 8);\n var minute = (_$scope$ordersInfo$i$5 = $scope.ordersInfo[i].Code) === null || _$scope$ordersInfo$i$5 === void 0 ? void 0 : _$scope$ordersInfo$i$5.slice(8, 10);\n var second = (_$scope$ordersInfo$i$6 = $scope.ordersInfo[i].Code) === null || _$scope$ordersInfo$i$6 === void 0 ? void 0 : _$scope$ordersInfo$i$6.slice(10, 12);\n var orderInfoDate = new Date('20' + year + '-' + month + '-' + day + 'T' + hour + ':' + minute + ':' + second);\n var difference = Math.abs((date === null || date === void 0 ? void 0 : date.getTime()) - (orderInfoDate === null || orderInfoDate === void 0 ? void 0 : orderInfoDate.getTime()));\n if (difference < 86400000) {\n newOrderInfo.push($scope.ordersInfo[i]);\n }\n }\n if (newOrderInfo.length > 0) {\n localStorage.setItem('OrdersInfo', JSON.stringify(newOrderInfo));\n } else {\n localStorage.removeItem('OrdersInfo');\n }\n }\n if ($scope.QrMenuOrderMode === 4) {\n var reservation = AppStorage.getItem(StorageKey.RESERVATION);\n if (!reservation) {\n $state.go('app.login');\n }\n }\n $scope.qrOrderTimes = workingHoursService.getWorkingHours();\n $scope.orderTimeWarning = (_$scope$qrOrderTimes$ = $scope.qrOrderTimes['orderTimeWarning']) !== null && _$scope$qrOrderTimes$ !== void 0 ? _$scope$qrOrderTimes$ : false;\n if ($scope.QrMenuServicePrice) {\n $scope.QrMenuServicePrice = replaceParams($rootScope.translations.order_service_price, {\n servicePrice: $scope.QrMenuServicePrice\n });\n }\n if ($scope.orderTimeWarning) {\n $scope.setOrderTimeRange($scope.qrOrderTimes);\n }\n $rootScope.$broadcast('orderTimes', $scope.qrOrderTimes);\n });\n });\n dataService._menuObservable().subscribe(function (data) {\n $scope.$apply(function () {\n var currency = '';\n switch (data.CurrencyID) {\n case 1:\n currency = 'TRY';\n break;\n case 2:\n currency = 'USD';\n break;\n case 3:\n currency = 'EUR';\n break;\n case 4:\n currency = 'GBP';\n break;\n case 5:\n currency = 'JPY';\n break;\n case 6:\n currency = 'RUB';\n break;\n case 7:\n currency = 'CAD';\n break;\n case 8:\n currency = 'AUD';\n break;\n case 9:\n currency = 'SAR';\n break;\n case 10:\n currency = 'KWD';\n break;\n case 11:\n currency = 'CNY';\n break;\n case 12:\n currency = 'IQD';\n break;\n case 13:\n currency = 'INR';\n break;\n case 14:\n currency = 'IRR';\n break;\n case 15:\n currency = 'AED';\n break;\n case 16:\n currency = 'AFN';\n break;\n case 17:\n currency = 'ARS';\n break;\n case 18:\n currency = 'AZN';\n break;\n case 19:\n currency = 'BRL';\n break;\n case 20:\n currency = 'CHF';\n break;\n case 21:\n currency = 'CLP';\n break;\n case 22:\n currency = 'COP';\n break;\n case 23:\n currency = 'CUP';\n break;\n case 24:\n currency = 'DKK';\n break;\n case 25:\n currency = 'EGP';\n break;\n case 26:\n currency = 'HKD';\n break;\n case 27:\n currency = 'KGS';\n break;\n case 28:\n currency = 'KRW';\n break;\n case 29:\n currency = 'KZT';\n break;\n case 30:\n currency = 'LYD';\n break;\n case 31:\n currency = 'MXN';\n break;\n case 32:\n currency = 'MYR';\n break;\n case 33:\n currency = 'PKR';\n break;\n case 34:\n currency = 'TJS';\n break;\n case 35:\n currency = 'TMT';\n break;\n case 36:\n currency = 'TND';\n break;\n case 37:\n currency = 'UZS';\n break;\n case 38:\n currency = 'NOK';\n break;\n case 39:\n currency = 'NPR';\n break;\n case 40:\n currency = 'SYP';\n break;\n case 41:\n currency = 'RWF';\n break;\n case 42:\n currency = 'QAR';\n break;\n case 43:\n currency = 'GEL';\n break;\n case 44:\n currency = 'THB';\n break;\n case 45:\n currency = 'CNT';\n break;\n case 46:\n currency = 'OMR';\n break;\n case 47:\n currency = 'UGX';\n break;\n case 48:\n currency = 'NGN';\n break;\n }\n localStorage.setItem(StorageKey.CURRENCY, currency);\n });\n });\n apiService.getCustomer().then(function (customerData) {\n return $timeout(function () {\n apiService.getMenu(customerData.LanguageCode).then(function (data) {\n return $timeout(function () {\n if (window.location.hash !== '#!/') {\n setTimeout(function () {\n $('#loader').fadeOut(300);\n }, 300);\n }\n dataService._setIsMenu(true);\n });\n });\n apiService.getCampaigns(customerData.CustomerID).then(function (campaigns) {\n return $timeout(function () {});\n });\n apiService.getOnlinePaymentSetting(customerData.CustomerID).then(function (data) {\n sessionStorage.setItem(StorageKey.ONLINEPAYMENTMODE, data.OnlinePaymentMode);\n });\n });\n });\n commonVariablesService.getSubject().subscribe(function () {\n var _commonVariablesServi;\n $scope.appBarHidden = (_commonVariablesServi = commonVariablesService.getItem('appBarHidden')) !== null && _commonVariablesServi !== void 0 ? _commonVariablesServi : false;\n });\n cartService.watch(function () {\n $timeout(function () {\n return $scope.totalQuantity = cartService._totalQuantity;\n });\n });\n $(document).on('mouseup', function (e) {\n var container = $('#bar');\n var barButtonContainer = $('#bar-button');\n var barButtonIconContainer = $('#bar-button-icon');\n if (container.hasClass('d-none')) {\n return;\n }\n if (!container.is(e.target) && !barButtonIconContainer.is(e.target) && !barButtonContainer.is(e.target) && container.has(e.target).length === 0) {\n container.addClass('d-none');\n }\n });\n $('body').on('show.bs.modal', '.modal', function () {\n $(this).find('.lazy-load').each(function () {\n var img = $(this);\n img.attr('src', img.data('src'));\n });\n });\n $transitions.onStart({}, function () {\n $('#bar').addClass('d-none');\n });\n $scope.toggleBarMenu = function () {\n $('#bar').toggleClass('d-none');\n $scope.orderInfo = localStorage.getItem('OrdersInfo');\n };\n $scope.onAppInitCompleted = function () {};\n $scope.closeServicePriceWarning = function () {\n $scope.QrMenuServicePrice = '';\n };\n $scope.closeOrderTimeWarning = function () {\n $scope.orderTimeWarning = false;\n };\n $scope.setOrderTimeRange = function (times) {\n if (!times) {\n $scope.orderTimeRangeText = null;\n return;\n }\n if (times['start'].trim() === times['end'].trim()) {\n $scope.orderTimeRangeText = null;\n } else {\n $scope.orderTimeRangeText = replaceParams($rootScope.translations.order_time_range, {\n start: times['start'],\n end: times['end']\n });\n }\n };\n $scope.getLocation = function () {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n $scope.$apply(function () {\n $scope.location = {\n latitude: position.coords.latitude,\n longitude: position.coords.longitude\n };\n $scope.checkRadius();\n });\n });\n } else {\n $('.error-support-popup').modal('show');\n }\n };\n $scope.checkRadius = function () {\n if ($scope.latlng) {\n var latlngArray = $scope.latlng.split(';');\n var lat = parseFloat(latlngArray[0]);\n var lng = parseFloat(latlngArray[1]);\n var distance = calculateDistance($scope.location.latitude, $scope.location.longitude, lat, lng);\n $rootScope.isWithinRadius = distance <= $scope.QrMenuLocationRange;\n }\n };\n function calculateDistance(lat1, lon1, lat2, lon2) {\n var R = 6371;\n var dLat = toRadians(lat2 - lat1);\n var dLon = toRadians(lon2 - lon1);\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(toRadians(lat1)) * Math.cos(toRadians(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var distance = R * c * 1000;\n return distance;\n }\n function toRadians(degrees) {\n return degrees * (Math.PI / 180);\n }\n }\n }\n};\n\nvar headerComponent = {\n header: {\n bindings: {},\n templateUrl: 'app/components/header/header.component.html',\n controller: function controller($scope, $timeout, commonVariablesService, apiService, dataService, $transitions, cartService) {\n $scope.totalQuantity = cartService._totalQuantity;\n $scope.showLanguageMenu = false;\n var localOrderTime = AppStorage.getItem(StorageKey.QR_ORDER_TIMES);\n if (localOrderTime) {\n var _localOrderTime$statu;\n $scope.isOrderTime = (_localOrderTime$statu = localOrderTime['status']) !== null && _localOrderTime$statu !== void 0 ? _localOrderTime$statu : true;\n } else {\n $scope.isOrderTime = true;\n }\n $scope.$on('orderTimes', function (event, data) {\n var _data$status;\n $scope.isOrderTime = (_data$status = data['status']) !== null && _data$status !== void 0 ? _data$status : true;\n });\n cartService.watch(function () {\n $timeout(function () {\n return $scope.totalQuantity = cartService._totalQuantity;\n });\n });\n $scope.setAppSettings = function (settings) {\n $scope.QrMenuSettings = settings;\n $scope.QrMenuMode = $scope.QrMenuSettings['QrMenuMode'];\n $scope.QrMenuOrderMode = $scope.QrMenuSettings['QrMenuOrderMode'];\n $scope.QrMenuViewMode = $scope.QrMenuSettings['QrMenuViewMode'];\n $scope.QrMenuFeedback = $scope.QrMenuSettings['QrMenuFeedback'];\n $scope.QrMenuThemeColor = $scope.QrMenuSettings['QrMenuThemeColor'];\n $scope.QrMenuLocationMode = $scope.QrMenuSettings['QrMenuLocationMode'];\n };\n var customerData = dataService._getCustomer();\n if (customerData && Object.keys(customerData).length !== 0) {\n $scope.setAppSettings(customerData['Settings']);\n }\n dataService._customerObservable().subscribe(function (customer) {\n $scope.$apply(function () {\n $scope.setAppSettings(customer['Settings']);\n });\n });\n commonVariablesService.getSubject().subscribe(function () {\n var _commonVariablesServi;\n $scope.title = commonVariablesService.getItem('metaTitle');\n $scope.showBack = commonVariablesService.getItem('showBack');\n $scope.headerHidden = (_commonVariablesServi = commonVariablesService.getItem('headerHidden')) !== null && _commonVariablesServi !== void 0 ? _commonVariablesServi : false;\n $scope.languageHidden = commonVariablesService.getItem('languageHidden');\n $scope.feedbackHidden = commonVariablesService.getItem('feedbackHidden');\n $scope.languageCode = AppStorage.getItem(StorageKey.LANGUAGE_CODE);\n $scope.languages = AppStorage.getItem(StorageKey.LANGUAGES);\n if (!$scope.languages) {\n $scope.languages = [];\n }\n });\n $scope.onBackPressed = function () {\n window.history.back();\n };\n $scope.changeLanguage = function () {\n $scope.showLanguageMenu = !$scope.showLanguageMenu;\n commonVariablesService.setItem('showLanguageMenu', true);\n };\n $transitions.onStart({}, function () {\n $scope.showLanguageMenu = false;\n commonVariablesService.setItem('showLanguageMenu', false);\n });\n }\n }\n};\n\nvar footerComponent = {\n footer: {\n bindings: {},\n templateUrl: 'app/components/footer/footer.component.html',\n controller: function controller($scope, commonVariablesService, apiService) {\n var supportedLanguages = Object.keys(AppLanguageKeys);\n $scope.languageCode = AppStorage.getItem(StorageKey.LANGUAGE_CODE);\n if (!supportedLanguages.includes($scope.languageCode)) {\n $scope.languageCode = 'EN';\n }\n commonVariablesService.getSubject().subscribe(function () {\n var _commonVariablesServi;\n $scope.footerHidden = (_commonVariablesServi = commonVariablesService.getItem('footerHidden')) !== null && _commonVariablesServi !== void 0 ? _commonVariablesServi : false;\n });\n $scope.FacebookUrl = '';\n $scope.InstagramUrl = '';\n $scope.AppStoreUrl = '';\n $scope.GooglePlayUrl = '';\n }\n }\n};\n\nvar CategoriesController = function CategoriesController() {\n _classCallCheck(this, CategoriesController);\n};\nvar categoriesComponent = {\n categories: {\n bindings: {},\n controller: CategoriesController,\n templateUrl: 'app/components/categories/categories.component.html'\n }\n};\n\nvar API_SUBDOMAIN = 'menuluxwebapi';\nvar API_HOST = \"https://\".concat(API_SUBDOMAIN, \".azurewebsites.net\");\nvar CATEGORY_COL_SIZE = 2;\n\nvar categoryListComponent = {\n categoryList: {\n bindings: {},\n templateUrl: 'app/components/categories/category-list/category-list.component.html',\n controller: function controller($scope, $timeout, apiService, dataService, commonVariablesService, $state) {\n $scope.setMenuData = function (menu) {\n var categories = menu['MenuGroup'];\n setMissingImages(categories, menu.CustomerImageUrl);\n categories = categories.filter(function (i) {\n return i['ParentID'] === null;\n });\n $timeout(function () {\n commonVariablesService.setItem('metaTitle', menu['Name']);\n commonVariablesService.setItem('headerHidden', false);\n commonVariablesService.setItem('footerHidden', true);\n commonVariablesService.setItem('languageHidden', true);\n commonVariablesService.setItem('feedbackHidden', true);\n commonVariablesService.setItem('appBarHidden', false);\n angular.element('#den').addClass('cmp-box-shadow-2');\n $scope.rowChunk = lodash.chunk(categories, CATEGORY_COL_SIZE);\n });\n };\n $scope.setAppSettings = function (settings) {\n $scope.QrMenuSettings = settings;\n $scope.QrMenuMode = $scope.QrMenuSettings['QrMenuMode'];\n $scope.QrMenuOrderMode = $scope.QrMenuSettings['QrMenuOrderMode'];\n $scope.QrMenuFeedback = $scope.QrMenuSettings['QrMenuFeedback'];\n $scope.QrMenuGuestCall = $scope.QrMenuSettings['QrMenuGuestCall'];\n $scope.QrMenuViewMode = $scope.QrMenuSettings['QrMenuViewMode'];\n $scope.QrMenuViewMode === 2 ? $state.go('app.categoryTheme') : '';\n if ($scope.QrMenuMode === 1 || $scope.QrMenuGuestCall === 1 || $scope.QrMenuOrderMode !== 0 || $scope.QrMenuFeedback === 1) {\n commonVariablesService.setItem('showBack', false);\n } else {\n commonVariablesService.setItem('showBack', true);\n }\n };\n var customerData = dataService._getCustomer();\n if (customerData && Object.keys(customerData).length !== 0) {\n $scope.setAppSettings(customerData['Settings']);\n }\n var menuData = dataService._getMenu();\n if (menuData && Object.keys(menuData).length !== 0) {\n $scope.setMenuData(menuData);\n }\n dataService._customerObservable().subscribe(function (customer) {\n $scope.$apply(function () {\n $scope.setAppSettings(customer['Settings']);\n });\n });\n dataService._menuObservable().subscribe(function (menu) {\n $scope.$apply(function () {\n $scope.setMenuData(menu);\n });\n });\n }\n }\n};\n\nvar categoryComponent = {\n category: {\n bindings: {},\n templateUrl: 'app/components/categories/category/category.component.html',\n controller: function controller($scope, $location, $stateParams, $timeout, apiService, dataService, productFeatureService, commonVariablesService) {\n var menuGroupId = parseInt($stateParams['categoryId']);\n $scope.$on('categoryItem.onClickAddToCart', function ($event, data) {\n $scope.onClickAddToCart($event, data);\n });\n $scope.$on('$locationChangeSuccess', function (event, newUrl, oldUrl) {\n if ($location.hash() != 'feature') {\n $('.feature-modal').modal('hide');\n }\n });\n $scope.init = function () {\n if ($location.hash() == 'feature' && !$('.feature-modal').is(':visible')) {\n window.history.back();\n }\n };\n $scope.init();\n $('.feature-modal').on('show.bs.modal', function (e) {\n $location.hash('feature');\n });\n $('.feature-modal').on('hide.bs.modal', function (e) {\n if ($location.hash() == 'feature') {\n window.history.back();\n }\n });\n $scope.currentLang = commonVariablesService.getLangCode();\n $scope.QrMenuViewMode = 0;\n $scope.product = null;\n $scope.products = [];\n $scope.featureClicked = function (featureID) {\n $scope.selectedFeature = featureID;\n };\n $scope.onClickAddToCart = function (_, product) {\n $scope.product = product;\n productFeatureService.addToCart($scope, product);\n if (product.ProductFeatureGroups.length === 0) {\n document.getElementById('notification').style.display = 'block';\n setTimeout(function () {\n return document.getElementById('notification').style.display = 'none';\n }, 1500);\n }\n };\n $scope.handleDivClick = function (productFeatureID) {\n $scope.quantities[productFeatureID].quantity = true;\n };\n $scope.CurrencyType = localStorage.getItem(StorageKey.CURRENCY);\n $scope.setMenuData = function (menu) {\n var categories = menu['MenuGroup'];\n var category = categories.find(function (group) {\n return group['MenuGroupID'] === menuGroupId;\n });\n var products = category['Products'];\n var _iterator = _createForOfIteratorHelper(products),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var categoryItem = _step.value;\n categoryItem.Currency = menu.Currency;\n categoryItem.CurrencyID = menu.CurrencyID;\n categoryItem.currentLang = $scope.currentLang;\n setMissingImage(categoryItem, menu.CustomerImageUrl);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n var subcategories = categories.filter(function (i) {\n return i['ParentID'] === menuGroupId;\n });\n $scope.rowChunk = lodash.chunk(subcategories, CATEGORY_COL_SIZE);\n $timeout(function () {\n $scope.products = products;\n commonVariablesService.setItem('metaTitle', category['Name']);\n commonVariablesService.setItem('headerHidden', false);\n commonVariablesService.setItem('footerHidden', true);\n commonVariablesService.setItem('feedbackHidden', false);\n commonVariablesService.setItem('showBack', true);\n commonVariablesService.setItem('languageHidden', false);\n commonVariablesService.setItem('appBarHidden', false);\n angular.element('#den').addClass('cmp-box-shadow-2');\n });\n };\n $scope.setAppSettings = function (settings) {\n var _settings = settings;\n $scope.QrMenuViewMode = _settings['QrMenuViewMode'];\n $scope.QrMenuOrderMode = _settings['QrMenuOrderMode'];\n $scope.QrMenuThemeColor = _settings['QrMenuThemeColor'];\n };\n var customerData = dataService._getCustomer();\n if (customerData && Object.keys(customerData).length !== 0) {\n $scope.setAppSettings(customerData['Settings']);\n }\n var menuData = dataService._getMenu();\n if (menuData && Object.keys(menuData).length !== 0) {\n $scope.setMenuData(menuData);\n }\n dataService._customerObservable().subscribe(function (customer) {\n $scope.$apply(function () {\n $scope.setAppSettings(customer['Settings']);\n });\n });\n dataService._menuObservable().subscribe(function (menu) {\n $scope.$apply(function () {\n $scope.setMenuData(menu);\n });\n });\n }\n }\n};\n\nvar ProductController = function () {\n function ProductController($scope, $location, $stateParams, $timeout, apiService, dataService, cartService, productFeatureService, commonVariablesService) {\n _classCallCheck(this, ProductController);\n this._scope = $scope;\n this._productFeatureService = productFeatureService;\n $scope.currentLang = commonVariablesService.getLangCode();\n if ($scope.currentLang === 'TR' || $scope.currentLang === 'EN' || $scope.currentLang === 'DE') {\n $scope.languageCode = $scope.currentLang.toLowerCase() + '/';\n } else {\n $scope.languageCode = 'en/';\n }\n $scope.$on('$locationChangeSuccess', function (event, newUrl, oldUrl) {\n if ($location.hash() != 'feature') {\n $('.feature-modal').modal('hide');\n }\n });\n $scope.init = function () {\n if ($location.hash() == 'feature' && !$('.feature-modal').is(':visible')) {\n window.history.back();\n }\n };\n $scope.init();\n $('.feature-modal').on('show.bs.modal', function (e) {\n $location.hash('feature');\n });\n $('.feature-modal').on('hide.bs.modal', function (e) {\n if ($location.hash() == 'feature') {\n window.history.back();\n }\n });\n $scope.shouldHidePrice = false;\n $scope.hasAnyAllergen = false;\n $scope.totalQuantity = cartService._totalQuantity;\n cartService.watch(function () {\n return $timeout(function () {\n return $scope.totalQuantity = cartService._totalQuantity;\n });\n });\n var productId = parseInt($stateParams['productId']);\n $scope.product = {};\n $scope.currency = '';\n $scope.currencyID = '';\n $scope.allergens = {};\n $scope.tags = {};\n $scope.image = '';\n $scope.description = '';\n $scope.newDescription = '';\n $scope.addToCartTimeout = -1;\n $scope.productAllergens = [];\n $scope.productTags = [];\n $scope.CurrencyType = localStorage.getItem(StorageKey.CURRENCY);\n $scope._setFeatureChunk = function () {\n var _iterator = _createForOfIteratorHelper(this._product.ProductFeatureGroups),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var featureGroup = _step.value;\n if (featureGroup.Special === true) {\n featureGroup._featureChunk = lodash.chunk(featureGroup.ProductFeature, 3);\n } else {\n featureGroup._featureChunk = lodash.chunk(featureGroup.ProductFeature, featureGroup.ProductFeature.length);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n };\n $scope.setMenuData = function (menu) {\n var categories = menu['MenuGroup'];\n var _iterator2 = _createForOfIteratorHelper(categories),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var category = _step2.value;\n var _iterator3 = _createForOfIteratorHelper(category['Products']),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var product = _step3.value;\n if (product['ProductID'] === productId) {\n var _$scope$description;\n this._product = $scope._product = product;\n $scope._setFeatureChunk(product);\n $scope.product = product;\n $scope.allergens = JSON.parse(product['Allergens']);\n $scope.tags = product['Tags'];\n $scope.description = product['Description'];\n var index = 0;\n var result = (_$scope$description = $scope.description) === null || _$scope$description === void 0 ? void 0 : _$scope$description.indexOf('*');\n if (result && result !== -1) {\n for (var i = 0; i < $scope.description.length; i++) {\n var star = $scope.description.charAt(i);\n if (star === '*') {\n if (index % 2 === 0) {\n $scope.newDescription += '';\n } else {\n $scope.newDescription += '';\n }\n index++;\n } else {\n $scope.newDescription += star;\n }\n }\n } else {\n $scope.newDescription = product['Description'];\n }\n document.getElementById('description').innerHTML = $scope.newDescription;\n if ($scope.product.ProductFeatureGroups === null) {\n return;\n }\n var specialFeatures = $scope.product.ProductFeatureGroups.filter(function (i) {\n return i.Special === true;\n });\n if (specialFeatures.length > 0) {\n $scope.shouldHidePrice = true;\n }\n $scope.shouldHidePrice = $scope.shouldHidePrice && $scope.QrMenuOrderMode === 0;\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n if ($scope.allergens != null) {\n var allergenKeys = Object.keys($scope.allergens);\n for (var _i = 0, _allergenKeys = allergenKeys; _i < _allergenKeys.length; _i++) {\n var allergenKey = _allergenKeys[_i];\n if ($scope.allergens[allergenKey] === 1) {\n $scope.productAllergens.push(allergenKey);\n $scope.hasAnyAllergen = true;\n }\n }\n }\n $scope.randomColors = ['#e2653e', '#8852c9', '#27a498', '#ea4848', '#334d5c', '#fb9007', '#75b12e', '#01ae48', '#317f74', '#56c59e', '#ae1d1d', '#343a40', '#587543', '#26329f', '#e81c53'];\n var excludedTags = ['DomesticProduction', 'ImportedProduction', 'CarbonLow', 'CarbonMid', 'CarbonHigh', 'Carbon'];\n if ($scope.tags) {\n Object.keys($scope.tags).forEach(function (tagKey) {\n if ($scope.tags[tagKey] === 1 && !excludedTags.includes(tagKey)) {\n $scope.productTags.push(tagKey);\n }\n if (tagKey === 'Carbon') {\n $scope.carbonAmount = $scope.tags[tagKey];\n }\n });\n }\n $timeout(function () {\n var _window$customer$Imag, _window, _window$customer;\n angular.element('#den').removeClass('cmp-box-shadow-2');\n commonVariablesService.setItem('headerHidden', true);\n commonVariablesService.setItem('footerHidden', true);\n commonVariablesService.setItem('appBarHidden', false);\n setMissingImage($scope.product, (_window$customer$Imag = (_window = window) === null || _window === void 0 ? void 0 : (_window$customer = _window.customer) === null || _window$customer === void 0 ? void 0 : _window$customer.ImageUrl) !== null && _window$customer$Imag !== void 0 ? _window$customer$Imag : '');\n $scope.currency = AppStorage.getItem(StorageKey.CURRENCY);\n $scope.currencyID = AppStorage.getItem(StorageKey.CURRENCY_ID);\n $scope.$digest();\n });\n $timeout(function () {\n var _AppStorage$getItem$s;\n $scope.isOrderTime = (_AppStorage$getItem$s = AppStorage.getItem(StorageKey.QR_ORDER_TIMES)['status']) !== null && _AppStorage$getItem$s !== void 0 ? _AppStorage$getItem$s : true;\n });\n };\n $scope.setAppSettings = function (settings) {\n $scope.QrMenuSettings = settings;\n $scope.QrMenuMode = $scope.QrMenuSettings['QrMenuMode'];\n $scope.QrMenuOrderMode = $scope.QrMenuSettings['QrMenuOrderMode'];\n $scope.QrMenuThemeColor = $scope.QrMenuSettings['QrMenuThemeColor'];\n $scope.showOptions = $scope.QrMenuSettings['QrMenuShowOptions'];\n };\n var customerData = dataService._getCustomer();\n if (customerData && Object.keys(customerData).length !== 0) {\n $scope.customerID = customerData.CustomerID;\n $scope.setAppSettings(customerData['Settings']);\n }\n var menuData = dataService._getMenu();\n if (menuData && Object.keys(menuData).length !== 0) {\n $scope.setMenuData(menuData);\n }\n dataService._customerObservable().subscribe(function (customer) {\n $scope.$apply(function () {\n $scope.customerID = customer.CustomerID;\n $scope.setAppSettings(customer['Settings']);\n });\n });\n dataService._menuObservable().subscribe(function (menu) {\n $scope.$apply(function () {\n $scope.setMenuData(menu);\n });\n });\n $scope.getProductPrice = function (prod) {\n var _features$find$Price, _features$find, _features$find$Price2, _features$find2;\n var price = prod.Price;\n if ($scope.QrMenuOrderMode === 4) {\n var _prod$ProductFeatureG;\n var reservation = AppStorage.getItem(StorageKey.RESERVATION);\n var features = prod === null || prod === void 0 ? void 0 : (_prod$ProductFeatureG = prod.ProductFeatureGroups[0]) === null || _prod$ProductFeatureG === void 0 ? void 0 : _prod$ProductFeatureG.ProductFeature;\n switch (reservation.Type) {\n case 4:\n price += (_features$find$Price = features === null || features === void 0 ? void 0 : (_features$find = features.find(function (x) {\n return x.Code === 'AI';\n })) === null || _features$find === void 0 ? void 0 : _features$find.Price) !== null && _features$find$Price !== void 0 ? _features$find$Price : 0;\n break;\n case 5:\n price += (_features$find$Price2 = features === null || features === void 0 ? void 0 : (_features$find2 = features.find(function (x) {\n return x.Code === 'UAI';\n })) === null || _features$find2 === void 0 ? void 0 : _features$find2.Price) !== null && _features$find$Price2 !== void 0 ? _features$find$Price2 : 0;\n break;\n }\n }\n return price.toFixed(2);\n };\n $scope.featureClicked = function (featureID) {\n $scope.selectedFeature = featureID;\n };\n }\n _createClass(ProductController, [{\n key: \"onBackPressed\",\n value: function onBackPressed() {\n this.clearAddToCartTimeout();\n window.history.back();\n }\n }, {\n key: \"onClickAddToCart\",\n value: function onClickAddToCart() {\n var addToCartRes = this._productFeatureService.addToCart(this._scope, this._scope.product);\n if (addToCartRes == true) {\n this.addtoCartButtonAnimation();\n }\n }\n }, {\n key: \"clearAddToCartTimeout\",\n value: function clearAddToCartTimeout() {\n if (this._scope.addToCartTimeout !== -1) {\n clearTimeout(this._scope.addToCartTimeout);\n this._scope.addToCartTimeout = -1;\n }\n }\n }, {\n key: \"addtoCartButtonAnimation\",\n value: function addtoCartButtonAnimation() {\n var _this = this;\n this.clearAddToCartTimeout();\n angular.element('#addToCartBtn').removeClass('loading');\n setTimeout(function () {\n angular.element('#addToCartBtn').addClass('loading');\n _this._scope.addToCartTimeout = setTimeout(function () {\n angular.element('#addToCartBtn').removeClass('loading');\n }, 3700);\n }, 100);\n }\n }, {\n key: \"onClickAddToCartWithOptions\",\n value: function onClickAddToCartWithOptions() {\n this.addtoCartButtonAnimation();\n }\n }]);\n return ProductController;\n}();\nvar productComponent = {\n productDetail: {\n bindings: {},\n controller: ProductController,\n templateUrl: 'app/components/product-detail/product-detail.component.html'\n }\n};\n\nvar feedbackComponent = {\n feedback: {\n bindings: {},\n templateUrl: 'app/components/feedback/feedback.component.html',\n controller: function controller($rootScope, $scope, $state, apiService, $timeout, commonVariablesService) {\n var translations = $rootScope.translations;\n $scope.QrMenuSettings = AppStorage.getItem(StorageKey.SETTINGS);\n $scope.QrMenuViewMode = $scope.QrMenuSettings['QrMenuViewMode'];\n $scope.QrMenuFeedback = $scope.QrMenuSettings['QrMenuFeedback'];\n $scope.QrMenuThemeColor = $scope.QrMenuSettings['QrMenuThemeColor'];\n $scope.QrMenuLocationMode = $scope.QrMenuSettings['QrMenuLocationMode'];\n $scope.QrMenuFeedback === 0 && $scope.QrMenuViewMode === 2 ? $state.go('app.categoryTheme') : $scope.QrMenuFeedback === 0 && $scope.QrMenuViewMode !== 2 ? $state.go('app.categories.categoryList') : '';\n $scope.menu = 60;\n $scope.price = 60;\n $scope.service = 60;\n $scope.courtesy = 60;\n $scope.environment = 60;\n $scope.description = '';\n $scope.ratings = [{\n current: 3,\n max: 5\n }, {\n current: 3,\n max: 5\n }, {\n current: 3,\n max: 5\n }, {\n current: 3,\n max: 5\n }, {\n current: 3,\n max: 5\n }];\n $scope.sendRate = function () {\n var menu = $scope.ratings[0].current * 20;\n var price = $scope.ratings[1].current * 20;\n var service = $scope.ratings[2].current * 20;\n var courtesy = $scope.ratings[3].current * 20;\n var environment = $scope.ratings[4].current * 20;\n var name = $('#name').val();\n var description = $('#description').val();\n var feedback = {\n CustomerID: window.customer.CustomerID,\n ServiceCourtesy: courtesy,\n ServiceInformation: service,\n ServiceSpeed: service,\n ServiceQuality: service,\n FoodMenu: menu,\n FoodVisuality: menu,\n FoodTaste: menu,\n FoodPrice: price,\n EnvironmentHygine: environment,\n EnvironmentMusic: environment,\n EnvironmentAmbiance: environment,\n EnvironmentComfort: environment,\n Description: description,\n Name: name\n };\n $scope.onClickOKAtSuccessPopup = function () {\n $('.feedback-success-popup').modal('hide');\n setTimeout(function () {\n $scope.QrMenuViewMode !== 2 ? $state.go('app.categories.categoryList') : $state.go('app.categoryTheme');\n }, 200);\n };\n apiService.postFeedback(feedback).then(function (result) {\n $scope.ratings[0].current = 3;\n $scope.ratings[1].current = 3;\n $scope.ratings[2].current = 3;\n $scope.ratings[3].current = 3;\n $scope.ratings[4].current = 3;\n $('#description').val('');\n $('#name').val('');\n })[\"catch\"](function (error) {\n $scope.ratings[0].current = 3;\n $scope.ratings[1].current = 3;\n $scope.ratings[2].current = 3;\n $scope.ratings[3].current = 3;\n $scope.ratings[4].current = 3;\n $('#description').val('');\n $('#name').val('');\n });\n };\n $timeout(function () {\n commonVariablesService.setItem('headerHidden', false);\n commonVariablesService.setItem('footerHidden', true);\n commonVariablesService.setItem('languageHidden', false);\n commonVariablesService.setItem('feedbackHidden', false);\n commonVariablesService.setItem('showBack', true);\n angular.element('#den').addClass('cmp-box-shadow-2');\n commonVariablesService.setItem('metaTitle', translations.feedback_title);\n $scope.QrMenuViewMode === 2 ? commonVariablesService.setItem('appBarHidden', true) : commonVariablesService.setItem('appBarHidden', false);\n $scope.$digest();\n });\n }\n }\n};\n\nvar basketComponent = {\n basket: {\n bindings: {},\n templateUrl: 'app/components/basket/basket.component.html',\n controller: function controller($rootScope, $scope, $timeout, $state, $location, apiService, cartService, orderApiService, commonVariablesService, $sce) {\n $scope.cartService = cartService;\n var translations = $rootScope.translations;\n $scope.currentLang = commonVariablesService.getLangCode();\n $scope.tableNo = SessionAppStorage.getItem(StorageKey.TABLE_NO);\n $scope.onlinePaymentMode = JSON.parse(sessionStorage.getItem(StorageKey.ONLINEPAYMENTMODE));\n $scope.isLoading = false;\n $scope.isSubmit = false;\n $scope.paymentTab = 0;\n $scope.QrMenuSettings = AppStorage.getItem(StorageKey.SETTINGS);\n $scope.QrMenuViewMode = $scope.QrMenuSettings['QrMenuViewMode'];\n $scope.QrMenuThemeColor = $scope.QrMenuSettings['QrMenuThemeColor'];\n $scope.QrMenuOnlinePayment = $scope.QrMenuSettings['QrMenuOnlinePayment'];\n $scope.QrMenuViewMode === 2 ? $state.go('app.categoryTheme') : '';\n $scope.checkoutUrl = '';\n $scope.checkoutUrlPosPratik = '';\n $scope.paymentAccount = {\n Name: '',\n Email: '',\n Cellphone: '',\n Address: '',\n CityTown: '',\n PostCode: '',\n ModifiedTime: getCurrentTime()\n };\n $scope.payment = {\n CustomerID: null,\n OnlineOrderID: null,\n Price: null,\n Type: 71,\n CardHolderName: '',\n CardNumber: '',\n CardMonth: '',\n CardYear: '',\n CardCVC: '',\n Account: null,\n expiryDate: '',\n is3D: false\n };\n $scope.$on('$locationChangeSuccess', function (event, newUrl, oldUrl) {\n if ($location.hash() != 'order' && $('.send-order-popup').is(':visible')) {\n $('.send-order-popup').modal('hide');\n $scope.isLoading = false;\n }\n if ($location.hash() != 'basketerror' && $('.error-basket-popup').is(':visible')) {\n $('.error-basket-popup').modal('hide');\n }\n if ($location.hash() != 'ordersuccess' && $('.order-success-popup').is(':visible')) {\n $('.order-success-popup').modal('hide');\n }\n if ($location.hash() != 'ordererror' && $('.order-error-popup').is(':visible')) {\n $('.order-error-popup').modal('hide');\n }\n });\n $scope.init = function () {\n setTimeout(function () {\n if ($location.hash() == 'order' && !$('.send-order-popup').is(':visible')) {\n window.history.back();\n }\n if ($location.hash() == 'basketerror' && !$('.error-basket-popup').is(':visible')) {\n window.history.back();\n }\n if ($location.hash() == 'ordersuccess' && !$('.order-success-popup').is(':visible')) {\n window.history.back();\n }\n if ($location.hash() == 'ordererror' && !$('.order-error-popup').is(':visible')) {\n window.history.back();\n }\n }, 100);\n };\n $('.send-order-popup').on('show.bs.modal', function (e) {\n $location.hash('order');\n });\n $('.send-order-popup').on('hide.bs.modal', function (e) {\n if ($location.hash() == 'order') {\n window.history.back();\n }\n });\n $('.error-basket-popup').on('show.bs.modal', function (e) {\n $location.hash('basketerror');\n });\n $('.error-basket-popup').on('hide.bs.modal', function (e) {\n if ($location.hash() == 'basketerror') {\n window.history.back();\n }\n });\n $('.order-success-popup').on('show.bs.modal', function (e) {\n $location.hash('ordersuccess');\n });\n $('.order-success-popup').on('hide.bs.modal', function (e) {\n if ($location.hash() == 'ordersuccess') {\n window.history.back();\n }\n });\n $('.order-error-popup').on('show.bs.modal', function (e) {\n $location.hash('ordererror');\n });\n $('.order-error-popup').on('hide.bs.modal', function (e) {\n if ($location.hash() == 'ordererror') {\n window.history.back();\n }\n });\n $('.payment-modal').on('hide.bs.modal', function (e) {\n $scope.paymentTab = 0;\n $scope.paymentAccount.Name = '';\n $scope.paymentAccount.Email = '';\n $scope.paymentAccount.Cellphone = '';\n $scope.paymentAccount.CityTown = '';\n $scope.paymentAccount.PostCode = '';\n $scope.paymentAccount.Address = '';\n $scope.payment.CardHolderName = '';\n $scope.payment.CardNumber = '';\n $scope.payment.expiryDate = '';\n $scope.payment.CardCVC = '';\n $scope.payment.is3D = '';\n });\n $scope.tempOrderTableNo = '';\n $scope.orderTableNo = '';\n $scope.CurrencyType = localStorage.getItem(StorageKey.CURRENCY);\n $scope.QrMenuOrderMode = $scope.QrMenuSettings['QrMenuOrderMode'];\n $scope.currencyID = AppStorage.getItem(StorageKey.CURRENCY_ID);\n $timeout(function () {\n commonVariablesService.setItem('headerHidden', false);\n commonVariablesService.setItem('footerHidden', true);\n commonVariablesService.setItem('languageHidden', false);\n commonVariablesService.setItem('feedbackHidden', true);\n commonVariablesService.setItem('showBack', true);\n commonVariablesService.setItem('appBarHidden', false);\n angular.element('#den').addClass('cmp-box-shadow-2');\n commonVariablesService.setItem('metaTitle', translations.basket_title);\n });\n $scope.onClickDecreaseQuantity = function (product) {\n cartService.decrement(product);\n };\n $scope.onClickIncreaseQuantity = function (product) {\n cartService.increment(product);\n };\n $scope.sendOrderFunc = function () {\n $scope.isLoading = true;\n var tableNo = SessionAppStorage.getItem(StorageKey.TABLE_NO);\n $scope.__onSendOrder = function () {\n if ($scope.orderTableNo === '' && $scope.QrMenuOrderMode !== 2 && $scope.QrMenuOrderMode !== 3) {\n $('.error-basket-popup').modal('show');\n return;\n }\n if ($scope.orderTableNo === null && $scope.QrMenuOrderMode !== 2 && $scope.QrMenuOrderMode !== 3) {\n $scope.orderTableNo = '';\n return;\n }\n if ($scope.orderTableNo.length === 0 && $scope.QrMenuOrderMode !== 2 && $scope.QrMenuOrderMode !== 3) {\n return;\n }\n var tableNo = parseInt($scope.orderTableNo);\n if (isNaN(tableNo) && $scope.QrMenuOrderMode !== 2 && $scope.QrMenuOrderMode !== 3) {\n return;\n }\n $scope.payment.Price = $scope.cartService.totalPrice;\n $scope.sendOrderByOrderMode(tableNo).then(function (data) {\n $scope.tempOrderTableNo = $scope.orderTableNo;\n $scope.orderTableNo = '';\n var oldOrders = localStorage.getItem('OrdersInfo');\n if (oldOrders !== null && data !== undefined) {\n var oldOrdersFromLocalStorage = JSON.parse(oldOrders);\n oldOrdersFromLocalStorage.push(data);\n localStorage.setItem('OrdersInfo', JSON.stringify(oldOrdersFromLocalStorage));\n } else if (data !== undefined) {\n var orderList = [];\n orderList.push(data);\n localStorage.setItem('OrdersInfo', JSON.stringify(orderList));\n }\n $scope.orderNumber = data.Code.substring(data.Code.length - 4, data.Code.length);\n setTimeout(function () {\n $('#loader').fadeOut(300);\n if ($scope.QrMenuOnlinePayment === 1) {\n if ($scope.onlinePaymentMode === 73) {\n $scope.paymentTab = 1;\n }\n $scope.payment.OnlineOrderID = data.ID;\n $timeout(function () {\n return $('.payment-modal').modal('show');\n });\n } else {\n $timeout(function () {\n return $('.order-success-popup').modal('show');\n });\n }\n }, 300);\n })[\"catch\"](function () {\n $timeout(function () {\n return $('.order-error-popup').modal('show');\n });\n $scope.isLoading = false;\n });\n };\n if (tableNo === undefined || tableNo === null || tableNo === '') {\n if ($scope.QrMenuOrderMode !== 2 && $scope.QrMenuOrderMode !== 3) {\n $('.send-order-popup').modal('show');\n return;\n }\n }\n $scope.orderTableNo = parseInt(tableNo);\n if (isNaN($scope.orderTableNo) && $scope.QrMenuOrderMode !== 2 && $scope.QrMenuOrderMode !== 3) {\n $scope.orderTableNo = '';\n return;\n }\n $scope.__onSendOrder();\n };\n $scope.__onClickOK = function () {\n $('.order-success-popup').modal('hide');\n setTimeout(function () {\n return $state.go('app.categories.categoryList');\n }, 200);\n };\n $scope.onClickSendOrderButton = function () {\n if ($rootScope.QrMenuLocationMode === 1) {\n if ($rootScope.isWithinRadius) {\n $scope.sendOrderFunc();\n } else {\n $('.error-location-popup').modal('show');\n }\n } else {\n $scope.sendOrderFunc();\n }\n };\n $scope.sendOrderByOrderMode = function (tableNo) {\n if ($scope.QrMenuOrderMode === 1 || $scope.QrMenuOrderMode === 4) {\n return orderApiService.sendTableOrderByTableNo(tableNo);\n }\n if ($scope.QrMenuOrderMode === 2 || $scope.QrMenuOrderMode === 3) {\n return orderApiService.sendTableOrder({\n TableID: null\n });\n }\n };\n $scope.goToPayment = function () {\n $scope.paymentTab = 1;\n };\n $scope.formatCardNumber = function () {\n if (!$scope.payment.CardNumber) {\n $scope.payment.CardNumber = '';\n }\n var value = $scope.payment.CardNumber.replace(/\\s+/g, '');\n value = value.replace(/\\D/g, '');\n if (value.length > 4) {\n value = value.match(/.{1,4}/g).join(' ');\n }\n $scope.payment.CardNumber = value;\n };\n $scope.formatExpiryDate = function () {\n if (!$scope.payment.expiryDate) {\n $scope.payment.expiryDate = '';\n }\n var value = $scope.payment.expiryDate.replace(/\\D/g, '');\n value = value.replace(/\\D/g, '');\n if (value.length > 2) {\n value = value.substring(0, 2) + '/' + value.substring(2, 4);\n }\n $scope.payment.expiryDate = value;\n if (value.includes('/')) {\n var exDate = value.split('/');\n $scope.payment.CardMonth = exDate[0];\n $scope.payment.CardYear = exDate[1];\n }\n };\n $scope.submitPayment = function () {\n $scope.isSubmit = true;\n $scope.payment.CustomerID = window.customer.CustomerID;\n $scope.payment.Account = $scope.paymentAccount;\n if ($scope.onlinePaymentMode === 71) {\n apiService.postOnlinePayment3d($scope.payment).then(function (data) {\n if (data) {\n $scope.onlinePaymentID = data.OnlinePaymentID;\n var blob = new Blob([data['Content']], {\n type: 'text/html'\n });\n var obj = URL.createObjectURL(blob);\n $scope.checkoutUrl = $sce.trustAsResourceUrl(obj);\n $scope.paymentTab = 2;\n $scope.onSuccessfulPayment();\n $scope.isSubmit = false;\n }\n });\n }\n if ($scope.onlinePaymentMode === 73 || $scope.onlinePaymentMode === 74) {\n $scope.paymentData = {\n AccountID: 1250063,\n CardCVC: $scope.payment.CardCVC,\n CardHolderName: $scope.payment.CardHolderName,\n CardMonth: $scope.payment.CardMonth,\n CardNumber: $scope.payment.CardNumber.replace(/\\s+/g, ''),\n CardToken: '',\n CardUserKey: '',\n CardYear: $scope.payment.CardYear,\n Currency: '',\n CustomerID: window.customer.CustomerID,\n Description: '',\n DeviceID: 1,\n IpAddress: '',\n Locale: '',\n OnlineOrderID: $scope.payment.OnlineOrderID,\n Price: $scope.payment.Price,\n RegisterCard: 1,\n SessionID: 1,\n SessionLID: 1,\n TableID: 1,\n Type: $scope.onlinePaymentMode,\n is3D: true\n };\n apiService.postOnlinePayment($scope.paymentData).then(function (data) {\n if (data) {\n $scope.onlinePaymentID = data.ID;\n var blob = new Blob([data['Exception']], {\n type: 'text/html'\n });\n var obj = URL.createObjectURL(blob);\n $scope.checkoutUrlPosPratik = $sce.trustAsResourceUrl(obj);\n $scope.paymentTab = 2;\n $scope.onSuccessfulPayment();\n $scope.isSubmit = false;\n }\n });\n } else {\n $('.order-error-popup').modal('show');\n }\n };\n $scope.onSuccessfulPayment = function () {\n var interval = setInterval(function () {\n apiService.getOnlinePaymentStatus($scope.onlinePaymentID).then(function (result) {\n if (result === 1) {\n var isPaid = AppStorage.getItem(StorageKey.SETTINGS).QrMenuIsPaid === 1;\n var onlineOrder = {\n CustomerID: window.customer.CustomerID,\n OnlineOrderID: $scope.payment.OnlineOrderID,\n Status: 0,\n Paid: isPaid\n };\n apiService.putOnlineOrder(onlineOrder).then(function () {\n $scope.cartService.clear();\n $('.payment-modal').modal('hide');\n $('.order-success-popup').modal('show');\n });\n clearInterval(interval);\n } else if (result === -1) {\n clearInterval(interval);\n $('.payment-modal').modal('hide');\n $('.order-error-popup').modal('show');\n }\n });\n }, 3000);\n };\n $scope.checkClose = function (event) {\n if ($scope.paymentTab === 2) {\n event.stopPropagation();\n }\n };\n $scope.closeForm = function () {\n $('.payment-modal').modal('hide');\n };\n $scope.backForm = function () {\n $scope.paymentTab = 0;\n };\n }\n }\n};\n\nvar loginComponent = {\n login: {\n bindings: {},\n templateUrl: 'app/components/login/login.component.html',\n controller: function controller($scope, commonVariablesService, $location, apiService, dataService, $transitions, $timeout, $state, $rootScope, $interval) {\n var isMobile = {\n Android: function Android() {\n return navigator.userAgent.match(/Android/i);\n },\n BlackBerry: function BlackBerry() {\n return navigator.userAgent.match(/BlackBerry/i);\n },\n iOS: function iOS() {\n return navigator.userAgent.match(/iPhone|iPad|iPod/i);\n },\n Opera: function Opera() {\n return navigator.userAgent.match(/Opera Mini|Chrome|Mozilla|Edge/i);\n }\n };\n $scope.isMenuReady = dataService._getIsMenuReady();\n $scope.pageReady = false;\n $scope.setCustomerData = function (customer) {\n $scope.languageCode = AppStorage.getItem(StorageKey.LANGUAGE_CODE);\n $scope.languages = AppStorage.getItem(StorageKey.LANGUAGES);\n $scope.QrMenuSettings = AppStorage.getItem(StorageKey.SETTINGS);\n $scope.QrMenuOrderMode = $scope.QrMenuSettings['QrMenuOrderMode'];\n $scope.QrMenuMode = $scope.QrMenuSettings['QrMenuMode'];\n $scope.QrMenuRegister = $scope.QrMenuSettings['QrMenuRegister'];\n $scope.QrMenuGuestCall = $scope.QrMenuSettings['QrMenuGuestCall'];\n $scope.QrMenuViewMode = $scope.QrMenuSettings['QrMenuViewMode'];\n $scope.QrMenuThemeColor = $scope.QrMenuSettings['QrMenuThemeColor'];\n $scope.QrMenuLocationMode = $scope.QrMenuSettings['QrMenuLocationMode'];\n $scope.QrMenuShowCampaign = $scope.QrMenuSettings['QrMenuShowCampaign'];\n $scope.QrMenuLogoMode = $scope.QrMenuSettings['QrMenuLogoMode'];\n $scope[\"default\"] = customer['Languages'];\n $scope.facebook = customer.FacebookUrl;\n $scope.instagram = customer.InstagramUrl;\n $scope.appstore = customer.AppStoreUrl;\n $scope.playstore = customer.GooglePlayUrl;\n if ($scope.QrMenuLogoMode === 0) {\n $scope.customerImageUrl = customer.ImageUrl;\n } else {\n var _customer$LogoUrl;\n $scope.customerImageUrl = (_customer$LogoUrl = customer.LogoUrl) !== null && _customer$LogoUrl !== void 0 ? _customer$LogoUrl : customer.ImageUrl;\n }\n $scope.customerName = customer.Title;\n if (isMobile.iOS() && (customer.AppStoreUrl !== null || customer.AppStoreUrl !== '')) {\n $scope.downloadlink = customer.AppStoreUrl;\n } else if (isMobile.Android() && (customer.GooglePlayUrl !== null || customer.GooglePlayUrl !== '')) {\n $scope.downloadlink = customer.GooglePlayUrl;\n } else if (isMobile.BlackBerry() && (customer.GooglePlayUrl !== null || customer.GooglePlayUrl !== '')) {\n $scope.downloadlink = customer.GooglePlayUrl;\n } else if (isMobile.Opera() && (customer.AppStoreUrl !== null || customer.AppStoreUrl !== '')) {\n $scope.downloadlink = customer.AppStoreUrl;\n }\n $scope.tableNo = SessionAppStorage.getItem(StorageKey.TABLE_NO);\n $scope.pageReady = true;\n };\n var customerData = dataService._getCustomer();\n if (customerData && Object.keys(customerData).length !== 0) {\n $scope.setCustomerData(customerData);\n }\n dataService._customerObservable().subscribe(function (customer) {\n $scope.$apply(function () {\n $scope.setCustomerData(customer);\n });\n });\n dataService._isMenuReadyObservable().subscribe(function (value) {\n $scope.$apply(function () {\n $scope.isMenuReady = value;\n });\n });\n dataService._campaignObservable().subscribe(function (campaigns) {\n $scope.$apply(function () {\n var today = new Date();\n $scope.filteredCampaigns = campaigns.filter(function (campaign) {\n var startTime = new Date(campaign.StartTime.replace('T', ' '));\n var endTime = new Date(campaign.EndTime.replace('T', ' '));\n return campaign.Status === 1 && $scope.QrMenuShowCampaign === 1 && startTime <= today && endTime >= today;\n });\n if ($scope.filteredCampaigns.length > 0) {\n $scope.allCampaigns = $scope.filteredCampaigns;\n $scope.currentIndex = 0;\n $scope.showCampaignPopup = true;\n $timeout(function () {\n $scope.onVideoLoadedMetadata();\n }, 100);\n }\n $scope.getCampaign();\n });\n });\n AppStorage.removeItem(StorageKey.RESERVATION);\n $scope.showMe = false;\n $scope.showCampaignPopup = false;\n $scope.reservationNumber = '';\n commonVariablesService.getSubject().subscribe(function () {\n var _commonVariablesServi;\n $scope.appBarHidden = (_commonVariablesServi = commonVariablesService.getItem('appBarHidden')) !== null && _commonVariablesServi !== void 0 ? _commonVariablesServi : false;\n });\n $scope.$on('$locationChangeSuccess', function (event, newUrl, oldUrl) {\n if ($location.hash() != 'modal') {\n $('.register-form').modal('hide');\n }\n });\n $scope.init = function () {\n if ($location.hash() == 'modal' && !$('.register-form').is(':visible')) {\n window.history.back();\n }\n };\n $('.register-form').on('show.bs.modal', function (e) {\n $location.hash('modal');\n });\n $('.register-form').on('hide.bs.modal', function (e) {\n if ($location.hash() == 'modal') {\n window.history.back();\n }\n });\n $timeout(function () {\n commonVariablesService.setItem('headerHidden', true);\n commonVariablesService.setItem('footerHidden', true);\n commonVariablesService.setItem('appBarHidden', true);\n angular.element('#den').addClass('cmp-box-shadow-2');\n });\n $transitions.onStart({}, function () {\n $scope.showMe = false;\n commonVariablesService.setItem('showMe', false);\n });\n $scope.closeDownloadPlace = function () {\n $('#downloadPlace').addClass('d-none');\n };\n $scope.onClickGoToMenu = function () {\n if ($scope.QrMenuSettings.QrMenuOrderMode === 4) {\n $('.reservation-number-popup').modal('show');\n setTimeout(function () {\n $('#reservationInput').focus();\n });\n return;\n }\n if ($scope.QrMenuRegister === 0) {\n $scope.QrMenuSettings.QrMenuViewMode === 2 ? $state.go('app.categoryTheme') : $state.go('app.categories.categoryList');\n return;\n }\n if ($scope.QrMenuSettings.QrMenuViewMode === 2) {\n $state.go('app.categoryTheme');\n } else {\n var registered = AppStorage.getItem(StorageKey.REGISTERED);\n var showRegisterForm = function showRegisterForm() {\n var registerForm = $('.register-form');\n registerForm.modal({\n backdrop: 'static',\n keyboard: false\n });\n registerForm.modal('show');\n };\n if (registered == null) {\n showRegisterForm();\n return;\n }\n if (!registered.hasOwnProperty('date')) {\n showRegisterForm();\n return;\n }\n var currDate = new Date().getTime();\n var registeredDate = registered.date;\n if (currDate - registeredDate > 3600000) {\n showRegisterForm();\n AppStorage.removeItem(StorageKey.REGISTERED);\n return;\n }\n $state.go('app.categories.categoryList');\n }\n };\n $scope.onSendReservationNumber = function () {\n if ($scope.reservationNumber === null) {\n $scope.reservationNumber = '';\n }\n if ($scope.reservationNumber.length === 0) {\n $('.reservation-error-popup').modal('show');\n return;\n }\n if (isNaN($scope.reservationNumber)) {\n return;\n }\n apiService.getReservationByNumber(window.customer.CustomerID, $scope.reservationNumber).then(function (reservation) {\n if (reservation === null) {\n $scope.reservationNumber = '';\n $('.reservation-error-popup').modal('show');\n return;\n }\n document.body.classList.remove('modal-open');\n $('.modal-backdrop').remove();\n AppStorage.setItem(StorageKey.RESERVATION, reservation);\n $scope.QrMenuSettings.QrMenuViewMode === 2 ? $state.go('app.categoryTheme') : $state.go('app.categories.categoryList');\n })[\"catch\"](function () {\n $scope.reservationNumber = '';\n $('.reservation-error-popup').modal('show');\n });\n };\n $scope.autoSwipeInterval = null;\n $scope.currentIndex = 0;\n $scope.videoDuration = 0;\n $scope.onVideoLoadedMetadata = function () {\n $scope.stopAutoSwipe();\n $scope.videoDuration = $scope.getVideoDuration();\n $scope.setAutoSwipeInterval();\n };\n $scope.getVideoDuration = function () {\n var videoElement = document.getElementById('campaign-video');\n if (videoElement) {\n return videoElement.duration;\n }\n return 100;\n };\n $scope.setAutoSwipeInterval = function () {\n $scope.stopAutoSwipe();\n if ($scope.allCampaigns.length > 1) {\n $scope.autoSwipeInterval = $interval(function () {\n $scope.nextCampaign();\n }, $scope.videoDuration * 1000);\n }\n };\n $scope.stopAutoSwipe = function () {\n if ($scope.autoSwipeInterval !== null) {\n $interval.cancel($scope.autoSwipeInterval);\n $scope.autoSwipeInterval = null;\n }\n };\n $scope.getCampaign = function () {\n if ($scope.filteredCampaigns.length > 0) {\n $scope.allCampaigns = $scope.filteredCampaigns;\n $scope.currentIndex = 0;\n $scope.showCampaignPopup = true;\n $timeout(function () {\n $scope.onVideoLoadedMetadata();\n }, 100);\n }\n };\n $scope.goToCampaign = function (index) {\n $scope.currentIndex = index;\n $timeout(function () {\n $scope.onVideoLoadedMetadata();\n }, 100);\n };\n $scope.prevCampaign = function () {\n if ($scope.currentIndex === 0) {\n $scope.currentIndex = $scope.allCampaigns.length - 1;\n } else {\n $scope.currentIndex--;\n }\n $timeout(function () {\n $scope.onVideoLoadedMetadata();\n }, 100);\n };\n $scope.nextCampaign = function () {\n if ($scope.currentIndex === $scope.allCampaigns.length - 1) {\n $scope.currentIndex = 0;\n } else {\n $scope.currentIndex++;\n }\n $timeout(function () {\n $scope.onVideoLoadedMetadata();\n }, 100);\n };\n $scope.changeLanguage = function () {\n $scope.showMe = !$scope.showMe;\n commonVariablesService.setItem('showMe', true);\n };\n $scope.postGuest = function () {\n var ynamesurname = $('#namesurname').val();\n var ytaxno = $('#taxno').val();\n var ytelephone = $('#tel').val();\n var ymail = $('#mail').val();\n var maxCharacter = ynamesurname.length;\n var findSpace = ynamesurname.lastIndexOf(' ');\n var yname = ynamesurname.slice(0, findSpace);\n var ysurname = ynamesurname.slice(findSpace, maxCharacter);\n var callReg = {\n CustomerID: window.customer.CustomerID,\n Name: yname,\n Surname: ysurname,\n TaxNo: ytaxno ? ytaxno : '',\n Telephone: ytelephone,\n Email: ymail\n };\n if (yname === '' || ysurname === '' || ynamesurname === '' || $scope.QrMenuRegister === 3 && ytaxno === '' || ($scope.QrMenuRegister === 2 || $scope.QrMenuRegister === 3) && ytelephone === '' || yname === null || ysurname === null || ynamesurname === null) ; else {\n apiService.postGuest(callReg).then(function () {\n $('.success-registration-popup').modal('show');\n $('.register-form').modal('hide');\n $('#namesurname').val('');\n $('#taxno').val('');\n $('#tel').val('');\n $('#mail').val('');\n AppStorage.setItem(StorageKey.REGISTERED, {\n registered: true,\n date: new Date().getTime()\n });\n })[\"catch\"](function () {\n $('.error-registration-popup').modal('show');\n });\n }\n };\n $scope.onClickRegisterSuccessOK = function () {\n $('.success-registration-popup').modal('hide');\n $timeout(function () {\n return $state.go('app.categories.categoryList');\n }, 200);\n };\n $scope.onClickRegisterErrorOK = function () {\n $('.error-registration-popup').modal('hide');\n var registerForm = $('.register-form');\n registerForm.modal('show');\n };\n $scope.closeCampaignPopup = function () {\n $scope.showCampaignPopup = false;\n };\n }\n }\n};\n\nvar thanksComponent = {\n thanks: {\n bindings: {},\n templateUrl: 'app/components/thanks/thanks.component.html',\n controller: function controller($timeout, commonVariablesService) {\n $timeout(function () {\n commonVariablesService.setItem(\"headerHidden\", true);\n commonVariablesService.setItem(\"footerHidden\", true);\n commonVariablesService.setItem(\"languageHidden\", false);\n commonVariablesService.setItem(\"feedbackHidden\", false);\n commonVariablesService.setItem(\"showBack\", true);\n });\n }\n }\n};\n\nvar ordersComponent = {\n orders: {\n bindings: {},\n templateUrl: 'app/components/orders/orders.component.html',\n controller: function controller($rootScope, $scope, $timeout, $location, apiService, commonVariablesService, $state) {\n $scope.QrMenuSettings = AppStorage.getItem(StorageKey.SETTINGS);\n $scope.CurrencyType = localStorage.getItem(StorageKey.CURRENCY);\n $scope.QrMenuViewMode = $scope.QrMenuSettings['QrMenuViewMode'];\n $scope.QrMenuOrderMode = $scope.QrMenuSettings['QrMenuOrderMode'];\n $scope.QrMenuThemeColor = $scope.QrMenuSettings['QrMenuThemeColor'];\n $scope.QrMenuViewMode === 2 ? $state.go('app.categoryTheme') : $scope.QrMenuOrderMode === 0 && $scope.QrMenuViewMode !== 2 ? $state.go('app.categories.categoryList') : '';\n $scope.$on('$locationChangeSuccess', function (event, newUrl, oldUrl) {\n if ($location.hash() != 'detail') {\n $('.order-detail-modal').modal('hide');\n }\n });\n $scope.init = function () {\n if ($location.hash() == 'detail' && !$('.order-detail-modal').is(':visible')) {\n window.history.back();\n }\n };\n $scope.init();\n $('.order-detail-modal').on('show.bs.modal', function (e) {\n $location.hash('detail');\n });\n $('.order-detail-modal').on('hide.bs.modal', function (e) {\n if ($location.hash() == 'detail') {\n window.history.back();\n }\n });\n var translations = $rootScope.translations;\n var orderData = localStorage.getItem('OrdersInfo');\n $scope.orderData = JSON.parse(orderData).reverse();\n $scope.currency = '';\n $scope.currencyID = '';\n $scope.currencyID = AppStorage.getItem(StorageKey.CURRENCY_ID);\n $scope.currency = AppStorage.getItem(StorageKey.CURRENCY);\n $timeout(function () {\n commonVariablesService.setItem('headerHidden', false);\n commonVariablesService.setItem('footerHidden', true);\n commonVariablesService.setItem('languageHidden', false);\n commonVariablesService.setItem('feedbackHidden', true);\n commonVariablesService.setItem('showBack', true);\n commonVariablesService.setItem('appBarHidden', false);\n commonVariablesService.setItem('metaTitle', translations.order_title);\n angular.element('#den').addClass('cmp-box-shadow-2');\n });\n $scope.openDetail = function (UUID) {\n apiService.getOnlineOrderByUUID(UUID).then(function (data) {\n $scope.$apply(function () {\n $scope.orderDetail = data;\n $('.order-detail-modal').modal('show');\n });\n });\n };\n }\n }\n};\n\nvar languageDirective = {\n language: function language() {\n return {\n restrict: 'A',\n link: function link(scope, element, attrs) {\n var languageCode = attrs.languageCode;\n element.on(\"click\", function () {\n AppStorage.setItem(StorageKey.LANGUAGE_CODE, languageCode);\n window.location.reload();\n });\n }\n };\n }\n};\n\nvar feedbackDirective = {\n starRating: function starRating() {\n return {\n restrict: 'A',\n template: '
    ' + '
  • ' + \"\\u2605\" + '
  • ' + '
',\n scope: {\n ratingValue: '=',\n max: '=',\n onRatingSelected: '&'\n },\n link: function link(scope, elem, attrs) {\n var updateStars = function updateStars() {\n scope.stars = [];\n for (var i = 0; i < scope.max; i++) {\n scope.stars.push({\n filled: i < scope.ratingValue\n });\n }\n };\n scope.toggle = function (index) {\n scope.ratingValue = index + 1;\n scope.onRatingSelected({\n rating: index + 1\n });\n };\n scope.$watch('ratingValue', function (oldVal, newVal) {\n if (newVal) {\n updateStars();\n }\n });\n }\n };\n }\n};\n\nvar imageAppearDirective = {\n appear: function appear($window) {\n return {\n restrict: 'EA',\n scope: {\n imsrc: '@'\n },\n link: function link(scope, elem) {\n var placeholder = elem[0].src;\n var loaded = false;\n function isVisible() {\n var rect = elem[0].getBoundingClientRect();\n var viewHeight = Math.max($window.innerHeight, document.documentElement.clientHeight);\n return !(rect.bottom < 0 || rect.top - viewHeight >= 0);\n }\n function loadImage() {\n if (loaded || !isVisible()) {\n return;\n }\n loaded = true;\n var image = new Image();\n image.src = scope.imsrc;\n image.onload = function () {\n elem[0].src = image.src;\n };\n }\n angular.element($window).on('scroll', loadImage);\n angular.element($window).on('resize', loadImage);\n scope.$on('$destroy', function () {\n angular.element($window).off('scroll', loadImage);\n angular.element($window).off('resize', loadImage);\n });\n loadImage();\n }\n };\n }\n};\n\nvar guestCallDirective = {\n guestCall: function guestCall() {\n return {\n restrict: 'EA',\n templateUrl: 'app/shared/directives/guest-call/guest-call.directive.html',\n controller: function controller($rootScope, $scope, $timeout, apiService) {\n $scope.data = {\n guestCallTableNo: \"\",\n guestCallType: 40,\n QrMenuGuestCall: 1\n };\n $scope.data.guestCallType = 40;\n $scope.onClickGuestCall = function () {\n if ($rootScope.QrMenuLocationMode === 1) {\n if ($rootScope.isWithinRadius) {\n $scope.onSendGuestCall();\n } else {\n $('.error-location-popup').modal('show');\n }\n } else {\n $scope.onSendGuestCall();\n }\n };\n $scope.onSendGuestCall = function () {\n if ($scope.data.guestCallTableNo === null) {\n $scope.data.guestCallTableNo = '';\n }\n if ($scope.data.guestCallTableNo.length === 0) {\n $('.guestcall-error-popup').modal('show');\n return;\n }\n if (isNaN($scope.data.guestCallTableNo)) {\n return;\n }\n var guestCall = {\n CustomerID: window.customer.CustomerID,\n TableNumber: $scope.data.guestCallTableNo,\n Type: $scope.data.guestCallType\n };\n apiService.postGuestCall(guestCall).then(function () {\n $scope.data.guestCallTableNo = '';\n $timeout(function () {\n $('.guestcall-success-popup').modal('show');\n $('.call-waiter-type-popup').modal('hide');\n });\n })[\"catch\"](function (e) {\n console.error(e);\n $('.guestcall-error-popup').modal('show');\n });\n };\n $scope.__continue = function () {\n var tableNo = SessionAppStorage.getItem(StorageKey.TABLE_NO);\n if (tableNo === null) {\n $('.call-waiter-table-popup').modal('show');\n return;\n }\n $scope.data.guestCallTableNo = parseInt(tableNo);\n if (isNaN($scope.data.guestCallTableNo)) {\n $scope.data.guestCallTableNo = '';\n return;\n }\n $scope.onSendGuestCall();\n };\n $scope.onGuestCallTypeSelected = function (type) {\n $scope.data.guestCallType = type;\n $scope.__continue();\n };\n $timeout(function () {\n var _settings = AppStorage.getItem(StorageKey.SETTINGS);\n if (_settings) {\n $scope.data.QrMenuGuestCall = _settings['QrMenuGuestCall'];\n $scope.data.QrMenuThemeColor = _settings['QrMenuThemeColor'];\n }\n }, 200);\n $rootScope.onClickCallWaiterButton = function () {\n var _$scope$data;\n $('#bar').addClass('d-none');\n if (((_$scope$data = $scope.data) === null || _$scope$data === void 0 ? void 0 : _$scope$data.QrMenuGuestCall) > 1) {\n $('.call-waiter-type-popup').modal('show');\n return;\n }\n $scope.__continue();\n };\n }\n };\n }\n};\n\nvar SearchBarDirective = function SearchBarDirective() {\n _classCallCheck(this, SearchBarDirective);\n};\nvar searchBarDirective = {\n searchBar: function searchBar() {\n return {\n restrict: 'A',\n replace: true,\n templateUrl: 'app/shared/directives/search-bar/search-bar.directive.html',\n controller: SearchBarDirective\n };\n }\n};\n\nvar longPressDirective = {\n onLongPress: function onLongPress($timeout) {\n return {\n restrict: 'A',\n link: function link($scope, $elm, $attrs) {\n $elm.bind('touchstart', function (evt) {\n $scope.longPress = true;\n $timeout(function () {\n if ($scope.longPress) {\n $scope.$apply(function () {\n $scope.$eval($attrs.onLongPress);\n });\n }\n }, 600);\n });\n $elm.bind('touchend', function (evt) {\n $scope.longPress = false;\n if ($attrs.onTouchEnd) {\n $scope.$apply(function () {\n $scope.$eval($attrs.onTouchEnd);\n });\n }\n });\n }\n };\n }\n};\n\nvar categoryListItemDirective = {\n categoryListItem: function categoryListItem() {\n return {\n restrict: 'A',\n replace: true,\n scope: {\n data: '<'\n },\n templateUrl: 'app/components/categories/category-list/category-list-item/category-list-item.directive.html'\n };\n }\n};\n\nvar categoryDetailItemDirective = {\n categoryDetailItem: function categoryDetailItem() {\n return {\n restrict: 'A',\n replace: true,\n scope: {\n data: '<',\n qrMenuOrderMode: '<'\n },\n controller: function controller($scope) {\n var _AppStorage$getItem$s;\n $scope.isQuantityArea = false;\n var _settings = AppStorage.getItem(StorageKey.SETTINGS);\n $scope.CurrencyType = localStorage.getItem(StorageKey.CURRENCY);\n $scope.QrMenuViewMode = _settings['QrMenuViewMode'];\n $scope.QrMenuThemeColor = _settings['QrMenuThemeColor'];\n $scope.OrderMode = _settings['QrMenuOrderMode'];\n $scope.showOptions = _settings['QrMenuShowOptions'];\n $scope.lastPriceChange = _settings['QrMenuLastPriceChange'];\n $scope.selectedProd = null;\n $scope.isOrderTime = (_AppStorage$getItem$s = AppStorage.getItem(StorageKey.QR_ORDER_TIMES)['status']) !== null && _AppStorage$getItem$s !== void 0 ? _AppStorage$getItem$s : true;\n $scope.onClickAddToCart = function (data) {\n $scope.$emit('categoryItem.onClickAddToCart', data);\n $scope.isQuantityArea = false;\n };\n $scope.itemOnLongPress = function (data) {\n $scope.selectedProd = data;\n $scope.selectedProd.Quantity = 1;\n $scope.isQuantityArea = true;\n };\n $scope.itemOnTouchEnd = function (data) {\n $scope.selectedProd = data;\n $scope.selectedProd.Quantity = 1;\n $scope.onClickAddToCart($scope.selectedProd);\n };\n $scope.getProductPrice = function (prod) {\n var _features$find$Price, _features$find, _features$find$Price2, _features$find2;\n var price = prod.Price;\n if ($scope.OrderMode === 4) {\n var _prod$ProductFeatureG;\n var reservation = AppStorage.getItem(StorageKey.RESERVATION);\n var features = prod === null || prod === void 0 ? void 0 : (_prod$ProductFeatureG = prod.ProductFeatureGroups[0]) === null || _prod$ProductFeatureG === void 0 ? void 0 : _prod$ProductFeatureG.ProductFeature;\n switch (reservation.Type) {\n case 4:\n price += (_features$find$Price = features === null || features === void 0 ? void 0 : (_features$find = features.find(function (x) {\n return x.Code === 'AI';\n })) === null || _features$find === void 0 ? void 0 : _features$find.Price) !== null && _features$find$Price !== void 0 ? _features$find$Price : 0;\n break;\n case 5:\n price += (_features$find$Price2 = features === null || features === void 0 ? void 0 : (_features$find2 = features.find(function (x) {\n return x.Code === 'UAI';\n })) === null || _features$find2 === void 0 ? void 0 : _features$find2.Price) !== null && _features$find$Price2 !== void 0 ? _features$find$Price2 : 0;\n break;\n }\n }\n return price.toFixed(2);\n };\n },\n templateUrl: 'app/components/categories/category/category-detail-item/category-detail-item.directive.html'\n };\n }\n};\n\nvar categoryCardItemDirective = {\n categoryCardItem: function categoryCardItem() {\n return {\n restrict: 'A',\n replace: true,\n scope: {\n data: '<',\n qrMenuOrderMode: '<'\n },\n controller: function controller($scope) {\n var _AppStorage$getItem$s;\n var _settings = AppStorage.getItem(StorageKey.SETTINGS);\n $scope.CurrencyType = localStorage.getItem(StorageKey.CURRENCY);\n $scope.QrMenuThemeColor = _settings['QrMenuThemeColor'];\n $scope.showOptions = _settings['QrMenuShowOptions'];\n $scope.isOrderTime = (_AppStorage$getItem$s = AppStorage.getItem(StorageKey.QR_ORDER_TIMES)['status']) !== null && _AppStorage$getItem$s !== void 0 ? _AppStorage$getItem$s : true;\n $scope.onClickAddToCart = function (data) {\n $scope.$emit('categoryItem.onClickAddToCart', data);\n };\n },\n templateUrl: 'app/components/categories/category/category-card-item/category-card-item.directive.html'\n };\n }\n};\n\nvar UrlQueryService = function () {\n function UrlQueryService() {\n _classCallCheck(this, UrlQueryService);\n }\n _createClass(UrlQueryService, [{\n key: \"getQueryParamUnion\",\n value: function getQueryParamUnion() {\n if (hasOwnProperty(this, '_paramUnion')) {\n return this._paramUnion;\n }\n var paramUnions = this._paramUnion = [];\n var urlParams = getUrlParams();\n if (hasOwnProperty(urlParams, 'customerid')) {\n paramUnions.push({\n key: 'customerID',\n value: urlParams['customerid']\n });\n } else {\n paramUnions.push({\n key: 'weburl',\n value: hasOwnProperty(urlParams, 'weburl') ? urlParams['weburl'] : window.location.hostname\n });\n }\n if (hasOwnProperty(urlParams, 'tableno')) {\n paramUnions.push({\n key: 'tableno',\n value: urlParams['tableno']\n });\n }\n return paramUnions;\n }\n }]);\n return UrlQueryService;\n}();\nvar urlQueryService = {\n urlQueryService: function urlQueryService() {\n return new UrlQueryService();\n }\n};\n\nvar WorkingHoursService = function () {\n function WorkingHoursService(urlQueryService) {\n _classCallCheck(this, WorkingHoursService);\n this._urlQueryService = urlQueryService;\n }\n _createClass(WorkingHoursService, [{\n key: \"getWorkingHours\",\n value: function getWorkingHours() {\n var _settings = AppStorage.getItem(StorageKey.SETTINGS);\n var isOrderTime = true;\n var qrMenuOrderHours = _settings['QrMenuOrderHours'];\n if (qrMenuOrderHours !== null && qrMenuOrderHours !== undefined) {\n var splitTime = qrMenuOrderHours.split('-');\n var startTime = splitTime[0];\n var endTime = splitTime[1];\n if (startTime === null || startTime === 'null' || endTime === null || endTime === 'null') {\n isOrderTime = true;\n } else {\n var splitStartTime = startTime.split(':');\n var splitEndTime = endTime.split(':');\n var startHourValue = parseInt(splitStartTime[0]);\n var startMinuteValue = parseInt(splitStartTime[1]);\n var endHourValue = parseInt(splitEndTime[0]);\n var endMinuteValue = parseInt(splitEndTime[1]);\n var currentTime = new Date();\n var currentHour = currentTime.getHours();\n var currentMinute = currentTime.getMinutes();\n if (endHourValue < startHourValue) {\n isOrderTime = currentHour >= startHourValue || currentHour < endHourValue || currentHour === endHourValue && currentMinute <= endMinuteValue;\n } else {\n isOrderTime = currentHour > startHourValue && currentHour < endHourValue || currentHour === startHourValue && currentMinute >= startMinuteValue || currentHour === endHourValue && currentMinute <= endMinuteValue || startHourValue === endHourValue && startMinuteValue === endMinuteValue;\n }\n }\n }\n var qrOrderTimes = {\n start: startTime,\n end: endTime,\n status: isOrderTime,\n orderTimeWarning: isOrderTime === false || isOrderTime === true && startTime !== endTime\n };\n if (_settings['QrMenuTableSelection'] && _settings['QrMenuTableSelection'] === 1) {\n var _paramUnions$find;\n var paramUnions = this._urlQueryService.getQueryParamUnion();\n var tableNo = (_paramUnions$find = paramUnions.find(function (x) {\n return x.key === 'tableno';\n })) === null || _paramUnions$find === void 0 ? void 0 : _paramUnions$find.value;\n if (!tableNo || tableNo === '') {\n qrOrderTimes['status'] = false;\n }\n }\n AppStorage.setItem(StorageKey.QR_ORDER_TIMES, qrOrderTimes);\n return qrOrderTimes;\n }\n }]);\n return WorkingHoursService;\n}();\nvar workingHoursService = {\n workingHoursService: function workingHoursService(urlQueryService) {\n return new WorkingHoursService(urlQueryService);\n }\n};\n\nwindow.customer = {};\nvar customerImage = null;\nvar ApiService = function () {\n function ApiService(urlQueryService, http, $translate, dataService) {\n _classCallCheck(this, ApiService);\n this._translate = $translate;\n this._urlQueryService = urlQueryService;\n this._http = http;\n this._dataService = dataService;\n }\n _createClass(ApiService, [{\n key: \"getOnlineOrders\",\n value: function getOnlineOrders(customerID, startDate, endDate) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlineOrderAPI/GetOnlineOrders?customerID=\").concat(customerID, \"&startDate=\").concat(startDate, \"&endDate=\").concat(endDate),\n method: 'GET'\n });\n }\n }, {\n key: \"getOnlineOrderByUUID\",\n value: function getOnlineOrderByUUID(UUID) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlineOrderAPI/GetUUID?UUID=\").concat(UUID),\n method: 'GET'\n });\n }\n }, {\n key: \"getCustomer\",\n value: function getCustomer() {\n var _this = this;\n var customer = null;\n var paramUnions = this._urlQueryService.getQueryParamUnion();\n var customerParams = {};\n var _iterator = _createForOfIteratorHelper(paramUnions),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var p = _step.value;\n if (p.key === 'customerID' || p.key === 'weburl') {\n customerParams = p;\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n var tableNo = lodash.first(paramUnions.filter(function (i) {\n return i.key === 'tableno';\n }).map(function (i) {\n return i.value;\n }));\n if (typeof tableNo !== 'undefined') {\n SessionAppStorage.setItem(StorageKey.TABLE_NO, tableNo);\n }\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/MobileAPI/GetCustomerSummary?\").concat(customerParams.key, \"=\").concat(customerParams.value),\n method: 'GET'\n }).then(function (data) {\n customer = data;\n customerImage = customer.ImageUrl;\n AppStorage.setItem(StorageKey.LATLNG, customer['LatLng']);\n AppStorage.setItem(StorageKey.LANGUAGES, customer['Languages']);\n if (typeof customer['Settings'] === 'string') {\n customer['Settings'] = checkQrSettingsType(JSON.parse(customer['Settings']));\n }\n AppStorage.setItem(StorageKey.SETTINGS, customer['Settings']);\n var languageCode = AppStorage.getItem(StorageKey.LANGUAGE_CODE);\n var languages = AppStorage.getItem(StorageKey.LANGUAGES);\n if (!languageCode) {\n var localLang = (navigator.language || '').toUpperCase();\n if (languages) {\n var _iterator2 = _createForOfIteratorHelper(languages),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _l = _step2.value;\n if (_l['LanguageCode'] === localLang) {\n languageCode = localLang;\n break;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n if (!languageCode) {\n var _iterator3 = _createForOfIteratorHelper(languages),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var l = _step3.value;\n if (l['Dafault']) {\n languageCode = l['LanguageCode'];\n break;\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n if (!languageCode) {\n languageCode = 'TR';\n }\n }\n }\n } else if (languages && languageCode) {\n var langIndex = languages.findIndex(function (x) {\n return x.LanguageCode === languageCode;\n });\n if (langIndex === -1) {\n languageCode = languages.find(function (x) {\n return x.Dafault === true;\n }).LanguageCode;\n if (!languageCode) {\n languageCode = 'TR';\n }\n }\n } else {\n languageCode = 'TR';\n }\n AppStorage.setItem(StorageKey.LANGUAGE_CODE, languageCode);\n _this._translate.use(languageCode);\n if (window.location.hash !== '#!/') {\n $('#loader').css('display', 'flex');\n }\n customer['LanguageCode'] = languageCode;\n _this._dataService._setCustomer(customer);\n window.customer = customer;\n return customer;\n })[\"catch\"](function (error) {\n return console.error(error);\n });\n }\n }, {\n key: \"postOrder\",\n value: function postOrder(order) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlineOrderAPI/Post\"),\n method: 'POST',\n data: JSON.stringify(order)\n });\n }\n }, {\n key: \"putOnlineOrder\",\n value: function putOnlineOrder(order) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlineOrderAPI/Put\"),\n method: 'PUT',\n data: JSON.stringify(order)\n });\n }\n }, {\n key: \"postOnlinePayment3d\",\n value: function postOnlinePayment3d(payment) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlinePaymentAPI/PostIyzicoPaymentForQRMenu\"),\n method: 'POST',\n data: JSON.stringify(payment)\n });\n }\n }, {\n key: \"postOnlinePayment\",\n value: function postOnlinePayment(payment) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlinePaymentAPI/Post\"),\n method: 'POST',\n data: JSON.stringify(payment)\n });\n }\n }, {\n key: \"getMenu\",\n value: function getMenu(languageCode) {\n var _this2 = this;\n var paramUnions = this._urlQueryService.getQueryParamUnion();\n var customerParams = {};\n var _iterator4 = _createForOfIteratorHelper(paramUnions),\n _step4;\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var p = _step4.value;\n if (p.key === 'customerID' || p.key === 'weburl') {\n customerParams = p;\n break;\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/MobileAPI/GetMenu?\").concat(customerParams.key, \"=\").concat(customerParams.value, \"&language=\").concat(languageCode),\n method: 'GET'\n }).then(function (menu) {\n AppStorage.setItem(StorageKey.CURRENCY_ID, menu['CurrencyID']);\n menu.MenuGroup.forEach(function (mg) {\n if (!mg.ImageUrl) {\n mg.ImageUrl = customerImage;\n }\n mg.Products.forEach(function (p) {\n if (!p.ImageUrl) {\n p.ImageUrl = customerImage;\n }\n p.ProductFeatureGroups = p.ProductFeatureGroups.filter(function (pfg) {\n return pfg.Category !== 9;\n });\n var pTags = p.Tags;\n if (pTags && pTags !== '' && typeof pTags === 'string') {\n p.Tags = JSON.parse(pTags);\n }\n });\n });\n _this2._dataService._setMenu(menu);\n return menu;\n })[\"catch\"](function (error) {\n console.error(error);\n });\n }\n }, {\n key: \"postFeedback\",\n value: function postFeedback(feedback) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/FeedbackAPI/Post\"),\n method: 'POST',\n data: JSON.stringify(feedback)\n });\n }\n }, {\n key: \"postGuestCall\",\n value: function postGuestCall(guestCall) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/GuestCallAPI/PostSummary\"),\n method: 'POST',\n data: JSON.stringify(guestCall)\n });\n }\n }, {\n key: \"postOnlinePayment\",\n value: function postOnlinePayment(onlinePayment) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlinePaymentAPI/Post\"),\n method: 'POST',\n data: JSON.stringify(onlinePayment)\n });\n }\n }, {\n key: \"postGuest\",\n value: function postGuest(guest) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/GuestAPI/Post\"),\n method: 'POST',\n data: JSON.stringify(guest)\n });\n }\n }, {\n key: \"getTableByTableNo\",\n value: function getTableByTableNo(customer_id, table_no) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlineOrderAPI/GetTableByTableNo?customerID=\").concat(customer_id, \"&tableNo=\").concat(table_no),\n method: 'GET'\n });\n }\n }, {\n key: \"getOnlinePaymentStatus\",\n value: function getOnlinePaymentStatus(paymentID) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlinePaymentAPI/GetPaymentStatus?paymentID=\").concat(paymentID),\n method: 'GET'\n });\n }\n }, {\n key: \"getQrMenuSettings\",\n value: function getQrMenuSettings(customer_id) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/SettingAPI/GetQrMenuSettings?customerID=\").concat(customer_id),\n method: 'GET'\n });\n }\n }, {\n key: \"getOnlinePaymentSetting\",\n value: function getOnlinePaymentSetting(customer_id) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/SettingAPI/GetOnlinePaymentSettings?customerID=\").concat(customer_id),\n method: 'GET'\n });\n }\n }, {\n key: \"getReservationByNumber\",\n value: function getReservationByNumber(customer_id, number) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/ReservationAPI/GetReservationByNumber?customerID=\").concat(customer_id, \"&number=\").concat(number),\n method: 'GET'\n });\n }\n }, {\n key: \"getTableByNotation\",\n value: function getTableByNotation(customer_id) {\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/OnlineOrderAPI/GetTableByNotation?customerID=\").concat(customer_id),\n method: 'GET'\n });\n }\n }, {\n key: \"getCampaigns\",\n value: function getCampaigns(customer_id) {\n var _this3 = this;\n return this._doRequest({\n url: \"\".concat(API_HOST, \"/api/CampaignAPI/GetCampaigns?customerID=\").concat(customer_id),\n method: 'GET'\n }).then(function (campaign) {\n _this3._dataService._setCampaign(campaign);\n });\n }\n }, {\n key: \"_doRequest\",\n value: function _doRequest(options) {\n var _this4 = this;\n return new Promise(function (resolve, reject) {\n _this4._http(options).then(function (response) {\n resolve(response.data, response);\n }, reject);\n });\n }\n }]);\n return ApiService;\n}();\nvar apiService = {\n apiService: function apiService(urlQueryService, $http, $translate, dataService) {\n return new ApiService(urlQueryService, $http, $translate, dataService);\n }\n};\n\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nvar extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n};\nfunction __extends$3(d, b) {\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nfunction isFunction$1(x) {\n return typeof x === 'function';\n}\n\nvar _enable_super_gross_mode_that_will_cause_bad_things = false;\nvar config = {\n Promise: undefined,\n set useDeprecatedSynchronousErrorHandling(value) {\n if (value) {\n var error = new Error();\n console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \\n' + error.stack);\n } else if (_enable_super_gross_mode_that_will_cause_bad_things) {\n console.log('RxJS: Back to a better error behavior. Thank you. <3');\n }\n _enable_super_gross_mode_that_will_cause_bad_things = value;\n },\n get useDeprecatedSynchronousErrorHandling() {\n return _enable_super_gross_mode_that_will_cause_bad_things;\n }\n};\n\nfunction hostReportError(err) {\n setTimeout(function () {\n throw err;\n }, 0);\n}\n\nvar empty = {\n closed: true,\n next: function (value) {},\n error: function (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n } else {\n hostReportError(err);\n }\n },\n complete: function () {}\n};\n\nvar isArray$1 = function () {\n return Array.isArray || function (x) {\n return x && typeof x.length === 'number';\n };\n}();\n\nfunction isObject$1(x) {\n return x !== null && typeof x === 'object';\n}\n\nvar UnsubscriptionErrorImpl = function () {\n function UnsubscriptionErrorImpl(errors) {\n Error.call(this);\n this.message = errors ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) {\n return i + 1 + \") \" + err.toString();\n }).join('\\n ') : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n }\n UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);\n return UnsubscriptionErrorImpl;\n}();\nvar UnsubscriptionError = UnsubscriptionErrorImpl;\n\nvar Subscription = function () {\n function Subscription(unsubscribe) {\n this.closed = false;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (unsubscribe) {\n this._unsubscribe = unsubscribe;\n }\n }\n Subscription.prototype.unsubscribe = function () {\n var errors;\n if (this.closed) {\n return;\n }\n var _a = this,\n _parentOrParents = _a._parentOrParents,\n _unsubscribe = _a._unsubscribe,\n _subscriptions = _a._subscriptions;\n this.closed = true;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (_parentOrParents instanceof Subscription) {\n _parentOrParents.remove(this);\n } else if (_parentOrParents !== null) {\n for (var index = 0; index < _parentOrParents.length; ++index) {\n var parent_1 = _parentOrParents[index];\n parent_1.remove(this);\n }\n }\n if (isFunction$1(_unsubscribe)) {\n try {\n _unsubscribe.call(this);\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];\n }\n }\n if (isArray$1(_subscriptions)) {\n var index = -1;\n var len = _subscriptions.length;\n while (++index < len) {\n var sub = _subscriptions[index];\n if (isObject$1(sub)) {\n try {\n sub.unsubscribe();\n } catch (e) {\n errors = errors || [];\n if (e instanceof UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(e.errors));\n } else {\n errors.push(e);\n }\n }\n }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n };\n Subscription.prototype.add = function (teardown) {\n var subscription = teardown;\n if (!teardown) {\n return Subscription.EMPTY;\n }\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(teardown);\n case 'object':\n if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {\n return subscription;\n } else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n } else if (!(subscription instanceof Subscription)) {\n var tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default:\n {\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n }\n var _parentOrParents = subscription._parentOrParents;\n if (_parentOrParents === null) {\n subscription._parentOrParents = this;\n } else if (_parentOrParents instanceof Subscription) {\n if (_parentOrParents === this) {\n return subscription;\n }\n subscription._parentOrParents = [_parentOrParents, this];\n } else if (_parentOrParents.indexOf(this) === -1) {\n _parentOrParents.push(this);\n } else {\n return subscription;\n }\n var subscriptions = this._subscriptions;\n if (subscriptions === null) {\n this._subscriptions = [subscription];\n } else {\n subscriptions.push(subscription);\n }\n return subscription;\n };\n Subscription.prototype.remove = function (subscription) {\n var subscriptions = this._subscriptions;\n if (subscriptions) {\n var subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n };\n Subscription.EMPTY = function (empty) {\n empty.closed = true;\n return empty;\n }(new Subscription());\n return Subscription;\n}();\nfunction flattenUnsubscriptionErrors(errors) {\n return errors.reduce(function (errs, err) {\n return errs.concat(err instanceof UnsubscriptionError ? err.errors : err);\n }, []);\n}\n\nvar rxSubscriber = function () {\n return typeof Symbol === 'function' ? Symbol('rxSubscriber') : '@@rxSubscriber_' + Math.random();\n}();\n\nvar Subscriber = function (_super) {\n __extends$3(Subscriber, _super);\n function Subscriber(destinationOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this.syncErrorValue = null;\n _this.syncErrorThrown = false;\n _this.syncErrorThrowable = false;\n _this.isStopped = false;\n switch (arguments.length) {\n case 0:\n _this.destination = empty;\n break;\n case 1:\n if (!destinationOrNext) {\n _this.destination = empty;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n _this.destination = destinationOrNext;\n destinationOrNext.add(_this);\n } else {\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext);\n }\n break;\n }\n default:\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);\n break;\n }\n return _this;\n }\n Subscriber.prototype[rxSubscriber] = function () {\n return this;\n };\n Subscriber.create = function (next, error, complete) {\n var subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n };\n Subscriber.prototype.next = function (value) {\n if (!this.isStopped) {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n this.destination.error(err);\n this.unsubscribe();\n };\n Subscriber.prototype._complete = function () {\n this.destination.complete();\n this.unsubscribe();\n };\n Subscriber.prototype._unsubscribeAndRecycle = function () {\n var _parentOrParents = this._parentOrParents;\n this._parentOrParents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parentOrParents = _parentOrParents;\n return this;\n };\n return Subscriber;\n}(Subscription);\nvar SafeSubscriber = function (_super) {\n __extends$3(SafeSubscriber, _super);\n function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this._parentSubscriber = _parentSubscriber;\n var next;\n var context = _this;\n if (isFunction$1(observerOrNext)) {\n next = observerOrNext;\n } else if (observerOrNext) {\n next = observerOrNext.next;\n error = observerOrNext.error;\n complete = observerOrNext.complete;\n if (observerOrNext !== empty) {\n context = Object.create(observerOrNext);\n if (isFunction$1(context.unsubscribe)) {\n _this.add(context.unsubscribe.bind(context));\n }\n context.unsubscribe = _this.unsubscribe.bind(_this);\n }\n }\n _this._context = context;\n _this._next = next;\n _this._error = error;\n _this._complete = complete;\n return _this;\n }\n SafeSubscriber.prototype.next = function (value) {\n if (!this.isStopped && this._next) {\n var _parentSubscriber = this._parentSubscriber;\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;\n if (this._error) {\n if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n } else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n } else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n if (useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n hostReportError(err);\n } else {\n if (useDeprecatedSynchronousErrorHandling) {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n } else {\n hostReportError(err);\n }\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.complete = function () {\n var _this = this;\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._complete) {\n var wrappedComplete = function () {\n return _this._complete.call(_this._context);\n };\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n } else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n } else {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n try {\n fn.call(this._context, value);\n } catch (err) {\n this.unsubscribe();\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n } else {\n hostReportError(err);\n }\n }\n };\n SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n if (!config.useDeprecatedSynchronousErrorHandling) {\n throw new Error('bad call');\n }\n try {\n fn.call(this._context, value);\n } catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n } else {\n hostReportError(err);\n return true;\n }\n }\n return false;\n };\n SafeSubscriber.prototype._unsubscribe = function () {\n var _parentSubscriber = this._parentSubscriber;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n };\n return SafeSubscriber;\n}(Subscriber);\n\nfunction canReportError(observer) {\n while (observer) {\n var _a = observer,\n closed_1 = _a.closed,\n destination = _a.destination,\n isStopped = _a.isStopped;\n if (closed_1 || isStopped) {\n return false;\n } else if (destination && destination instanceof Subscriber) {\n observer = destination;\n } else {\n observer = null;\n }\n }\n return true;\n}\n\nfunction toSubscriber(nextOrObserver, error, complete) {\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber) {\n return nextOrObserver;\n }\n if (nextOrObserver[rxSubscriber]) {\n return nextOrObserver[rxSubscriber]();\n }\n }\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber(empty);\n }\n return new Subscriber(nextOrObserver, error, complete);\n}\n\nvar observable = function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n}();\n\nfunction identity$1(x) {\n return x;\n}\n\nfunction pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity$1;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) {\n return fn(prev);\n }, input);\n };\n}\n\nvar Observable = function () {\n function Observable(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var operator = this.operator;\n var sink = toSubscriber(observerOrNext, error, complete);\n if (operator) {\n sink.add(operator.call(sink, this.source));\n } else {\n sink.add(this.source || config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));\n }\n if (config.useDeprecatedSynchronousErrorHandling) {\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n }\n return sink;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n } catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n }\n if (canReportError(sink)) {\n sink.error(err);\n } else {\n console.warn(err);\n }\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscription;\n subscription = _this.subscribe(function (value) {\n try {\n next(value);\n } catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var source = this.source;\n return source && source.subscribe(subscriber);\n };\n Observable.prototype[observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n if (operations.length === 0) {\n return this;\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) {\n return value = x;\n }, function (err) {\n return reject(err);\n }, function () {\n return resolve(value);\n });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}();\nfunction getPromiseCtor(promiseCtor) {\n if (!promiseCtor) {\n promiseCtor = Promise;\n }\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n return promiseCtor;\n}\n\nvar ObjectUnsubscribedErrorImpl = function () {\n function ObjectUnsubscribedErrorImpl() {\n Error.call(this);\n this.message = 'object unsubscribed';\n this.name = 'ObjectUnsubscribedError';\n return this;\n }\n ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype);\n return ObjectUnsubscribedErrorImpl;\n}();\nvar ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;\n\nvar SubjectSubscription = function (_super) {\n __extends$3(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n var _this = _super.call(this) || this;\n _this.subject = subject;\n _this.subscriber = subscriber;\n _this.closed = false;\n return _this;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription);\n\nvar SubjectSubscriber = function (_super) {\n __extends$3(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n return _this;\n }\n return SubjectSubscriber;\n}(Subscriber);\nvar Subject = function (_super) {\n __extends$3(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.observers = [];\n _this.closed = false;\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype[rxSubscriber] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n } else if (this.isStopped) {\n subscriber.complete();\n return Subscription.EMPTY;\n } else {\n this.observers.push(subscriber);\n return new SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable);\nvar AnonymousSubject = function (_super) {\n __extends$3(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n } else {\n return Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject);\n\nvar Action = function (_super) {\n __extends$3(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n return this;\n };\n return Action;\n}(Subscription);\n\nvar AsyncAction = function (_super) {\n __extends$3(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n clearInterval(id);\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, delay) {\n var errored = false;\n var errorValue = undefined;\n try {\n this.work(state);\n } catch (e) {\n errored = true;\n errorValue = !!e && e || new Error(e);\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype._unsubscribe = function () {\n var id = this.id;\n var scheduler = this.scheduler;\n var actions = scheduler.actions;\n var index = actions.indexOf(this);\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n if (index !== -1) {\n actions.splice(index, 1);\n }\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n };\n return AsyncAction;\n}(Action);\n\nvar QueueAction = function (_super) {\n __extends$3(QueueAction, _super);\n function QueueAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n QueueAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay > 0) {\n return _super.prototype.schedule.call(this, state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n };\n QueueAction.prototype.execute = function (state, delay) {\n return delay > 0 || this.closed ? _super.prototype.execute.call(this, state, delay) : this._execute(state, delay);\n };\n QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && delay > 0 || delay === null && this.delay > 0) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n return scheduler.flush(this);\n };\n return QueueAction;\n}(AsyncAction);\n\nvar Scheduler = function () {\n function Scheduler(SchedulerAction, now) {\n if (now === void 0) {\n now = Scheduler.now;\n }\n this.SchedulerAction = SchedulerAction;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) {\n delay = 0;\n }\n return new this.SchedulerAction(this, work).schedule(state, delay);\n };\n Scheduler.now = function () {\n return Date.now();\n };\n return Scheduler;\n}();\n\nvar AsyncScheduler = function (_super) {\n __extends$3(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) {\n now = Scheduler.now;\n }\n var _this = _super.call(this, SchedulerAction, function () {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {\n return AsyncScheduler.delegate.now();\n } else {\n return now();\n }\n }) || this;\n _this.actions = [];\n _this.active = false;\n _this.scheduled = undefined;\n return _this;\n }\n AsyncScheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) {\n delay = 0;\n }\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.schedule(work, delay, state);\n } else {\n return _super.prototype.schedule.call(this, work, delay, state);\n }\n };\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this.active) {\n actions.push(action);\n return;\n }\n var error;\n this.active = true;\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift());\n this.active = false;\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler);\n\nvar QueueScheduler = function (_super) {\n __extends$3(QueueScheduler, _super);\n function QueueScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return QueueScheduler;\n}(AsyncScheduler);\n\nvar queue = new QueueScheduler(QueueAction);\n\nvar EMPTY = new Observable(function (subscriber) {\n return subscriber.complete();\n});\nfunction empty$1(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) {\n return scheduler.schedule(function () {\n return subscriber.complete();\n });\n });\n}\n\nfunction isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\n\nvar subscribeToArray = function (array) {\n return function (subscriber) {\n for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n };\n};\n\nfunction scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n var i = 0;\n sub.add(scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n return;\n }\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n sub.add(this.schedule());\n }\n }));\n return sub;\n });\n}\n\nfunction fromArray(input, scheduler) {\n if (!scheduler) {\n return new Observable(subscribeToArray(input));\n } else {\n return scheduleArray(input, scheduler);\n }\n}\n\nfunction of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = args[args.length - 1];\n if (isScheduler(scheduler)) {\n args.pop();\n return scheduleArray(args, scheduler);\n } else {\n return fromArray(args);\n }\n}\n\nfunction throwError(error, scheduler) {\n if (!scheduler) {\n return new Observable(function (subscriber) {\n return subscriber.error(error);\n });\n } else {\n return new Observable(function (subscriber) {\n return scheduler.schedule(dispatch, 0, {\n error: error,\n subscriber: subscriber\n });\n });\n }\n}\nfunction dispatch(_a) {\n var error = _a.error,\n subscriber = _a.subscriber;\n subscriber.error(error);\n}\n\nvar NotificationKind;\n(function (NotificationKind) {\n NotificationKind[\"NEXT\"] = \"N\";\n NotificationKind[\"ERROR\"] = \"E\";\n NotificationKind[\"COMPLETE\"] = \"C\";\n})(NotificationKind || (NotificationKind = {}));\nvar Notification = function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n } else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return of(this.value);\n case 'E':\n return throwError(this.error);\n case 'C':\n return empty$1();\n }\n throw new Error('unexpected notification kind value');\n };\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}();\n\nvar ObserveOnSubscriber = function (_super) {\n __extends$3(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n var _this = _super.call(this, destination) || this;\n _this.scheduler = scheduler;\n _this.delay = delay;\n return _this;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification,\n destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n var destination = this.destination;\n destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification.createError(err));\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification.createComplete());\n this.unsubscribe();\n };\n return ObserveOnSubscriber;\n}(Subscriber);\nvar ObserveOnMessage = function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}();\n\nvar ReplaySubject = function (_super) {\n __extends$3(ReplaySubject, _super);\n function ReplaySubject(bufferSize, windowTime, scheduler) {\n if (bufferSize === void 0) {\n bufferSize = Number.POSITIVE_INFINITY;\n }\n if (windowTime === void 0) {\n windowTime = Number.POSITIVE_INFINITY;\n }\n var _this = _super.call(this) || this;\n _this.scheduler = scheduler;\n _this._events = [];\n _this._infiniteTimeWindow = false;\n _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;\n _this._windowTime = windowTime < 1 ? 1 : windowTime;\n if (windowTime === Number.POSITIVE_INFINITY) {\n _this._infiniteTimeWindow = true;\n _this.next = _this.nextInfiniteTimeWindow;\n } else {\n _this.next = _this.nextTimeWindow;\n }\n return _this;\n }\n ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {\n var _events = this._events;\n _events.push(value);\n if (_events.length > this._bufferSize) {\n _events.shift();\n }\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype.nextTimeWindow = function (value) {\n this._events.push(new ReplayEvent(this._getNow(), value));\n this._trimBufferThenGetEvents();\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n var _infiniteTimeWindow = this._infiniteTimeWindow;\n var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();\n var scheduler = this.scheduler;\n var len = _events.length;\n var subscription;\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else if (this.isStopped || this.hasError) {\n subscription = Subscription.EMPTY;\n } else {\n this.observers.push(subscriber);\n subscription = new SubjectSubscription(this, subscriber);\n }\n if (scheduler) {\n subscriber.add(subscriber = new ObserveOnSubscriber(subscriber, scheduler));\n }\n if (_infiniteTimeWindow) {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i]);\n }\n } else {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i].value);\n }\n }\n if (this.hasError) {\n subscriber.error(this.thrownError);\n } else if (this.isStopped) {\n subscriber.complete();\n }\n return subscription;\n };\n ReplaySubject.prototype._getNow = function () {\n return (this.scheduler || queue).now();\n };\n ReplaySubject.prototype._trimBufferThenGetEvents = function () {\n var now = this._getNow();\n var _bufferSize = this._bufferSize;\n var _windowTime = this._windowTime;\n var _events = this._events;\n var eventsCount = _events.length;\n var spliceCount = 0;\n while (spliceCount < eventsCount) {\n if (now - _events[spliceCount].time < _windowTime) {\n break;\n }\n spliceCount++;\n }\n if (eventsCount > _bufferSize) {\n spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);\n }\n if (spliceCount > 0) {\n _events.splice(0, spliceCount);\n }\n return _events;\n };\n return ReplaySubject;\n}(Subject);\nvar ReplayEvent = function () {\n function ReplayEvent(time, value) {\n this.time = time;\n this.value = value;\n }\n return ReplayEvent;\n}();\n\nvar customer = {};\nvar menu = {};\nvar campaign = {};\nvar isMenuReady = true;\nvar customerSubject = new Subject();\nvar menuSubject = new Subject();\nvar campaignSubject = new Subject();\nvar isMenuReadySubject = new Subject();\nvar DataService = function () {\n function DataService() {\n _classCallCheck(this, DataService);\n }\n _createClass(DataService, [{\n key: \"_setCustomer\",\n value: function _setCustomer(customerData) {\n customer = customerData;\n customerSubject.next(customer);\n }\n }, {\n key: \"_setMenu\",\n value: function _setMenu(menuData) {\n menu = menuData;\n menuSubject.next(menu);\n }\n }, {\n key: \"_setCampaign\",\n value: function _setCampaign(campaignData) {\n campaign = campaignData;\n campaignSubject.next(campaign);\n }\n }, {\n key: \"_setIsMenu\",\n value: function _setIsMenu(value) {\n isMenuReady = value;\n isMenuReadySubject.next(value);\n }\n }, {\n key: \"_getCustomer\",\n value: function _getCustomer() {\n return customer;\n }\n }, {\n key: \"_getMenu\",\n value: function _getMenu() {\n return menu;\n }\n }, {\n key: \"_getIsMenuReady\",\n value: function _getIsMenuReady() {\n return isMenuReady;\n }\n }, {\n key: \"_customerObservable\",\n value: function _customerObservable() {\n return customerSubject.asObservable();\n }\n }, {\n key: \"_menuObservable\",\n value: function _menuObservable() {\n return menuSubject.asObservable();\n }\n }, {\n key: \"_campaignObservable\",\n value: function _campaignObservable() {\n return campaignSubject.asObservable();\n }\n }, {\n key: \"_isMenuReadyObservable\",\n value: function _isMenuReadyObservable() {\n return isMenuReadySubject.asObservable();\n }\n }]);\n return DataService;\n}();\nvar dataService = {\n dataService: function dataService() {\n return new DataService();\n }\n};\n\nvar OrderItem = function OrderItem(Cancelled, Closed, Comment, CustomerID, Deleted, Description, FeaturePrice, FeatureValue, Gifted, Group, GuestID, ImageUrl, Integrated, Name, OnlineOrderID, OnlineOrderItemID, OrderID, OrderItemFeatures, OrderItemID, OrderTime, Price, ProductID, Quantity, Returned, SessionID, SessionLID, Status, TableID, Tax, TaxPrice, TotalPrice, Type) {\n _classCallCheck(this, OrderItem);\n this.Cancelled = Cancelled;\n this.Closed = Closed;\n this.Comment = Comment;\n this.CustomerID = CustomerID;\n this.Deleted = Deleted;\n this.Description = Description;\n this.FeaturePrice = FeaturePrice != null ? FeaturePrice : 0;\n this.FeatureValue = FeatureValue != null ? FeatureValue : 1;\n this.Gifted = Gifted;\n this.Group = Group;\n this.GuestID = GuestID;\n this.ImageUrl = ImageUrl;\n this.Integrated = Integrated;\n this.Name = Name;\n this.OnlineOrderID = OnlineOrderID;\n this.OnlineOrderItemID = OnlineOrderItemID;\n this.OrderID = OrderID;\n this.OrderItemFeatures = OrderItemFeatures != null ? OrderItemFeatures : [];\n this.OrderItemID = OrderItemID;\n this.OrderTime = OrderTime;\n this.Price = Price != null ? Price : 0;\n this.ProductID = ProductID;\n this.Quantity = Quantity != null ? Quantity : 1;\n this.Returned = Returned;\n this.SessionID = SessionID;\n this.SessionLID = SessionLID;\n this.Status = Status;\n this.TableID = TableID;\n this.Tax = Tax;\n this.TaxPrice = TaxPrice;\n this.TotalPrice = TotalPrice != null ? TotalPrice : Price != null ? Price : 0;\n this.Type = Type;\n this.UnitPrice = Price;\n};\n\nvar Order = function Order(AccountID, AccountName, AppType, Cancelled, Closed, ClosedTime, CustomerID, Deleted, Description, DeviceID, Discount, GuestID, GuestImage, GuestName, ImageUrl, MenuID, Name, OnlineOrderID, OrderID, OrderItems, OrderTime, OrderType, Paid, PaymentType, Price, Rating, Service, Source, StaffID, Status, Text, TableID, TableName, TaxPrice, TotalPrice, Type, UniqueID) {\n _classCallCheck(this, Order);\n this.AccountID = AccountID;\n this.AccountName = AccountName;\n this.AppType = AppType;\n this.Cancelled = Cancelled;\n this.Closed = Closed;\n this.ClosedTime = ClosedTime;\n this.CustomerID = CustomerID;\n this.Deleted = Deleted;\n this.Description = Description;\n this.DeviceID = DeviceID;\n this.Discount = Discount;\n this.GuestID = GuestID;\n this.GuestImage = GuestImage;\n this.GuestName = GuestName;\n this.ImageUrl = ImageUrl;\n this.MenuID = MenuID;\n this.Name = Name;\n this.OnlineOrderID = OnlineOrderID;\n this.OrderID = OrderID;\n this.OrderItems = OrderItems != null ? OrderItems : [];\n this.OrderTime = OrderTime;\n this.OrderType = OrderType;\n this.Paid = Paid;\n this.PaymentType = PaymentType;\n this.Price = Price != null ? Price : 0;\n this.Rating = Rating;\n this.Service = Service != null ? Service : 0;\n this.Source = Source;\n this.StaffID = StaffID;\n this.Status = Status;\n this.TableID = TableID;\n this.Text = Text;\n this.TableName = TableName;\n this.TaxPrice = TaxPrice != null ? TaxPrice : 0;\n this.TotalPrice = TotalPrice != null ? TotalPrice : Price != null ? Price : 0;\n this.Type = Type;\n this.UniqueID = UniqueID;\n};\n\nvar Cart = function () {\n function Cart() {\n _classCallCheck(this, Cart);\n this._watchListeners = [];\n this._cartDeleteButtonClickListener = null;\n this._cart = [];\n this._currency = \"\";\n this._discount = 0;\n this._usedPoints = 0;\n this._totalQuantity = 0;\n this._cartTotal = 0;\n this._servicePrice = 0;\n this._menuID = -1;\n var __cart = AppStorage.getItem(StorageKey.CART);\n if (__cart != null) {\n var _iterator = _createForOfIteratorHelper(__cart),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var orderItem = _step.value;\n this.cart.push(orderItem);\n this._totalQuantity += orderItem.Quantity;\n this._cartTotal += orderItem.TotalPrice;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n if (this._cart.length > 0) {\n var tempItem = lodash.head(this._cart);\n this._menuID = tempItem.MenuID;\n this._currency = tempItem.Currency;\n }\n }\n }\n _createClass(Cart, [{\n key: \"_triggerWatchListeners\",\n value: function _triggerWatchListeners() {\n var _iterator2 = _createForOfIteratorHelper(this._watchListeners),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var listener = _step2.value;\n listener();\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n }, {\n key: \"_findItems\",\n value: function _findItems(orderItem) {\n var id = orderItem.OrderID || orderItem.ProductID;\n if (id == null) {\n return [];\n }\n return this._cart.filter(function (item) {\n var itemId = item.OrderID || item.ProductID;\n if (itemId == null) {\n return false;\n }\n return itemId === id;\n });\n }\n }, {\n key: \"_findSameOrderItem\",\n value: function _findSameOrderItem(orderItem) {\n var foundItems = this._findItems(orderItem);\n if (foundItems.length <= 0) {\n return null;\n }\n var _iterator3 = _createForOfIteratorHelper(foundItems),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var item = _step3.value;\n if (this._areFeaturesEqual(orderItem, item)) {\n return item;\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }, {\n key: \"_updateCart\",\n value: function _updateCart() {\n var that = this;\n this._totalQuantity = 0;\n this._cartTotal = 0;\n angular.forEach(this._cart, function (cartItem) {\n that._totalQuantity += cartItem.Quantity / cartItem.FeatureValue;\n that._cartTotal += cartItem.TotalPrice;\n });\n AppStorage.setItem(StorageKey.CART, this._cart);\n return true;\n }\n }, {\n key: \"_commitChanges\",\n value: function _commitChanges(orderItem) {\n orderItem.Price = orderItem.UnitPrice;\n orderItem.TotalPrice = orderItem.UnitPrice;\n orderItem.FeaturePrice = 0;\n if (!lodash.isEmpty(orderItem.OrderItemFeatures)) {\n this._setFeaturePrices(orderItem);\n } else {\n orderItem.Price *= orderItem.Quantity;\n orderItem.TotalPrice *= orderItem.Quantity;\n }\n orderItem.TaxPrice = Math.round(orderItem.TotalPrice * 100 * (1 - 100 / (100 + orderItem.Tax))) / 100;\n this._triggerWatchListeners();\n }\n }, {\n key: \"_setFeaturePrices\",\n value: function _setFeaturePrices(orderItem) {\n var countableMultiplier = 1;\n var uncountableTotal = 0;\n orderItem.OrderItemFeatures.map(function (feature) {\n if (feature.Countable) {\n countableMultiplier *= feature.Value;\n } else {\n uncountableTotal += feature.Price;\n }\n });\n orderItem.Quantity = orderItem.Quantity * countableMultiplier;\n orderItem.FeaturePrice = uncountableTotal * orderItem.Quantity;\n orderItem.FeatureValue = countableMultiplier;\n orderItem.Price = orderItem.UnitPrice * orderItem.Quantity;\n orderItem.TotalPrice = orderItem.Price + orderItem.FeaturePrice;\n }\n }, {\n key: \"add\",\n value: function add(orderItem) {\n var _orderItem$Currency;\n if (this._cart.length === 0) {\n this._menuID = orderItem.MenuID;\n }\n if (this._menuID === -1 || this._menuID === null) return false;\n this._currency = (_orderItem$Currency = orderItem.Currency) !== null && _orderItem$Currency !== void 0 ? _orderItem$Currency : \"\";\n var foundItem = this._findSameOrderItem(orderItem);\n if (foundItem) {\n var multiplier = 1;\n if (orderItem.FeatureValue && orderItem.FeatureValue > 0) {\n multiplier = orderItem.FeatureValue;\n }\n foundItem.Quantity += orderItem.Quantity * multiplier;\n var reservation = AppStorage.getItem(StorageKey.RESERVATION);\n if (!reservation) {\n if (orderItem.FeaturePrice && orderItem.FeaturePrice > 0) {\n foundItem.FeaturePrice = orderItem.FeaturePrice * foundItem.Quantity;\n }\n foundItem.Price = orderItem.UnitPrice * foundItem.Quantity;\n foundItem.TotalPrice = foundItem.FeaturePrice + foundItem.Price;\n }\n this._triggerWatchListeners();\n } else {\n this._cart.push(orderItem);\n this._commitChanges(orderItem);\n }\n return this._updateCart();\n }\n }, {\n key: \"getOrder\",\n value: function getOrder() {\n var cart = this._cart;\n if (cart.length <= 0) {\n return null;\n }\n var order = new Order();\n var orderItems = _toConsumableArray(cart);\n var _iterator4 = _createForOfIteratorHelper(orderItems),\n _step4;\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var orderItem = _step4.value;\n this._removeCountableFeatures(orderItem);\n order.OrderItems.push(orderItem);\n order.TaxPrice += orderItem.TaxPrice;\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n order.MenuID = this._menuID;\n order.OrderItems.map(function (orderItem) {\n delete orderItem['ProductFeatureGroup'];\n });\n return order;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this._cart = [];\n this._updateCart();\n this._discount = 0;\n this._usedPoints = 0;\n this._servicePrice = 0;\n this._triggerWatchListeners();\n }\n }, {\n key: \"increment\",\n value: function increment(orderItem) {\n if (orderItem.FeatureValue && orderItem.FeatureValue > 0) {\n orderItem.Quantity /= orderItem.FeatureValue;\n }\n orderItem.Quantity += 1;\n this._commitChanges(orderItem);\n this._updateCart();\n }\n }, {\n key: \"decrement\",\n value: function decrement(orderItem) {\n var featureValue = orderItem.FeatureValue;\n if (featureValue && featureValue > 0) {\n orderItem.Quantity /= featureValue;\n }\n orderItem.Quantity -= 1;\n if (orderItem.Quantity === 0) {\n this.drop(orderItem);\n return;\n }\n this._commitChanges(orderItem);\n this._updateCart();\n }\n }, {\n key: \"drop\",\n value: function drop(item) {\n var orderItem = this._findSameOrderItem(item);\n lodash.pull(this._cart, orderItem);\n this._updateCart();\n this._triggerWatchListeners();\n }\n }, {\n key: \"watch\",\n value: function watch(listener) {\n if (!lodash.isFunction(listener)) {\n throw new Error(\"CartService: given argument is not a function\");\n }\n var listeners = this._watchListeners;\n this._watchListeners.push(listener);\n return function () {\n listeners.splice(listeners.indexOf(listener, 1));\n };\n }\n }, {\n key: \"createOrderItem\",\n value: function createOrderItem(product) {\n var orderItem = Object.assign(new OrderItem(), product);\n orderItem.UnitPrice = orderItem.Price;\n return orderItem;\n }\n }, {\n key: \"_areFeaturesEqual\",\n value: function _areFeaturesEqual(orderItem1, orderItem2) {\n var features1 = orderItem1.OrderItemFeatures || [];\n var features2 = orderItem2.OrderItemFeatures || [];\n var length1 = features1.length;\n var length2 = features2.length;\n if (length1 === 0 && length2 === 0) {\n return true;\n }\n if (length1 === length2) {\n var featureIds1 = features1.map(function (feature) {\n return feature.FeatureID;\n }).sort();\n var featureIds2 = features2.map(function (feature) {\n return feature.FeatureID;\n }).sort();\n if (lodash.isEqual(featureIds1, featureIds2)) {\n return true;\n }\n }\n return false;\n }\n }, {\n key: \"_removeCountableFeatures\",\n value: function _removeCountableFeatures(orderItem) {\n lodash.pullAll(orderItem.OrderItemFeatures, orderItem.OrderItemFeatures.filter(function (feature) {\n return feature.Countable;\n }));\n }\n }, {\n key: \"cart\",\n get: function get() {\n return this._cart;\n }\n }, {\n key: \"currency\",\n get: function get() {\n return this._currency;\n }\n }, {\n key: \"deleteButtonClickHandler\",\n get: function get() {\n return this._cartDeleteButtonClickListener;\n },\n set: function set(callback) {\n this._cartDeleteButtonClickListener = callback;\n }\n }, {\n key: \"totalPrice\",\n get: function get() {\n return this.price - this.totalDiscount;\n }\n }, {\n key: \"price\",\n get: function get() {\n return this._cartTotal + this._servicePrice;\n }\n }, {\n key: \"cartTotal\",\n get: function get() {\n return this._cartTotal;\n }\n }, {\n key: \"servicePrice\",\n set: function set(value) {\n this._servicePrice = value;\n },\n get: function get() {\n return this._servicePrice;\n }\n }, {\n key: \"discount\",\n set: function set(value) {\n this._discount = value;\n },\n get: function get() {\n return this._discount;\n }\n }, {\n key: \"usedPoints\",\n set: function set(value) {\n this._usedPoints = value;\n },\n get: function get() {\n return this._usedPoints;\n }\n }, {\n key: \"totalDiscount\",\n get: function get() {\n return this.usedPoints + this.discount;\n }\n }]);\n return Cart;\n}();\nvar cartService = {\n cartService: function cartService() {\n return new Cart();\n }\n};\n\nvar OrderApi = function () {\n function OrderApi(cartService, apiService, workingHoursService) {\n _classCallCheck(this, OrderApi);\n this._cartService = cartService;\n this._order = undefined;\n this._apiService = apiService;\n this._workingHoursService = workingHoursService;\n }\n _createClass(OrderApi, [{\n key: \"_createOrder\",\n value: function _createOrder(options) {\n var _options$status, _options$paymentType;\n var orderMode = AppStorage.getItem(StorageKey.SETTINGS).QrMenuOrderMode;\n var reservation = AppStorage.getItem(StorageKey.RESERVATION);\n return Object.assign(this._cartService.getOrder(), {\n AccountID: orderMode === 4 && reservation ? reservation.AccountID : window.customer.AccountID,\n CustomerID: window.customer.CustomerID,\n TableID: options.tableId,\n Status: (_options$status = options.status) !== null && _options$status !== void 0 ? _options$status : 0,\n Service: 0,\n Points: this._cartService.usedPoints,\n Discount: this._cartService.totalDiscount,\n DeliveryType: 0,\n Type: 1,\n AppType: 3,\n OrderType: 0,\n Price: this._cartService.price,\n Paid: false,\n TotalPrice: this._cartService.totalPrice,\n PaymentType: (_options$paymentType = options.paymentType) !== null && _options$paymentType !== void 0 ? _options$paymentType : 0,\n Description: '',\n Source: 'QRMENU'\n });\n }\n }, {\n key: \"_onOrderSent\",\n value: function _onOrderSent() {\n this._cartService.clear();\n }\n }, {\n key: \"setOrder\",\n value: function setOrder(options) {\n var _this = this;\n return new Promise(function (resolve) {\n _this._order = _this._createOrder(options);\n resolve();\n });\n }\n }, {\n key: \"postOrder\",\n value: function postOrder() {\n var _this2 = this;\n return new Promise(function (resolve, reject) {\n _this2._apiService.postOrder(_this2._order).then(function (value) {\n resolve(value);\n var onlinePayment = AppStorage.getItem(StorageKey.SETTINGS).QrMenuOnlinePayment;\n if (onlinePayment !== 1) {\n _this2._onOrderSent(value);\n }\n })[\"catch\"](function (e) {\n reject(e);\n });\n });\n }\n }, {\n key: \"sendTableOrder\",\n value: function sendTableOrder(table) {\n var _this$_workingHoursSe,\n _this$_workingHoursSe2,\n _this3 = this;\n if (!table) {\n $('#loader').css('display', 'none');\n }\n var isOrderTime = (_this$_workingHoursSe = (_this$_workingHoursSe2 = this._workingHoursService.getWorkingHours()) === null || _this$_workingHoursSe2 === void 0 ? void 0 : _this$_workingHoursSe2.status) !== null && _this$_workingHoursSe !== void 0 ? _this$_workingHoursSe : false;\n if (isOrderTime) {\n var onlinePayment = AppStorage.getItem(StorageKey.SETTINGS).QrMenuOnlinePayment;\n return this.setOrder({\n tableId: table.TableID,\n status: onlinePayment === 1 ? -2 : 0,\n paymentType: onlinePayment === 1 ? 71 : 0\n }).then(function () {\n return _this3.postOrder();\n });\n }\n return null;\n }\n }, {\n key: \"sendTableOrderByTableNo\",\n value: function sendTableOrderByTableNo(tableNo) {\n var _this4 = this;\n $('#loader').css('display', 'flex');\n return this._apiService.getTableByTableNo(window.customer.CustomerID, tableNo).then(function (res) {\n return _this4.sendTableOrder(res);\n });\n }\n }, {\n key: \"getTableIdByNotation\",\n value: function getTableIdByNotation() {\n var _this5 = this;\n return this._apiService.getTableByNotation(window.customer.CustomerID).then(function (res) {\n return _this5.sendTableOrder(res);\n });\n }\n }]);\n return OrderApi;\n}();\nvar orderApiService = {\n orderApiService: function orderApiService(cartService, apiService, workingHoursService) {\n return new OrderApi(cartService, apiService, workingHoursService);\n }\n};\n\nvar OrderItemFeature = function OrderItemFeature(CustomerID, Deleted, Description, Name, OnlineOrderID, OnlineOrderItemFeatureID, OnlineOrderItemID, Price, ProductFeatureID, Quantity, Status) {\n _classCallCheck(this, OrderItemFeature);\n this.CustomerID = CustomerID;\n this.Deleted = Deleted;\n this.Description = Description;\n this.Name = Name;\n this.OnlineOrderID = OnlineOrderID;\n this.OnlineOrderItemFeatureID = OnlineOrderItemFeatureID;\n this.OnlineOrderItemID = OnlineOrderItemID;\n this.Price = Price;\n this.ProductFeatureID = ProductFeatureID;\n this.Quantity = Quantity;\n this.Status = Status;\n};\n\nvar ProductFeatureService = function () {\n function ProductFeatureService(rootScope, timeout, cartService) {\n _classCallCheck(this, ProductFeatureService);\n var self = this;\n this._rootScope = rootScope;\n this._timeout = timeout;\n this._cartService = cartService;\n $('body').on('change', '.product-feature', document.productFeatureChangeListener = function () {\n self._updateOrderItem(self);\n });\n }\n _createClass(ProductFeatureService, [{\n key: \"addToCart\",\n value: function addToCart(scope, product) {\n var orderMode = AppStorage.getItem(StorageKey.SETTINGS)['QrMenuOrderMode'];\n var showOptions = AppStorage.getItem(StorageKey.SETTINGS)['QrMenuShowOptions'];\n if (!lodash.isEmpty(product.ProductFeatureGroups) && showOptions !== 0) {\n this._showFeatureModal(scope, product).then(function () {});\n return null;\n }\n var orderItem = this._cartService.createOrderItem(product);\n if (orderMode === 4) {\n return null;\n }\n return this._cartService.add(orderItem);\n }\n }, {\n key: \"_showFeatureModal\",\n value: function _showFeatureModal(scope, product) {\n var _this = this;\n this._product = scope._product = product;\n this._quantities = scope.quantities = {};\n var _iterator = _createForOfIteratorHelper(product.ProductFeatureGroups),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var fg = _step.value;\n var _iterator2 = _createForOfIteratorHelper(fg.ProductFeature),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var f = _step2.value;\n scope.quantities[f.ProductFeatureID] = {\n code: f.Code,\n type: fg.Type,\n price: f.Price,\n quantity: 0,\n featureGroupId: fg.ProductFeatureGroupID\n };\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n this._orderItem = scope._orderItem = this._cartService.createOrderItem(product);\n this._orderItem.OrderItemFeatures = _toConsumableArray(this._getDefaultFeatures());\n this._setFeatureChunk(product);\n scope._onClickIncreaseQuantity = function () {\n var quantity = _this._orderItem.Quantity;\n if (quantity === 99) {\n return;\n }\n _this._orderItem.Quantity = ++quantity;\n _this._updateOrderItem();\n };\n scope._onClickDecreaseQuantity = function () {\n var quantity = _this._orderItem.Quantity;\n if (quantity === 1) {\n return;\n }\n _this._orderItem.Quantity = --quantity;\n _this._updateOrderItem();\n };\n scope._onClickDecreaseFeature = function (productFeatureID) {\n if (scope.quantities[productFeatureID].quantity === 0) {\n return;\n }\n scope.quantities[productFeatureID].quantity--;\n _this._updateOrderItem();\n };\n scope._onClickIncreaseFeature = function (productFeatureID, productFeatureGroupID) {\n var selectedFeatureGroupItems = Object.values(scope.quantities).filter(function (x) {\n return x.featureGroupId === productFeatureGroupID;\n });\n var maxChoice = product.ProductFeatureGroups.find(function (x) {\n return x.ProductFeatureGroupID === productFeatureGroupID;\n }).Quantity;\n var numberOfChoices = 0;\n selectedFeatureGroupItems.map(function (item) {\n numberOfChoices += item.quantity;\n });\n if (numberOfChoices >= maxChoice) {\n return;\n }\n scope.quantities[productFeatureID].quantity++;\n _this._updateOrderItem();\n };\n scope._onRadioInputChanged = function (productFeatureID) {\n var fgid = scope.quantities[productFeatureID].featureGroupId;\n Object.keys(scope.quantities).map(function (key) {\n if (scope.quantities[key].featureGroupId === fgid && +key !== productFeatureID) {\n scope.quantities[key].quantity = 0;\n }\n });\n };\n scope._onClickAddToCart = function () {\n var translations = _this._rootScope.translations;\n var fqErr = _this._checkFeaturesQuantity();\n if (fqErr && fqErr.Type !== -1) {\n if (fqErr.Type === 0) {\n scope.errorMessage = replaceParams(translations.feature_quantity_short_error, {\n amount: fqErr.ShortAmount,\n name: fqErr.FeatureGroup.Name\n });\n }\n if (fqErr.Type === 1) {\n scope.errorMessage = replaceParams(translations.feature_quantity_long_error, {\n amount: fqErr.FeatureGroup.Quantity,\n name: fqErr.FeatureGroup.Name\n });\n }\n var featuremessage = $('.feature-quantity-error');\n featuremessage.modal('show');\n return;\n }\n var orderItem = _objectSpread2({}, _this._orderItem);\n orderItem.OrderItemFeatures = _this._getSelectedFeatures();\n _this._updateOrderItem();\n var result = _this._cartService.add(orderItem);\n $('.feature-modal').modal('hide');\n document.getElementById('notification').style.display = 'block';\n setTimeout(function () {\n document.getElementById('notification').style.display = 'none';\n }, 1000);\n };\n this._updateOrderItem();\n var orderMode = AppStorage.getItem(StorageKey.SETTINGS)['QrMenuOrderMode'];\n if (orderMode === 4) {\n return new Promise(function () {\n var reservation = AppStorage.getItem(StorageKey.RESERVATION);\n var searchedCode = reservation.Type === 5 ? 'UAI' : reservation.Type === 4 ? 'AI' : '';\n for (var key in _this._quantities) {\n if (_this._quantities[key].code === searchedCode) {\n _this._quantities[key].quantity = 1;\n break;\n }\n }\n scope._onClickAddToCart();\n });\n }\n return new Promise(function () {\n $('.feature-modal').modal('show');\n });\n }\n }, {\n key: \"_getDefaultFeatures\",\n value: function _getDefaultFeatures() {\n var _this2 = this;\n var features = [];\n this._product.ProductFeatureGroups.map(function (fg) {\n var feature = _this2._getDefaultFeature(fg);\n if (feature == null) {\n return;\n }\n features.push(feature);\n });\n return features;\n }\n }, {\n key: \"_getDefaultFeature\",\n value: function _getDefaultFeature(productFeatureGroup) {\n var features = productFeatureGroup.ProductFeature;\n var feature = features.find(function (feature) {\n return feature.Dafault;\n });\n if (!features[0].Countable && productFeatureGroup.Type !== 0) {\n return null;\n }\n if (feature == null) {\n feature = features.find(function (feature) {\n return feature.Value === 1;\n });\n }\n if (feature == null) {\n feature = features[0];\n }\n return feature;\n }\n }, {\n key: \"_getSelectedFeatures\",\n value: function _getSelectedFeatures() {\n var _this3 = this;\n var features = [];\n Object.keys(this._quantities).map(function (key) {\n var _f$quantity;\n var f = _this3._quantities[key];\n var q = (_f$quantity = f.quantity) !== null && _f$quantity !== void 0 ? _f$quantity : 1;\n for (var i = 0; i < q; i++) {\n var _orderItemFeature$Des, _orderItemFeature$Qua;\n var productFeatureGroup = _this3._product.ProductFeatureGroups.find(function (i) {\n return i.ProductFeatureGroupID === f.featureGroupId;\n });\n var feature = productFeatureGroup.ProductFeature.find(function (i) {\n return i.ProductFeatureID === +key;\n });\n var orderItemFeature = new OrderItemFeature();\n orderItemFeature = Object.assign(orderItemFeature, feature);\n orderItemFeature.Description = (_orderItemFeature$Des = orderItemFeature.Description) !== null && _orderItemFeature$Des !== void 0 ? _orderItemFeature$Des : '';\n orderItemFeature.Quantity = (_orderItemFeature$Qua = orderItemFeature.Quantity) !== null && _orderItemFeature$Qua !== void 0 ? _orderItemFeature$Qua : 1;\n features.push(orderItemFeature);\n }\n });\n return features;\n }\n }, {\n key: \"_setFeatureChunk\",\n value: function _setFeatureChunk() {\n var _iterator3 = _createForOfIteratorHelper(this._product.ProductFeatureGroups),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var featureGroup = _step3.value;\n featureGroup._featureChunk = lodash.chunk(featureGroup.ProductFeature, featureGroup.ProductFeature.length);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }, {\n key: \"_updateOrderItem\",\n value: function _updateOrderItem(self) {\n if (typeof self === 'undefined') {\n self = this;\n }\n self.selected_product_feature_price = 0;\n Object.values(this._quantities).map(function (f) {\n var _f$quantity2;\n var quantity = (_f$quantity2 = f.quantity) !== null && _f$quantity2 !== void 0 ? _f$quantity2 : 1;\n self.selected_product_feature_price += quantity * f.price;\n });\n self._timeout(function () {\n self._orderItem.TotalPrice = self.selected_product_feature_price + self._orderItem.Price;\n self._orderItem.TotalPrice *= self._orderItem.Quantity;\n });\n }\n }, {\n key: \"_checkFeaturesQuantity\",\n value: function _checkFeaturesQuantity() {\n var _this4 = this;\n var fgs = this._product.ProductFeatureGroups;\n if (fgs === null || fgs.length === 0) {\n return null;\n }\n var hasError = null;\n var _iterator4 = _createForOfIteratorHelper(fgs),\n _step4;\n try {\n var _loop2 = function _loop2() {\n var fg = _step4.value;\n if (fg.Quantity === 0 && fg.Minimum === 0) return \"continue\";\n selectQuantity = 0;\n Object.keys(_this4._quantities).map(function (key) {\n var f = _this4._quantities[key];\n if (f.featureGroupId === fg.ProductFeatureGroupID) {\n selectQuantity += f.quantity;\n }\n });\n if (selectQuantity < fg.Minimum) {\n hasError = {\n FeatureGroup: fg,\n ShortAmount: fg.Minimum,\n SelectedQuantity: selectQuantity,\n Type: 0\n };\n return \"break\";\n }\n if (selectQuantity > fg.Quantity) {\n hasError = {\n FeatureGroup: fg,\n ShortAmount: fg.Quantity,\n SelectedQuantity: selectQuantity,\n Type: 1\n };\n return \"break\";\n }\n if (selectQuantity) {\n hasError = {\n SelectedQuantity: selectQuantity,\n Type: -1\n };\n return \"break\";\n }\n };\n _loop: for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var selectQuantity;\n var _ret = _loop2();\n switch (_ret) {\n case \"continue\":\n continue;\n case \"break\":\n break _loop;\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n return hasError;\n }\n }]);\n return ProductFeatureService;\n}();\nvar productFeatureService = {\n productFeatureService: function productFeatureService($rootScope, $timeout, cartService) {\n return new ProductFeatureService($rootScope, $timeout, cartService);\n }\n};\n\nvar thumbnailFilter = {\n thumbnail: function thumbnail() {\n return function (imageUrl, size) {\n return getThumbnail(imageUrl);\n };\n }\n};\n\nvar joinFilter = {\n join: function join() {\n return function (array) {\n var join = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n var key = arguments.length > 2 ? arguments[2] : undefined;\n if (!lodash.isArray(array)) {\n return \"\";\n }\n if (key === undefined) {\n return array.join(join);\n }\n return array.map(function (i) {\n return i[key];\n }).join(join);\n };\n }\n};\n\nvar CommonVariablesService = function () {\n function CommonVariablesService() {\n _classCallCheck(this, CommonVariablesService);\n this._subject = new ReplaySubject();\n this._variables = {};\n }\n _createClass(CommonVariablesService, [{\n key: \"getItem\",\n value: function getItem(key) {\n var _this$_variables$key;\n return (_this$_variables$key = this._variables[key]) !== null && _this$_variables$key !== void 0 ? _this$_variables$key : null;\n }\n }, {\n key: \"setItem\",\n value: function setItem(key, value) {\n this._variables[key] = value;\n this._subject.next(this._variables);\n }\n }, {\n key: \"getSubject\",\n value: function getSubject() {\n return this._subject;\n }\n }, {\n key: \"getLangCode\",\n value: function getLangCode() {\n return AppStorage.getItem(\"LanguageCode\");\n }\n }]);\n return CommonVariablesService;\n}();\nvar commonVariablesService = {\n commonVariablesService: function commonVariablesService() {\n return new CommonVariablesService();\n }\n};\n\nvar categoryThemeComponent = {\n categoryTheme: {\n bindings: {},\n templateUrl: 'app/components/categories/category/category-theme/category-theme.component.html',\n controller: function controller($scope, $location, $stateParams, $timeout, $state, apiService, dataService, $transitions, productFeatureService, commonVariablesService) {\n $scope.setMenuData = function (menu) {\n $scope.menu = menu;\n $timeout(function () {\n commonVariablesService.setItem('headerHidden', false);\n commonVariablesService.setItem('feedbackHidden', true);\n commonVariablesService.setItem('footerHidden', true);\n commonVariablesService.setItem('showBack', true);\n commonVariablesService.setItem('languageHidden', false);\n commonVariablesService.setItem('appBarHidden', true);\n angular.element('#den').addClass('cmp-box-shadow-2');\n commonVariablesService.setItem('metaTitle', menu['Name']);\n $scope.languageCode = AppStorage.getItem(StorageKey.LANGUAGE_CODE);\n $scope.languages = AppStorage.getItem(StorageKey.LANGUAGES);\n });\n };\n $scope.setAppSettings = function (settings) {\n $scope.QrMenuSettings = settings;\n $scope.CurrencyType = localStorage.getItem(StorageKey.CURRENCY);\n $scope.QrMenuViewMode = $scope.QrMenuSettings['QrMenuViewMode'];\n $scope.QrMenuThemeColor = $scope.QrMenuSettings['QrMenuThemeColor'];\n $scope.QrMenuLogoMode = $scope.QrMenuSettings['QrMenuLogoMode'];\n if ($scope.QrMenuViewMode !== 2) {\n $state.go('app.categories.categoryList');\n }\n };\n var customerData = dataService._getCustomer();\n if (customerData && Object.keys(customerData).length !== 0) {\n $scope.customerImageUrl = customerData.ImageUrl;\n if ($scope.QrMenuLogoMode === 0) {\n $scope.customerImageUrl = customerData.ImageUrl;\n } else {\n var _customerData$LogoUrl;\n $scope.customerImageUrl = (_customerData$LogoUrl = customerData.LogoUrl) !== null && _customerData$LogoUrl !== void 0 ? _customerData$LogoUrl : customerData.ImageUrl;\n }\n $scope.setAppSettings(customerData['Settings']);\n }\n var menuData = dataService._getMenu();\n if (menuData && Object.keys(menuData).length !== 0) {\n $scope.setMenuData(menuData);\n }\n dataService._customerObservable().subscribe(function (customer) {\n $scope.$apply(function () {\n if ($scope.QrMenuLogoMode === 0) {\n $scope.customerImageUrl = customer.ImageUrl;\n } else {\n var _customer$LogoUrl;\n $scope.customerImageUrl = (_customer$LogoUrl = customer.LogoUrl) !== null && _customer$LogoUrl !== void 0 ? _customer$LogoUrl : customer.ImageUrl;\n }\n $scope.setAppSettings(customer['Settings']);\n });\n });\n dataService._menuObservable().subscribe(function (menu) {\n $scope.$apply(function () {\n $scope.setMenuData(menu);\n });\n });\n }\n }\n};\n\nangular_1.module('app', [uiRouter, 'pascalprecht.translate']).config([\"$stateProvider\", \"$urlRouterProvider\", \"$translateProvider\", function ($stateProvider, $urlRouterProvider, $translateProvider) {\n appRoutes($stateProvider, $urlRouterProvider);\n initTranslations($translateProvider);\n}]).run([\"$rootScope\", function ($rootScope) {\n ($rootScope.initTranslations = function () {\n $rootScope.translations = {};\n var translations = getTranslation().values;\n var keys = Object.keys(translations);\n var values = Object.values(translations);\n for (var i = 0; i < keys.length; i++) {\n $rootScope.translations[keys[i]] = values[i];\n }\n })();\n}]).component(appComponent).component(headerComponent).component(footerComponent).component(categoriesComponent).component(categoryListComponent).component(categoryThemeComponent).component(categoryComponent).component(productComponent).component(feedbackComponent).component(basketComponent).component(loginComponent).component(thanksComponent).component(ordersComponent).directive(languageDirective).directive(feedbackDirective).directive(searchBarDirective).directive(longPressDirective).directive(categoryListItemDirective).directive(categoryDetailItemDirective).directive(categoryCardItemDirective).directive(imageAppearDirective).directive(guestCallDirective).factory(urlQueryService).factory(workingHoursService).factory(apiService).factory(dataService).factory(commonVariablesService).factory(cartService).factory(orderApiService).factory(productFeatureService).filter(thumbnailFilter).filter(joinFilter);\n"],"file":"app.module.js"}